CVE-2017-9841: Unauthenticated Remote Code Execution in PHPUnit
- Vendors
- Oracle CorporationPhpunit Project
CVE-2017-9841 is a code injection vulnerability affecting PHPUnit versions before 4.8.28 and 5.x before 5.6.3. PHPUnit's standard-input evaluation utility passes attacker-controlled input to eval(). When this utility is exposed through a PHP-enabled web server, a remote attacker can execute arbitrary PHP code by sending an HTTP POST body beginning with the substring "<?php ". Vulnerable copies bundled with applications, plugins, or modules can expose production servers even when PHPUnit is not intentionally deployed as a public service.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Successful exploitation compromises the affected application's confidentiality, integrity, and availability within the permissions of the PHP execution context. Attackers can execute commands, read accessible application secrets, modify files, deploy web shells or other malware, and consume server resources for cryptocurrency mining. Stolen credentials or existing trust relationships may enable subsequent cloud-account compromise or lateral movement. Exploitation does not inherently grant root privileges.
Mitigation
If you can’t patch tonight, do this now.
Deny external HTTP access to dependency directories and the vulnerable PHPUnit evaluation utility using web-server access controls. Keep development and testing components outside publicly served directories. Use IDS/IPS controls to detect and block exploitation attempts, and monitor for unexpected PHP files, command execution, outbound payload downloads, and persistence changes. Apply least privilege and network segmentation to limit post-exploitation impact.
Remediation
Patch, then assume compromise.
Upgrade phpunit/phpunit to version 4.8.28 or later in the 4.8 branch, or version 5.6.3 or later in the 5.x branch. Inventory and update copies bundled with applications, plugins, modules, and container images. Remove obsolete vulnerable copies and residual eval-stdin.php files, which may remain after an update or uninstallation. Exclude unnecessary development dependencies from production deployments.
Exploits
11 exploits validated by Mallory's analysis. Hidden: 4 rejected by Mallory's analysis as not a working exploit; 3 not yet analyzed, such as Exploit-DB entries.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
References
Frequently asked questions
- Is CVE-2017-9841 exploited in the wild?
- Yes. As of Nov 26, 2026, Mallory has reports of exploitation in the wild, and CISA added it to KEV on Feb 15, 2022.
- Is there a public exploit for CVE-2017-9841?
- Yes. Mallory tracks 11 public exploits or proofs of concept for CVE-2017-9841, the earliest disclosed Jul 4, 2021.
- Is there a patch for CVE-2017-9841?
- Upgrade phpunit/phpunit to version 4.8.28 or later in the 4.8 branch, or version 5.6.3 or later in the 5.x branch. Inventory and update copies bundled with applications, plugins, modules, and container images.
- What products are affected by CVE-2017-9841?
- Phpunit Project Phpunit and Oracle Corporation Communications Diameter Signaling Router.
- How severe is CVE-2017-9841?
- CVE-2017-9841 has a CVSS v3.1 score of 9.8 (Critical) and an EPSS score of 100.0% (100th percentile) as of Nov 26, 2026.
Recent activity
147 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.