← Vulnerability feed

Vulnerability record · CVE-2017-9841 · published 27 June 2017

CVE-2017-9841: PHPUnit eval-stdin.php remote PHP code execution

Phpunit Project · Phpunit

PHPUnit before 4.8.28 and 5.x before 5.6.3 ships Util/PHP/eval-stdin.php, which evaluates HTTP POST body content as PHP when it begins with a "<?php " substring. If the vendor directory is reachable over the web, an unauthenticated attacker can run arbitrary PHP code on the server.

9.8 CVSS 3.1 Critical CISA KEV since 15 Feb 2022 EPSS 100% · top 0.1% CWE-94 · Code injection
9.8CVSS 3.1 base score, v2 7.5
100%EPSS exploitation probability, 30 days
YesIn CISA KEV, fix deadline passed
2Affected product versions listed by NVD
15References
17 Jun 2026Last modified by NVD

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.

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Automated analysis

Generated by VULONE's analysis model from the NVD record, CISA KEV and EPSS data on 16 September 2026. Confidence: high.

critical priorityUnauthenticated remote code execution with a CVSS of 9.8, KEV listing and near-maximum EPSS probability.

What it is

PHPUnit before 4.8.28 and 5.x before 5.6.3 ships Util/PHP/eval-stdin.php, which evaluates HTTP POST body content as PHP when it begins with a "<?php " substring. If the vendor directory is reachable over the web, an unauthenticated attacker can run arbitrary PHP code on the server.

Impact

An attacker gains remote code execution in the web server's PHP context, allowing full compromise of the application and its data.

Attack surface

Reached over the network by POSTing PHP code to the exposed /vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php URI; no authentication or user interaction is required per the CVSS vector.

Exploitation

Listed in CISA KEV since 2022-02-15 and carries an EPSS 30-day probability of 0.99999, indicating active exploitation in the wild.

What to do

  • Upgrade PHPUnit to 4.8.28 or 5.6.3 (or later) per the vendor patch commits.
  • Remove or block web access to vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php and deny direct HTTP access to the vendor directory.
  • Apply the referenced Oracle and Gentoo updates where PHPUnit is bundled in those products.
  • Scan deployed codebases for exposed vendor directories and remove PHPUnit from production deployments.

Detection

  • Search web logs for POST requests to paths containing /vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php.
  • Inspect POST bodies to that URI for content beginning with "<?php ".
  • Alert on unexpected PHP process execution or outbound connections originating from the web server after such requests.

This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.

Exploitation in the wild

CISA added CVE-2017-9841 to the Known Exploited Vulnerabilities catalog on 15 February 2022 as "PHPUnit Command Injection Vulnerability". Required action: Apply updates per vendor instructions. Federal deadline 15 August 2022.

Affected products

2 vulnerable configurations from NVD's CPE data, grouped by vendor and product.

References

Track CVE-2017-9841 inside VULONE

Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.

Start free Open in platform

Related vulnerabilities

Same products first, then exploited flaws of the same weakness class.

9.8CVE-2020-2555Oracle Coherence T3 deserialization allows unauthenticated remote code executionOracle Coherence (Fusion Middleware) deserializes untrusted data reachable over the T3 protocol, allowing an unauthenticated network attacker to exec…KEVEPSS 97%analysed9.8CVE-2021-21783Genivia gsoap integer overflow vulnerabilityA code execution vulnerability exists in the WS-Addressing plugin functionality of Genivia gSOAP 2.8.107. A specially crafted SOAP request can lead t…EPSS 5.3%9.8CVE-2020-11998Apache ActiveMQ JMX re-bind regression allows remote code executionA regression in the commit that prevents JMX re-binding causes RMIConnectorServer to receive an empty environment map instead of one containing authe…EPSS 51%analysed9.8CVE-2020-11972Apache camel deserialization of untrusted data vulnerabilityApache Camel RabbitMQ enables Java deserialization by default. Apache Camel 2.22.x, 2.23.x, 2.24.x, 2.25.0, 3.0.0 up to 3.1.0 are affected. 2.x users…EPSS 5.5%9.8CVE-2020-11973Apache camel deserialization of untrusted data vulnerabilityApache Camel Netty enables Java deserialization by default. Apache Camel 2.22.x, 2.23.x, 2.24.x, 2.25.0, 3.0.0 up to 3.1.0 are affected. 2.x users sh…EPSS 6.6%9.8CVE-2020-10683Dom4j project dom4j xml external entity (xxe) vulnerabilitydom4j before 2.0.3 and 2.1.x before 2.1.3 allows external DTDs and External Entities by default, which might enable XXE attacks. However, there is po…EPSS 7.3%9.8CVE-2020-9548Fasterxml jackson-databind deserialization of untrusted data vulnerabilityFasterXML jackson-databind 2.x before 2.9.10.4 mishandles the interaction between serialization gadgets and typing, related to br.com.anteros.dbcp.An…EPSS 18%9.8CVE-2020-9546Fasterxml jackson-databind deserialization of untrusted data vulnerabilityFasterXML jackson-databind 2.x before 2.9.10.4 mishandles the interaction between serialization gadgets and typing, related to org.apache.hadoop.shad…EPSS 4.6%

Source: NIST National Vulnerability Database (record CVE-2017-9841), CISA KEV, FIRST EPSS (scores of 2026-09-16). This page is refreshed as NVD updates the record.