LiveBreach Intelligence: data breaches, leaks & ransomware, tracked as they surfaceOngoing protection: GalaxyWarden →
Recent BreachesData breach tracker

CVE-2017-9841: PHPUnit Command Injection Vulnerability

RBRecent Breaches Vulnerability Intelligence·Feb 15, 2022
High⚠ Actively exploited (CISA KEV)
High
Severity
Active
CISA KEV
No
Ransomware use
Aug 15, 2022
Patch deadline
⚠ Exploited in the wild. CISA added CVE-2017-9841 to its Known Exploited Vulnerabilities catalog on Feb 15, 2022, with a federal patch deadline of Aug 15, 2022 — meaning attackers are actively using it. If you run the affected software, patch it immediately.

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…

CVE-2017-9841 is a code-injection flaw in PHPUnit that lets a remote attacker run arbitrary PHP when a specific utility script is reachable over HTTP. It matters because PHPUnit is commonly installed as a development dependency and sometimes left inside web-accessible vendor directories; if that path is exposed, an unauthenticated request can lead to full remote code execution on the host.

Defenders should treat any internet-facing or broadly reachable copy of the affected script as high priority until it is removed or patched per the vendor advisory.

How it works

The weakness is CWE-94 (improper control of code generation / code injection). PHPUnit ships a helper script intended for internal test execution. When that script is reachable at a URI such as /vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php, it processes HTTP POST body content. An attacker who can send a POST whose body begins with the substring "

No authentication is required once the file is exposed. The attack surface is therefore any site or application whose Composer (or similar) vendor tree is served by the web server and still contains the vulnerable PHPUnit utility. Exact exploit mechanics and affected release ranges must be confirmed against the vendor advisory; do not rely on secondary summaries alone.

Am I affected? How to find it in your systems

PHPUnit is a PHP testing framework normally installed via Composer into a project’s vendor directory. It is intended for development and CI, not production. In practice it appears on:

Inventory steps:

Telemetry signs of exploitation attempts include POST requests to URIs containing eval-stdin.php, especially those whose bodies start with "

How to remediate

Patch first: apply the updates published by the PHPUnit maintainers as instructed in the official vendor advisory and follow the CISA-required action to apply updates per vendor instructions. After updating, verify that the vulnerable script is no longer present or is no longer executable in any deployed artifact.

Additional hardening for this class of issue:

If you can't patch immediately

Until the vendor update can be deployed, reduce exposure with compensating controls:

These measures lower risk but do not replace installing the vendor fix.

If your data may have been exposed

Actively exploited remote-code-execution vulnerabilities are frequently used to establish persistence, steal credentials, or stage further compromise; ransomware use of this specific CVE is not documented, yet any successful exploitation should be treated as a potential breach. Perform standard incident-response steps: isolate affected hosts, preserve logs, rotate secrets that may have been accessible to the web-server user, and examine the environment for webshells or lateral movement. You can also run a free exposure scan of your email addresses against known breach data sets to see whether associated credentials have appeared in prior incidents, then force password resets and enable multi-factor authentication where appropriate.

AICompiled with AI assistance from public sources and published under our editorial standards.

Details

AffectedPHPUnit · PHPUnit
WeaknessCWE-94
Added to CISA KEVFeb 15, 2022
Federal patch deadlineAug 15, 2022
Known ransomware useNot documented
Check if your data is exposed →

Official records: NVD · CISA KEV

← All actively-exploited vulnerabilities