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
Share

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

Lifecycle Timeline

3
Source Code Evidence Fetched
Jul 16, 2026 - 20:32 vuln.today
Analysis Generated
Jul 16, 2026 - 20:32 vuln.today
CVE Published
Jul 16, 2026 - 20:01 github-advisory
HIGH 8.8

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>

AnalysisAI

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.

Technical ContextAI

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.

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.

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

Share

EUVD-2026-49385 vulnerability details – vuln.today

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