CVE-2017-9841
Description
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.
Severity
CRITICAL
CVSS v3
9.8
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H · source nvd
Exploit chance (EPSS)
99.999%
chance of exploitation in the next 30 days
among the highest of scored CVEs · 2026-11-16
CISA KEV
Listed
added 2022-02-15
Public exploit code
Yes
Exploit references (NVD and CNA): 0
Metasploit modules: 0
Nuclei templates: 1
Exploit-DB: 1
Weakness
- CWE-94: Improper Control of Generation of Code
CISA Known Exploited Vulnerabilities entry
| Vulnerability name | PHPUnit Command Injection Vulnerability |
|---|---|
| Vendor / product | PHPUnit / PHPUnit |
| Date added | 2022-02-15 |
| Federal remediation due date | 2022-08-15 |
| Required action | Apply updates per vendor instructions. |
| Known ransomware campaign use | Unknown |
CISA SSVC decision points
| Exploitation | active |
|---|---|
| Automatable | yes |
| Technical impact | total |
| Scored | 2025-02-07 |
Timeline
- 2017-06-27Published by the CNA17:00 UTC
- 2022-02-02First Exploit-DB entry (EDB-ID 50702)1681 days after publication
- 2022-02-15Added to the CISA KEV catalog1694 days after publication
- 2022-03-26GitHub advisory published (GHSA-r7c9-c69m-rph8)1733 days after publication
- 2025-02-07CISA SSVC decision recorded2782 days after publication
Exploit and advisory records
| Exploit-DB | Type | Platform | Published | EDB-verified |
|---|---|---|---|---|
| EDB-ID 50702 | webapps | php | 2022-02-02 | no |
Nuclei templates:
- CVE-2017-9841: PHPUnit - Remote Code Execution
GitHub advisory GHSA-r7c9-c69m-rph8, affected packages:
| Ecosystem | Package | Vulnerable range | Patched |
|---|---|---|---|
| Packagist | phpunit/phpunit | >= 4.8.19, < 4.8.28 | 4.8.28 |
| Packagist | phpunit/phpunit | >= 5.0.10, < 5.6.3 | 5.6.3 |
Affected products
| Vendor | Product |
|---|---|
| oracle | communications_diameter_signaling_router |
| phpunit_project | phpunit |
References
- https://github.com/sebastianbergmann/phpunit/commit/284a69fb88a2d0845d23f42974a583d8f59bf5a5
- https://github.com/sebastianbergmann/phpunit/pull/1956
- https://www.oracle.com/security-alerts/cpuoct2021.html
- https://security.gentoo.org/glsa/201711-15
- http://web.archive.org/web/20170701212357/http://phpunit.vulnbusters.com/
- http://www.securityfocus.com/bid/101798
- http://www.securitytracker.com/id/1039812
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2017-9841
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cve_lookup/CVE-2017-9841'curl 'https://api.contrastcyber.com/cve_risk_score/CVE-2017-9841'curl 'https://api.contrastcyber.com/cve_exploit/CVE-2017-9841'curl 'https://api.contrastcyber.com/cve_products/CVE-2017-9841'curl 'https://api.contrastcyber.com/kev_lookup/CVE-2017-9841'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).