Quantum Secular Labs / Blog / Advisories
CVE-2017-9841: PHPUnit Command Injection Vulnerability
CVE-2017-9841 is rated critical with a CVSS v3.1 base score of 9.8 and affects PHPUnit PHPUnit, along with 1 other product in NVD’s configuration data. Per its scoring, it can be exploited over the network, without authentication, without any user interaction. The scored impact on confidentiality, integrity and availability is the highest available. CISA added it to its Known Exploited Vulnerabilities catalog on 2022-02-15, which means exploitation in the wild has been observed.
Vulnerability 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 breakdown
CVSS v3.1 9.8: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Attack vector: Network. Exploitable remotely over the network, with no need for local or physical access.
- Attack complexity: Low. No special conditions; the attack can be repeated reliably.
- Privileges required: None. No account or prior access is needed.
- User interaction: None. No action from any user is needed.
- Scope: Unchanged. Impact stays within the vulnerable component.
- Confidentiality impact: High. Total loss of confidentiality; sensitive data can be fully disclosed.
- Integrity impact: High. Total loss of integrity; data or system state can be fully modified.
- Availability impact: High. Total loss of availability; the component can be shut down.
Underlying weakness
CWE-94: Improper Control of Generation of Code
The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.
Affected products
- Phpunit Project: up to and including 4.8.27; from 5.0.0 before 5.6.3
- Oracle Communications Diameter Signaling Router: from 8.0.0 up to and including 8.5.0
References
- https://github.com/sebastianbergmann/phpunit/commit/284a69fb88a2d0845d23f42974a583d8f59bf5a5
- https://github.com/sebastianbergmann/phpunit/pull/1956
- https://www.oracle.com/security-alerts/cpuoct2021.html
- http://web.archive.org/web/20170701212357/http://phpunit.vulnbusters.com/
- https://security.gentoo.org/glsa/201711-15
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2017-9841
- http://www.securityfocus.com/bid/101798
- http://www.securitytracker.com/id/1039812