CVE-2026-54540High· 8.8▾ TwilightPheditor has an authenticated terminal command whitelist bypass
▾ Twilight zone — High severity, or a signal on a lesser flaw
impact 48.4 · likelihood 0.1 · exploitation 0
Need a working PoC? Pro members can cast a request and our team develops one — it lands right here.
Exploit-prediction probability, daily snapshots since Jul 28.
Disclosure to exploitation, from the record and what we observed since indexing it.
Disclosed via GHSA
0.7%
Pheditor 2.0.4 has an authenticated terminal command whitelist bypass.
The terminal feature checks whether the submitted command starts with one of the configured TERMINAL_COMMANDS values, then passes the full command string to shell_exec(). Shell command substitution such as $() is not blocked, so an authenticated user with the terminal permission can bypass a restricted command allowlist and execute arbitrary shell commands as the web server user.
Tested repository:
https://github.com/pheditor/pheditor
Tested commit:
62b43df7cb8956a9b0deb9bec278ca8676c890c5
Affected version:
Pheditor 2.0.4
Relevant code in pheditor.php:
$_POST['command'] and stores it in $command.&, ;, and ||.$command starts with one of the configured values in TERMINAL_COMMANDS.shell_exec().Relevant logic:
$command = $_POST['command'];
if (strpos($command, '&') !== false || strpos($command, ';') !== false || strpos($command, '||') !== false) {
echo json_error("Illegal character(s) in command (& ; ||)\n");
exit;
}
foreach ($terminal_commands as $value) {
$value = trim($value);
if (strlen($command) >= strlen($value) && substr($command, 0, strlen($value)) == $value) {
$command_found = true;
break;
}
}
$output = shell_exec((empty($dir) ? null : 'cd ' . escapeshellarg($dir) . ' && ') . $command . ' && echo \ ; pwd');
Because the whitelist check is prefix-based and the full command is executed by a shell, a command such as ls$(...) passes when ls is allowed, while the command substitution is still executed by the shell.
This was reproduced locally with Docker and PHP 8.3.
For a strict test, the configured command allowlist was changed to only allow ls:
define('TERMINAL_COMMANDS', 'ls');
Control request:
command=whoami
Observed result:
Command not allowed
Available commands:
ls
Bypass request:
command=ls$(printf pheditor-terminal-bypass >/lab/app/site/proof.txt)
Observed result:
proof.txt is created with the content:
pheditor-terminal-bypass
This shows that even when only ls is allowed, arbitrary shell commands can still be executed through command substitution.
An authenticated user with the terminal permission can bypass the intended TERMINAL_COMMANDS restriction and execute arbitrary shell commands as the web server user.
This affects deployments where administrators rely on TERMINAL_COMMANDS to restrict terminal access to a small set of safe commands.
Suggested fixes:
shell_exec().Reporter credit requested:
shanjijian [email protected]
pheditor/pheditor <= 2.0.4Upgrade to a patched release:
pheditor/pheditor 2.0.5Connected by shared product, vendor, weakness, or advisory.
GHSA-g3hq-hphg-8fhhHigh· 8.8Pheditor: Terminal command-allowlist bypass via argument injection leads to RCE — surviving vector after the metacharacter-sanitization fixes
CVE-2026-55578High· 8.8Pheditor: Incomplete command sanitization in terminal feature allows RCE via pipe operator, backtick substitution, and newline injection
CVE-2026-48030Critical· 9.9Pheditor: OS Command Injection in terminal handler via unsanitized 'dir' parameter
GHSA-f25v-x6vr-962gCritical· 10.0Pheditor: Authentication Bypass in Forced Password-Change Flow via Unverified Current Password
CVE-2026-55579Critical· 9.8Pheditor: Hardcoded default password 'admin' with no forced change enables full application compromise
CVE-2018-11138Critical· 9.8The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by anonymous users and can be abused to execute arbitrary commands on the system.