
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-54540 is an authenticated OS command injection vulnerability in Pheditor, a PHP-based file editor, caused by an incomplete command allowlist bypass in its terminal feature. Affecting Pheditor versions 2.0.4 and earlier, it allows any authenticated user with the terminal permission to execute arbitrary shell commands as the web server user by exploiting shell command substitution syntax ($()). The vulnerability was reported by researcher shanjijian, published by the maintainer on June 5, 2026, and added to the GitHub Advisory Database on July 16, 2026. It carries a CVSS v3.1 base score of 8.8 (High) (Github Advisory, Pheditor Advisory).
The root cause is CWE-78 (Improper Neutralization of Special Elements used in an OS Command). In pheditor.php, the terminal handler reads $_POST['command'] and applies a blocklist that only filters &, ;, and || characters, then performs a prefix-based check against the configured TERMINAL_COMMANDS allowlist before passing the full, unsanitized string to shell_exec(). Because the prefix check only validates the beginning of the command string and $() (command substitution) is not blocked, an attacker can craft a payload like ls$(malicious_command) — which passes the ls prefix check — while the shell evaluates and executes the embedded substitution. The fix in version 2.0.5 adds $ to the list of blocked characters, preventing command substitution syntax (Github Advisory, Pheditor Release).
Successful exploitation grants an authenticated attacker arbitrary shell command execution as the web server process (e.g., www-data), resulting in high confidentiality, integrity, and availability impact. An attacker can read, modify, or delete files accessible to the web server, deploy web shells, exfiltrate sensitive data, or pivot to other systems on the same network. This is particularly impactful in deployments where administrators believed TERMINAL_COMMANDS restrictions provided meaningful access control (Github Advisory).
terminal permission enabled.whoami) to observe the error message listing allowed TERMINAL_COMMANDS values (e.g., ls).$() substitution, e.g.: ls$(id > /var/www/html/pwned.txt)POST /pheditor.php with body command=ls$(id+>+/var/www/html/pwned.txt)https://target/pwned.txt to see the output of id).pheditor.php with command parameter values containing $(, `, or other shell metacharacters; repeated failed command attempts followed by a successful bypass pattern.sh, bash, curl, wget, python, nc) visible in process trees or audit logs.Upgrade Pheditor to version 2.0.5, which fixes the vulnerability by blocking the $ character in terminal command input, preventing shell command substitution. As an interim workaround, restrict the terminal permission to only highly trusted users, or disable the terminal feature entirely if it is not required. Administrators should also consider implementing network-level controls to limit access to Pheditor instances to trusted IP ranges (Pheditor Release, Github Advisory).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."