Skip to main content

Pheditor 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 · GitHub Advisory
Share

Severity by source

GitHub Advisory 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 GitHub Advisory.

CVSS VectorGitHub Advisory

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
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

DescriptionGitHub Advisory

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

Unlock full vulnerability intelligence

  • Risk assessment & exploitation conditions
  • Attack chain visualization
  • Remediation with exact patch versions
  • Threat intelligence from 22 sources
  • Personal watchlist & email alerts

Free forever · No credit card required

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata

Access
Authenticate with terminal permission
Delivery
Craft allowed prefix plus $() substitution
Exploit
Bypass TERMINAL_COMMANDS allowlist
Execution
shell_exec runs substituted command
Impact
Execute arbitrary commands as web server user

Vulnerability AssessmentAI

Exploitation 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. … Additional conditions and limiting factors are described in the full assessment.
Risk Assessment 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. … Full risk analysis with EPSS, KEV, and SSVC signal comparison available after sign-in.
Exploit Scenario 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.
Remediation 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). … Detailed patch versions, workarounds, and compensating controls in full report.

Recommended ActionAI

Within 24 hours, inventory all Pheditor 2.0.4 deployments and identify all user accounts granted the 'terminal' permission; document the business justification for each grant and flag any inactive or overprivileged accounts. …

Sign in for detailed remediation steps and compensating controls.

Threat intelligence, references, and detailed analysis are available after sign-in.

More in Docker

View all
CVE-2024-55964 CRITICAL POC
9.8 Mar 26

An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl

CVE-2019-5736 HIGH POC
8.6 Feb 11

runc through version 1.0-rc6 (used in Docker before 18.09.2) contains a container escape vulnerability that allows attac

CVE-2023-32077 HIGH POC
7.5 Aug 24

Netmaker makes networks with WireGuard. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no a

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2023-5815 HIGH POC
8.1 Nov 22

The News & Blog Designer Pack - WordPress Blog Plugin - (Blog Post Grid, Blog Post Slider, Blog Post Carousel, Blog Post

CVE-2014-9357 CRITICAL
10.0 Dec 16

Docker 1.3.2 allows remote attackers to execute arbitrary code with root privileges via a crafted (1) image or (2) build

CVE-2026-34156 CRITICAL POC
9.9 Mar 30

Remote code execution in NocoBase Workflow Script Node (npm @nocobase/plugin-workflow-javascript) allows authenticated l

CVE-2019-15752 HIGH POC
7.8 Aug 28

Docker Desktop Community Edition before 2.1.0.1 allows local users to gain privileges by placing a Trojan horse docker-c

CVE-2025-34221 CRITICAL POC
10.0 Sep 29

Vasion Print (formerly PrinterLogic) Virtual Appliance Host prior to version 25.2.169 and Application prior to version 2

CVE-2024-23054 CRITICAL POC
9.8 Feb 05

An issue in Plone Docker Official Image 5.2.13 (5221) open-source software that could allow for remote code execution du

CVE-2025-23211 CRITICAL POC
9.9 Jan 28

Tandoor Recipes is an application for managing recipes, planning meals, and building shopping lists. Rated critical seve

CVE-2026-46339 CRITICAL POC
10.0 May 19

Unauthenticated remote code execution in 9router (npm package) versions 0.4.30 through 0.4.36 allows network-adjacent at

Share

CVE-2026-54540 vulnerability details – vuln.today

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