My First RCE: Critical Bug on a Redacted Subdomain
An old PHPUnit eval-stdin.php file was left publicly accessible on a subdomain, allowing unauthenticated remote code execution. An attacker could run arbitrary system commands on the server as the web user.
Published on mrknightnidu.medium.com
Hello. I’m MRKNIGHT-NIDU.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely an outdated PHPUnit component was left in the web root, exposing its eval-stdin.php script that executes attacker-supplied PHP.
Impact
An unauthenticated attacker could execute arbitrary system commands on the server, as demonstrated by running an identity command.
What the attacker needed
None
The fix
The vulnerable endpoint was removed and patched after the report.
How it was found
- Find the eval-stdin.php path during reconnaissance.
- Look up the known vulnerability for that file.
- Send a POST request containing PHP code to the endpoint.
- Observe command output confirming code execution.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A leftover test file from an old version of a PHP testing tool was still reachable on the website. That file accepts code sent in a request and runs it on the server, so anyone who found the address could make the server execute commands.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.