Skip to main content

Pheditor EUVDEUVD-2026-49385

| CVE-2026-54540 HIGH
OS Command Injection (CWE-78)
2026-07-16 https://github.com/pheditor/pheditor GHSA-9643-6xjp-vx57
8.8
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. Access
    Authenticate with terminal permission
  2. Delivery
    Craft allowed prefix plus $() substitution
  3. Exploit
    Bypass TERMINAL_COMMANDS allowlist
  4. Execution
    shell_exec runs substituted command
  5. Impact
    Execute arbitrary commands as web server user

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

Requires an authenticated Pheditor session whose account holds the 'terminal' permission (CVSS PR:L), and requires that the deployment actually uses the terminal feature with a configured TERMINAL_COMMANDS allowlist that the attacker is meant to be confined to - the vulnerability is precisely the ability to escape that allowlist. The concrete trigger is including shell command-substitution syntax ($() or ${}) after an allowed command prefix (e.g. ls$(...)), since only '&', ';', and '||' are filtered and validation is prefix-based. Limiting factors: exploitation is impossible without a valid credentialed account carrying the terminal permission, so it is not remote-unauthenticated; impact is bounded to the privileges of the web server user; and installations that disable the terminal feature or do not grant the terminal permission are not exploitable.

Impact

The CVSS 3.1 base score is 8.8 (High) with vector AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H, reflecting network reach, low complexity, and full CIA impact - but PR:L is the decisive limiter: exploitation requires an authenticated account that already holds the 'terminal' permission, which is itself a privileged capability. In practice this is a privilege-boundary bypass (escaping the allowlist) rather than an unauthenticated RCE, so real-world risk is gated by who can obtain terminal-permission accounts. No EPSS score, KEV entry, or SSVC decision data was provided; there is no CISA KEV listing, so this is not confirmed actively exploited. A reliable PoC exists (in the advisory), which raises practical exploitability for anyone with the required access. Net assessment: a genuine high-impact issue where credentialed/permissioned access is the real gate, more relevant as a defense-in-depth failure than as an internet-wide mass-exploitation threat.

Exploit ScenarioDerived

An attacker with a low-privilege Pheditor account that has been granted the 'terminal' permission - for example a junior operator restricted to only 'ls' - submits command=ls$(printf pheditor-terminal-bypass >/lab/app/site/proof.txt). The allowlist prefix check passes on 'ls', but the shell executes the $() substitution, writing an attacker-controlled file and demonstrating arbitrary command execution as the web server user; a published PoC confirms this works against a default install.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.7% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Jul 16, 2026

Authenticated command-injection in Pheditor 2.0.4 lets any user holding the 'terminal' permission bypass the TERMINAL_COMMANDS allowlist and run arbitrary OS commands as the web server user. The terminal handler only blocks '&', ';', and '||' and validates commands with a prefix check before handing the full string to shell_exec(), so shell substitution like ls$(...) satisfies the allowlist while executing attacker-controlled code. A working PoC is published in the GitHub advisory, though there is no public exploit identified as a standalone weaponized tool and no active exploitation reported.

RemediationAI

Vendor-released patch: 2.0.5 - upgrade Pheditor to 2.0.5 or later, which blocks the '$' character used for shell substitution (see the release notes at https://github.com/pheditor/pheditor/releases/tag/2.0.5 and advisory GHSA-9643-6xjp-vx57). If immediate patching is not possible, reduce exposure by revoking the 'terminal' permission from all non-essential accounts or disabling the terminal feature entirely (the vendor itself suggests disabling it by default), accepting the trade-off that legitimate in-app shell access is lost. As a stopgap you may set TERMINAL_COMMANDS to an empty value to deny all commands, but do not rely on the allowlist as a security boundary since prefix matching plus shell_exec() is inherently bypassable; also restrict network access to the Pheditor interface to trusted operators. The durable fix (per the reporter's guidance) is to run commands without a shell using an argument-array process API and require exact command-name matching rather than prefix matching.

Affected VersionsENISA

pheditor < 2.0.5

Affected Packages

composer pheditor/pheditor fix: 2.0.5
euvd pheditor fix: 2.0.5

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 single-file PHP-based web file manager/editor (distributed as the Composer package pheditor/pheditor) that includes a terminal feature intended to be constrained to a small allowlist defined by the TERMINAL_COMMANDS constant. The root cause is CWE-78 (OS Command Injection): in pheditor.php the user-supplied $_POST['command'] is validated with substr()-based prefix matching (substr($command,0,strlen($value)) == $value) and a denylist of only three metacharacter sequences, then concatenated into a string passed to shell_exec() ('cd ... && ' . $command . ' && echo ; pwd'). Because shell_exec() invokes /bin/sh, shell features the denylist ignores - notably command substitution $() and ${}, plus backticks, pipes, newlines and redirection - are interpreted by the shell even though the leading token still matches an allowed command like 'ls'. The fix in 2.0.5 blocks the '$' character used for substitution.

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 8.8 HIGH
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
vuln.today AI 8.8 HIGH

Network-reachable web feature (AV:N), trivial substitution payload (AC:L), but requires an authenticated account with the terminal permission (PR:L); arbitrary OS command execution as web user gives full C/I/A.

3.1 AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (https://github.com/pheditor/pheditor).

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

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

DescriptionCVE.org

Summary

Pheditor 2.0.4 has an authenticated terminal command whitelist bypass.

The terminal feature checks whether the submitted command starts with one of the configured TERMINAL_COMMANDS values, then passes the full command string to shell_exec(). Shell command substitution such as $() is not blocked, so an authenticated user with the terminal permission can bypass a restricted command allowlist and execute arbitrary shell commands as the web server user.

Details

Tested repository:

https://github.com/pheditor/pheditor

Tested commit:

62b43df7cb8956a9b0deb9bec278ca8676c890c5

Affected version:

Pheditor 2.0.4

Relevant code in pheditor.php:

  • The terminal handler receives $_POST['command'] and stores it in $command.
  • It blocks only &, ;, and ||.
  • It checks whether $command starts with one of the configured values in TERMINAL_COMMANDS.
  • It then passes the full command string to shell_exec().

Relevant logic:

php
$command = $_POST['command'];

if (strpos($command, '&') !== false || strpos($command, ';') !== false || strpos($command, '||') !== false) {
    echo json_error("Illegal character(s) in command (& ; ||)\n");
    exit;
}

foreach ($terminal_commands as $value) {
    $value = trim($value);

    if (strlen($command) >= strlen($value) && substr($command, 0, strlen($value)) == $value) {
        $command_found = true;
        break;
    }
}

$output = shell_exec((empty($dir) ? null : 'cd ' . escapeshellarg($dir) . ' && ') . $command . ' && echo \ ; pwd');

Because the whitelist check is prefix-based and the full command is executed by a shell, a command such as ls$(...) passes when ls is allowed, while the command substitution is still executed by the shell.

PoC

This was reproduced locally with Docker and PHP 8.3.

For a strict test, the configured command allowlist was changed to only allow ls:

php
define('TERMINAL_COMMANDS', 'ls');

Control request:

text
command=whoami

Observed result:

text
Command not allowed
Available commands:
ls

Bypass request:

text
command=ls$(printf pheditor-terminal-bypass >/lab/app/site/proof.txt)

Observed result:

text
proof.txt is created with the content:
pheditor-terminal-bypass

This shows that even when only ls is allowed, arbitrary shell commands can still be executed through command substitution.

Impact

An authenticated user with the terminal permission can bypass the intended TERMINAL_COMMANDS restriction and execute arbitrary shell commands as the web server user.

This affects deployments where administrators rely on TERMINAL_COMMANDS to restrict terminal access to a small set of safe commands.

Suggested fixes:

  • Avoid passing user-controlled command strings to shell_exec().
  • Parse the command into executable and arguments.
  • Require an exact command name match instead of prefix matching.
  • Execute without a shell, for example with an argument-array based process API.
  • If shell execution remains necessary, reject shell metacharacters comprehensively, including command substitution syntax.
  • Consider disabling the terminal feature by default.

Reporter credit requested:

shanjijian <shanjijian@gmail.com>

Executive ViewAI

Why It Matters

Pheditor 2.0.4 contains an authenticated command-injection vulnerability (CVE-2026-54540, CVSS 8.8) with publicly available exploit code that allows users with terminal permissions to execute arbitrary OS commands as the web server user through a command-validation bypass. Any user with terminal access can exploit this vulnerability for privilege escalation and system compromise, creating significant organizational risk. Immediate access control review and interim mitigations are required to prevent exploitation.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Restrict 'terminal' permission to essential administrators only; disable the terminal feature entirely if not operationally critical; implement real-time audit logging and alerting on terminal command execution; deploy Web Application Firewall rules to block shell metacharacters and command substitution syntax; segment Pheditor network access through IP allowlisting and multi-factor authentication enforcement; isolate or air-gap instances to prevent lateral movement if exploited.

Threat Intelligence Overview

EPSS Score
0.7%
Top 50% exploitable
Prevalence
Rare
niche open-source single-file PHP file editor, tiny production footprint
Threat Intel
1
1 source
Data Quality
4 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 HIGH
CISA KEV No
Public POC No
EPSS 0.7%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
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
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact
High

Priority Score

45
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +44
PoC: 0
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.

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