patchminder
Exploited in the wild · CISA KEV CVE-2017-9841

Code injectionin PHPUnit.

Published 27 Jun 2017 · Updated 21 Oct 2025 · Every fact sourced

JSONCite
Is it exploited?
Yes

On CISAThe US cyber defence agency. Its list names every hole it has seen used in real attacks.'s exploited list since 15 Feb 2022.

On CISA's listAttack code is public
Severity
Critical 9.8
CVSSA severity score from 0 to 10. 9 and higher is critical. 3.1 · CISAThe US cyber defence agency. Its list names every hole it has seen used in real attacks. assessment · no login needed
Attack likelihood
Very high
EPSSA daily score from FIRST: the chance a hole is attacked in the next 30 days. 100.0% chance in 30 days · 4 Dec 2026
Fix
Available
Fixed in 4.8.28, 5.6.3
In plain words

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.

CISA: PHPUnit 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.

What to do now
  • Upgrade phpunit/phpunit (Packagist) to 4.8.28, 5.6.3 or later, whichever matches your release line.
  • CISA requires US federal agencies to fix it by 15 Aug 2022.
Versions

Affected and fixed versions

Product or package
Affected
Fixed in
Source
n/a
Not confirmed
Not confirmed
CVE record
phpunit/phpunit (Packagist)
4.8.19 to before 4.8.28
4.8.28
GitHub advisory
phpunit/phpunit (Packagist)
5.0.10 to before 5.6.3
5.6.3
GitHub advisory

From the CVE record, NVD and package advisories. When no source has versions yet, this table says "not confirmed" instead of guessing.

Timeline

From first report to first attacks

  1. 24 Jun 2017
    CVE ID reserved by mitre.
  2. 27 Jun 2017
    Published in the CVE List.
  3. 18 May 2020
    First public proof of concept on GitHub.
  4. 15 Feb 2022
    Added to CISA's Known Exploited Vulnerabilities list.
  5. 21 Oct 2025
    CVE record last updated.
Exploit code

Attack code anyone can find

Exploit maturity: Exploited in the wild (CISA KEV). CISA assessment (SSVC): exploitation active.

Metasploit module
None known
Nuclei scan template
Available
Exploit-DB
1 entry
GitHub proof of concepts
17 repositories
NucleiPHPUnit · Remote Code Executiondetection template
Exploit-DBEDB-ID 50702web application exploit for php, published 2 Feb 2022
GitHubno warning signs foundRandomRobbieBF/phpunit-brute28 stars · created 18 May 2020Tool to try multiple paths for PHPunit RCE CVE-2017-9841
GitHubno warning signs foundincogbyte/laravel-phpunit-rce-masscaner23 stars · created 4 Jul 2021Masscanner for Laravel phpunit RCE CVE-2017-9841
GitHubno warning signs foundChocapikk/CVE-2017-98418 stars · created 27 Aug 2023PHPUnit RCE
GitHubno warning signs foundludy-dev/PHPUnit_eval-stdin_RCE6 stars · created 14 Sep 2020(CVE-2017-9841) PHPUnit_eval-stdin_php Remote Code Execution
GitHubno warning signs foundMadExploits/PHPunit-Exploit6 stars · created 7 Dec 2022PHPunit Checker CVE-2017-9841 By MrMad
GitHubno warning signs foundK3ysTr0K3R/CVE-2017-9841-EXPLOIT6 stars · created 10 Jun 2025A PoC exploit for CVE-2017-9841 · PHPUnit Remote Code Execution(RCE)
GitHubno warning signs founddrcrypterdotru/PHPUnit-GoScan5 stars · created 30 Aug 2025PHPUnit CVE-2017-9841 Scanner in Go clean and fire.
GitHubno warning signs foundp1ckzi/CVE-2017-98414 stars · created 9 Apr 2022phpunit-shell | CVE_2017-9841
GitHubno warning signs foundakr3ch/CVE-2017-98413 stars · created 20 Mar 2022RCE exploit for PHP Unit 5.6.2
GitHubno warning signs founddream434/CVE-2017-98411 stars · created 21 Nov 2022CVE-2017-9841

Listed so defenders can judge how urgent this is and test systems they are authorised to test. Patchminder does not host exploit code; links open the source page. Labels for GitHub repositories come from their public details and are never a promise about the code. Run anything only in an isolated lab.

Related

Same weakness: Code injection

All CWE-94 vulnerabilities

References
Cite this page

Patchminder. CVE-2017-9841: Code injection in PHPUnit. https://patchminder.com/cve/cve-2017-9841/ (accessed 5 December 2026).