CVEs / CVE-2017-9841
CVE-2017-9841: PHPUnit Command Injection Vulnerability
- Known exploited in the CISA KEV catalog since 15 Feb 2022
- critical 9.8 CVSS 3.1 (NVD)
- EPSS 99.9% chance of exploitation in the next 30 days, higher than 99% of CVEs (30 Oct 2026)
- Last changed at its sources
Are you affected? Check your servers with Stackurity: it lists the software on each server and the vulnerabilities to fix first.
Check your servers with Stackurity Already using Stackurity? Search for CVE-2017-9841
Summary
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.
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.
Affected and fixed versions
| Product | Affected | Fixed in |
|---|---|---|
| n/a n/a | n/a | — |
| Product | Affected | Fixed in |
|---|---|---|
| phpunit/phpunit (Packagist) | from 4.8.19, before 4.8.28 | 4.8.28 |
| phpunit/phpunit (Packagist) | from 5.0.10, before 5.6.3 | 5.6.3 |
Package versions from GHSA-r7c9-c69m-rph8.
Exploitation
| In CISA KEV since | 15 Feb 2022 |
|---|---|
| Due date for US federal agencies | 15 Aug 2022 |
| Used in ransomware campaigns | Unknown |
| Required action | Apply updates per vendor instructions. |
Severity
| CVSS 3.1 | 9.8 criticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:HScored by NVD |
|---|---|
| Weakness | CWE-94 |
References
- CVE-2017-9841 on NVD
- CVE-2017-9841 in the CISA KEV catalog
- CVE-2017-9841 on OSV
- http://web.archive.org/web/20170701212357/http://phpunit.vulnbusters.com/ Third Party Advisory
- http://www.securityfocus.com/bid/101798 Broken Link
- http://www.securitytracker.com/id/1039812 Broken Link
- https://github.com/sebastianbergmann/phpunit/commit/284a69fb88a2d0845d23f42974a583d8f59bf5a5 Patch, Third Party Advisory
- https://github.com/sebastianbergmann/phpunit/pull/1956 Patch, Third Party Advisory
- https://security.gentoo.org/glsa/201711-15 Third Party Advisory
- https://www.oracle.com/security-alerts/cpuoct2021.html Patch, Third Party Advisory
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2017-9841 US Government Resource
Sources
Exploitation status from the CISA Known Exploited Vulnerabilities catalog. EPSS scores from FIRST. Descriptions, severity and references from the National Vulnerability Database. Open-source package versions from OSV (CC-BY 4.0). Text is shown as each source states it; Stackurity does not edit it. Check the vendor's advisory before acting.
This product uses data from the NVD API but is not endorsed or certified by the NVD.