{"id":"CVE-2017-9841","published":"2017-06-27T17:29:00Z","modified":"2026-06-17T01:29:01Z","title":"PHPUnit Command Injection Vulnerability","vendor":"PHPUnit","product":"PHPUnit","tier":"core","eol":null,"description":{"text":"Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP code via HTTP POST data beginning with a \"<?php \" substring, as demonstrated by an attack on a site with an exposed /vendor folder, i.e., external access to the /vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php URI.","provenance":"source","from":"NVD"},"summary":{"text":"The flaw is in the eval-stdin.php component of PHPUnit (Util/PHP/eval-stdin.php) in versions before 4.8.28 and 5.x before 5.6.3, which fails to control generation of code. An unauthenticated remote attacker can execute arbitrary PHP code by sending HTTP POST data beginning with a \"<?php \" substring, which is practical where the /vendor folder, and this file within it, is exposed to external access.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-10-29T08:31:41Z"},"cvss":{"score":9.8,"severity":"CRITICAL","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"NVD"},"epss":{"score":0.99999,"percentile":0.99994,"date":"2026-10-30","provenance":"source"},"kev":{"dateAdded":"2022-02-15","dueDate":"2022-08-15","ransomware":false,"requiredAction":"Apply updates per vendor instructions.","notes":"https://nvd.nist.gov/vuln/detail/CVE-2017-9841","provenance":"source"},"vulncheckKev":{"dateAdded":"2020-11-22","exploitedFirstSeen":"2020-11-22","ransomware":false,"evidence":[{"url":"https://www.imperva.com/blog/crimeops-of-the-kashmirblack-botnet-part-ii/","date":"2020-11-22"},{"url":"https://blogs.juniper.net/en-us/threat-research/sysrv-botnet-expands-and-gains-persistence","date":"2021-04-08"},{"url":"https://unit42.paloaltonetworks.com/network-attack-trends-winter-2020/","date":"2021-04-12"},{"url":"https://www.lacework.com/blog/sysrv-hello-expands-infrastructure/","date":"2021-04-22"},{"url":"https://www.bleepingcomputer.com/news/security/new-cryptomining-malware-builds-an-army-of-windows-linux-bots/","date":"2021-04-24"},{"url":"https://go.catonetworks.com/rs/245-RJK-441/images/Security%20Quarterly%20Report.pdf","date":"2021-06-02"},{"url":"https://go.catonetworks.com/rs/245-RJK-441/images/security%20Quarterly%20Report%20q2.pdf","date":"2021-08-17"},{"url":"https://cujo.com/the-sysrv-botnet-and-how-it-evolved/","date":"2021-09-22"},{"url":"https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json","date":"2022-02-15"},{"url":"https://www.botconf.eu/wp-content/uploads/2022/05/Botconf2022-24-PalotayZsigovits.pdf","date":"2022-04-27"}],"evidenceTotal":1128,"provenance":"source"},"exploited":true,"otx":{"pulseCount":50,"pulses":[{"name":"Actively_Exploited_Kev | Oct 29, 2026","url":"https://otx.alienvault.com/pulse/6ae20c1db17e7057ae7d9ad1","created":"2026-10-28"},{"name":"Actively_Exploited_Kev | Oct 28, 2026","url":"https://otx.alienvault.com/pulse/6ae0ba7e0e2a97ff7b218819","created":"2026-10-27"},{"name":"Actively_Exploited_Kev | Oct 27, 2026","url":"https://otx.alienvault.com/pulse/6adf68b85c3e852f3c111d18","created":"2026-10-26"},{"name":"Actively_Exploited_Kev | Oct 24, 2026","url":"https://otx.alienvault.com/pulse/6adb740e397c3ad4799aa4cd","created":"2026-10-23"},{"name":"Actively_Exploited_Kev | Oct 23, 2026","url":"https://otx.alienvault.com/pulse/6ada236fcfba2dfa730ea482","created":"2026-10-22"},{"name":"Actively_Exploited_Kev | Oct 22, 2026","url":"https://otx.alienvault.com/pulse/6ad8d33a077cbb5cab524d80","created":"2026-10-21"},{"name":"Actively_Exploited_Kev | Oct 21, 2026","url":"https://otx.alienvault.com/pulse/6ad78130c4d1ac2be83a8b6d","created":"2026-10-20"},{"name":"Actively_Exploited_Kev | Oct 20, 2026","url":"https://otx.alienvault.com/pulse/6ad62f63c24a405a3423cc13","created":"2026-10-19"},{"name":"Actively_Exploited_Kev | Oct 19, 2026","url":"https://otx.alienvault.com/pulse/6ad4dda174e5797d0bd238b7","created":"2026-10-18"},{"name":"Actively_Exploited_Kev | Oct 18, 2026","url":"https://otx.alienvault.com/pulse/6ad38c22e1848f8189d1c121","created":"2026-10-17"}],"provenance":"machine"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"}],"references":[{"url":"http://web.archive.org/web/20170701212357/http://phpunit.vulnbusters.com/","tags":["Third Party Advisory"]},{"url":"http://www.securityfocus.com/bid/101798","tags":["Broken Link"]},{"url":"http://www.securitytracker.com/id/1039812","tags":["Broken Link"]},{"url":"https://github.com/sebastianbergmann/phpunit/commit/284a69fb88a2d0845d23f42974a583d8f59bf5a5","tags":["Patch","Third Party Advisory"]},{"url":"https://github.com/sebastianbergmann/phpunit/pull/1956","tags":["Patch","Third Party Advisory"]},{"url":"https://security.gentoo.org/glsa/201711-15","tags":["Third Party Advisory"]},{"url":"https://www.oracle.com/security-alerts/cpuoct2021.html","tags":["Patch","Third Party Advisory"]},{"url":"http://web.archive.org/web/20170701212357/http://phpunit.vulnbusters.com/","tags":["Third Party Advisory"]},{"url":"http://www.securityfocus.com/bid/101798","tags":["Broken Link"]},{"url":"http://www.securitytracker.com/id/1039812","tags":["Broken Link"]},{"url":"https://github.com/sebastianbergmann/phpunit/commit/284a69fb88a2d0845d23f42974a583d8f59bf5a5","tags":["Patch","Third Party Advisory"]},{"url":"https://github.com/sebastianbergmann/phpunit/pull/1956","tags":["Patch","Third Party Advisory"]},{"url":"https://security.gentoo.org/glsa/201711-15","tags":["Third Party Advisory"]},{"url":"https://www.oracle.com/security-alerts/cpuoct2021.html","tags":["Patch","Third Party Advisory"]},{"url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2017-9841","tags":["US Government Resource"]}],"techniques":[{"id":"T1190","name":"Exploit Public-Facing Application","tactics":["initial-access"],"provenance":"source","basis":"ctid-cve","bases":["ctid-cve","ai-mapping"],"basisDetail":"CTID attack_to_cve (Phase 1); claude-haiku-5-5: Remote HTTP POST exploits publicly exposed PHPUnit endpoint","mappingType":"uncategorized","evidence":[{"from":"description","quote":"allows remote attackers to execute arbitrary PHP code via HTTP POST data","start":70,"end":142}],"confidence":"medium","confidenceNote":"AI-mapped from the description (quote-validated, not expert-reviewed)"},{"id":"T1059","name":"Command and Scripting Interpreter","tactics":["execution"],"provenance":"ai","basis":"ai-mapping","bases":["ai-mapping"],"basisDetail":"claude-haiku-5-5: Arbitrary PHP code execution on the server","mappingType":"primary_impact","evidence":[{"from":"description","quote":"allows remote attackers to execute arbitrary PHP code","start":70,"end":123}],"model":"claude-haiku-5-5","confidence":"medium","confidenceNote":"AI-mapped from the description (quote-validated, not expert-reviewed)"}],"reports":[{"id":"SRC-bf1b3fd29c4a38dbdb8c","title":"Picus-RedReport-2024","publisher":"picussecurity.com","url":"https://www.picussecurity.com/hubfs/Red%20Report%202024/Picus-RedReport-2024.pdf","date":null,"mentions":[{"quote":"vulnerability (identified as CVE-2017-9841) allowed attackers to open a reverse shell on port","start":209303,"end":209396}]}],"affected":[{"ecosystem":"Packagist","package":"phpunit/phpunit","vulnerableRanges":[">=4.8.19, <4.8.28",">=5.0.10, <5.6.3"],"patched":["4.8.28","5.6.3"],"from":["GHSA-r7c9-c69m-rph8"],"provenance":"source"}],"advisories":[{"id":"GHSA-r7c9-c69m-rph8","url":"https://github.com/advisories/GHSA-r7c9-c69m-rph8","severity":"CRITICAL","ecosystem":"Packagist","package":"phpunit/phpunit","vulnerableRanges":[">=4.8.19, <4.8.28"],"patched":["4.8.28"],"provenance":"source","from":"GHSA"},{"id":"GHSA-r7c9-c69m-rph8","url":"https://github.com/advisories/GHSA-r7c9-c69m-rph8","severity":"CRITICAL","ecosystem":"Packagist","package":"phpunit/phpunit","vulnerableRanges":[">=5.0.10, <5.6.3"],"patched":["5.6.3"],"provenance":"source","from":"GHSA"}],"euvd":{"id":"EUVD-2022-1528","url":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2022-1528","exploited":true,"exploitedSince":"2022-02-15","provenance":"source"},"exploits":[{"id":50702,"url":"https://www.exploit-db.com/exploits/50702","title":"PHP Unit 4.8.28 - Remote Code Execution (RCE) (Unauthenticated)","type":"webapps","platform":"php","date":"2022-02-02","verified":false,"provenance":"source"}],"exploitSources":{"exploitdb":{"count":1,"earliest":"2022-02-02"},"pocGithub":{"count":17,"skipped":1,"earliest":"2020-01-06","earliestUrl":"https://github.com/mbrasile/CVE-2017-9841","repos":[{"name":"RandomRobbieBF/phpunit-brute","url":"https://github.com/RandomRobbieBF/phpunit-brute","stars":29,"created":"2020-05-18"},{"name":"incogbyte/laravel-phpunit-rce-masscaner","url":"https://github.com/incogbyte/laravel-phpunit-rce-masscaner","stars":23,"created":"2021-07-04"},{"name":"Chocapikk/CVE-2017-9841","url":"https://github.com/Chocapikk/CVE-2017-9841","stars":7,"created":"2023-08-27"},{"name":"ludy-dev/PHPUnit_eval-stdin_RCE","url":"https://github.com/ludy-dev/PHPUnit_eval-stdin_RCE","stars":6,"created":"2020-09-14"},{"name":"MadExploits/PHPunit-Exploit","url":"https://github.com/MadExploits/PHPunit-Exploit","stars":5,"created":"2022-12-07"}]},"nuclei":[{"id":"CVE-2017-9841","name":"PHPUnit - Remote Code Execution","severity":"critical","path":"http/cves/2017/CVE-2017-9841.yaml","url":"https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2017/CVE-2017-9841.yaml"}],"first":{"date":"2020-01-06","source":"PoC-in-GitHub","url":"https://github.com/mbrasile/CVE-2017-9841"},"provenance":"source"},"exploitRefs":[],"flow":[{"stage":"primary","techniques":["T1059"],"provenance":"ai"},{"stage":"related","techniques":["T1190"],"provenance":"source"}],"timeline":[{"date":"2017-06-27","kind":"published","label":"Published (NVD)","url":"https://nvd.nist.gov/vuln/detail/CVE-2017-9841","provenance":"source"},{"date":"2020-01-06","kind":"exploit-public","label":"First public exploit: PoC-in-GitHub; later: Exploit-DB 2022-02-02","url":"https://github.com/mbrasile/CVE-2017-9841","provenance":"source"},{"date":"2020-11-22","kind":"exploited-reported","label":"Exploitation first reported (VulnCheck KEV evidence)","url":"https://www.imperva.com/blog/crimeops-of-the-kashmirblack-botnet-part-ii/","provenance":"source"},{"date":"2022-02-15","kind":"kev","label":"Added to CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","provenance":"source"},{"date":"2022-02-15","kind":"euvd-exploited","label":"ENISA EUVD: exploited","url":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2022-1528","provenance":"source"}],"speed":{"daysToPublicExploit":923,"firstExploitFrom":"PoC-in-GitHub","daysToKev":1694},"priority":{"score":73.7,"factors":[{"name":"In a KEV catalog","points":35.0,"detail":"listed in CISA KEV and VulnCheck KEV"},{"name":"Recent KEV listing","points":0.0,"detail":"added 2169 days ago"},{"name":"Known ransomware use","points":0.0,"detail":"not known"},{"name":"EPSS percentile","points":20.0,"detail":"percentile 0.9999"},{"name":"Named in threat reports","points":3.87,"detail":"1 report"},{"name":"Public exploit code","points":5.0,"detail":"1 Exploit-DB entry; 17 PoC-in-GitHub repos; 1 nuclei template"},{"name":"Mentioned in OTX pulses","points":3.0,"detail":"50 pulses"},{"name":"CVSS severity","points":6.86,"detail":"base score 9.8"},{"name":"End-of-life product","points":0.0,"detail":"supported or unknown"}]}}