PT-2017-4155 · Phpunity +1 · Phpunit +1
Published
2017-06-27
·
Updated
2025-09-29
·
CVE-2017-9841
CVSS v2.0
10
  10
Critical
| Base vector | Vector | AV:N/AC:L/Au:N/C:C/I:C/A:C | 
Name of the Vulnerable Software and Affected Versions
PHPUnit versions 4.8.19 through 4.8.27
PHPUnit versions 5.x before 5.6.3
Description
The issue is related to the Util/PHP/eval-stdin.php component in PHPUnit, which allows remote attackers to execute arbitrary PHP code via HTTP POST data beginning with a "<?php " substring. This can be exploited by accessing the /vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php URI on a site with an exposed /vendor folder. The vulnerability is due to incorrect code generation management, which can be exploited using a specially crafted HTTP POST request.
Recommendations
For versions 4.8.19 through 4.8.27, update to version 4.8.28 or later.
For versions 5.x before 5.6.3, update to version 5.6.3 or later.
As a temporary workaround, consider restricting access to the /vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php URI to minimize the risk of exploitation.
Exploit
Fix
RCE
Code Injection
 Found an issue in the description?  Have something to add?  Feel free to write us 👾 
dbugs@ptsecurity.com
Weakness Enumeration
Related Identifiers
BDU:2021-04398
CVE-2017-9841
GHSA-R7C9-C69M-RPH8
MGASA-2017-0429
USN-7171-1
Affected Products
Phpunit
Ubuntu
References · 68
- 🔥 https://github.com/FriendsOfPHP/security-advisories/blob/master/phpunit/phpunit/CVE-2017-9841.yaml⭐ 2049 🔗 306 · Exploit
- 🔥 https://github.com/RandomRobbieBF/phpunit-brute⭐ 25 🔗 21 · Exploit
- 🔥 https://github.com/rodnt/laravel-phpunit-rce-masscaner⭐ 21 🔗 9 · Exploit
- 🔥 https://github.com/rdpwn/laravel-phpunit-rce-masscaner⭐ 21 🔗 9 · Exploit
- 🔥 https://github.com/0xrodt/laravel-phpunit-rce-masscaner⭐ 21 🔗 9 · Exploit
- 🔥 https://github.com/unp4ck/laravel-phpunit-rce-masscaner⭐ 21 🔗 9 · Exploit
- 🔥 https://github.com/incogbyte/laravel-phpunit-rce-masscaner⭐ 21 🔗 9 · Exploit
- 🔥 https://github.com/0xrdf/laravel-phpunit-rce-masscaner⭐ 21 🔗 9 · Exploit
- 🔥 https://github.com/MadExploits/PHPunit-Exploit⭐ 4 🔗 2 · Exploit
- 🔥 https://github.com/ludy-dev/PHPUnit_eval-stdin_RCE⭐ 6 · Exploit
- 🔥 https://github.com/Chocapikk/CVE-2017-9841⭐ 4 🔗 1 · Exploit
- 🔥 https://github.com/MrG3P5/CVE-2017-9841⭐ 4 · Exploit
- 🔥 https://github.com/akr3ch/CVE-2017-9841⭐ 2 🔗 2 · Exploit
- 🔥 https://exploit-db.com/exploits/50702 · Exploit
- https://github.com/sebastianbergmann/phpunit/commit/284a69fb88a2d0845d23f42974a583d8f59bf5a5⭐ 19925 🔗 2217 · Patch