Описание
Pheditor: Hardcoded default password 'admin' with no forced change enables full application compromise
Summary
Pheditor ships with a hardcoded default password admin (SHA-512 hash stored at pheditor.php:11). There is no mechanism to force a password change on first login. Any deployment using the default credentials grants an attacker full access to the file editor, file upload, and terminal features, enabling arbitrary file read/write and remote code execution.
Details
Tested repository: https://github.com/pheditor/pheditor
Tested commit: e538f05b6faec99e5b23726bc9c17d6b57774297 (current HEAD on main)
Affected version: All versions of Pheditor
The password is hardcoded at pheditor.php:11:
This is the SHA-512 hash of the string admin:
The application displays a warning banner at pheditor.php:1956-1958 when the default password is in use, but this is only visual — there is no forced password change, no expiry, no lockout, and no setup wizard. Many deployments run with the default indefinitely.
The password hash is stored as unsalted SHA-512 in the source code. The password change feature (lines 363-391) writes the new hash directly into the PHP source file, meaning anyone with read access to the source can extract it.
Combined impact: With the default password, an unauthenticated attacker can authenticate and exploit the terminal RCE and file upload vulnerabilities for immediate server compromise.
PoC
Environment: Any system running Pheditor with default configuration.
Setup:
Positive trigger — authenticate with default password:
Expected: 200 — successful authentication with the default password admin.
Verify full access:
Expected: id output showing web server user — proves full system access through default credentials combined with terminal RCE.
Control (wrong password):
Expected: not correct — authentication logic works but default password is trivially guessable.
Cleanup:
Impact
Use of Hard-coded Credentials (CWE-798). The default password admin is publicly documented in the source code, trivially guessable, and there is no mechanism to force a password change on first login. This effectively grants unauthenticated remote attackers full administrator access to the application.
Attacker privileges: Unauthenticated remote attacker (PR:N).
Security boundary crossed: Unauthenticated → fully authenticated administrator.
Confidentiality impact: High — read all files within MAIN_DIR and beyond (via terminal).
Integrity impact: High — write/delete files, upload webshells, modify application code, execute arbitrary commands.
Availability impact: High — delete files and directories, disrupt services.
Suggested remediation:
- Remove the default password — require user to set a password during installation.
- Add a setup wizard that forces password creation on first access.
- Add a forced password change on first login with default credentials.
- Use
password_hash()/password_verify()withPASSWORD_BCRYPTinstead of raw SHA-512.
Credits
- Thai Son Dinh from VinSOC Labs (R&D)
Пакеты
pheditor/pheditor
>= 2.0.1, < 2.0.6
2.0.6
Связанные уязвимости
Pheditor is a single-file editor and file manager written in PHP. From version 2.0.1 to before version 2.0.6, Pheditor ships with a hardcoded default password admin (SHA-512 hash stored at pheditor.php:11). There is no mechanism to force a password change on first login. Any deployment using the default credentials grants an attacker full access to the file editor, file upload, and terminal features, enabling arbitrary file read/write and remote code execution. This issue has been patched in version 2.0.6.