Patchfirst
CVE-2017-9841 KEVPublic exploit Critical · 9.8 EPSS >99.9%

PHPUnit Command Injection Vulnerability

PHPUnit · PHPUnit

Summary

The flaw is in the eval-stdin.php component of PHPUnit (Util/PHP/eval-stdin.php) in versions before 4.8.28 and 5.x before 5.6.3, which fails to control generation of code. An unauthenticated remote attacker can execute arbitrary PHP code by sending HTTP POST data beginning with a "<?php " substring, which is practical where the /vendor folder, and this file within it, is exposed to external access.

Official description · NVD

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.

Breakdown
73.7 / 100
Exploited
Yes, in CISA KEV
Reports
1
Tactics
2/15

How an attack unfolds

Based on mappings. Select a step to see the evidence.
  1. What they do

  2. What can follow

First seen exploited 3 years after disclosure. Public exploit code (PoC-in-GitHub) appeared 3 years after disclosure.

  1. Disclosedday 0
  2. Public exploit codePoC-in-GitHub+3 yrs
  3. First seen exploitedVulnCheck KEV evidence+3 yrs
  4. Added to CISA KEVEU database agrees+5 yrs

CISA KEV listing is when exploitation was confirmed, not necessarily the first attack.

techniques

2 , grouped by in kill-chain order, 2 cited passages 11

Initial AccessTA0001

Exploit Public-Facing Application T1190 Medium
MITRE CTID mapping of the CVE · uncategorised

ExecutionTA0002

Command and Scripting Interpreter T1059 Medium
AI mapping from the description · primary impact

Arbitrary PHP code execution on the server

allows remote attackers to execute arbitrary PHP code
From the official description (NVD) Original (opens in a new tab) ↗

Detection

0 rules for this CVE · 244 general rules for its techniques

Rules for this CVE

0 that reference CVE-2017-9841 directly.

CVE-specific rules are not available in this build. Search SigmaHQ ↗

Sigma rules © SigmaHQ, Detection Rule License 1.1; linked, not reproduced.

Am I affected? What do I upgrade to?

From GitHub Security Advisories and OSV

1 package in 1 ecosystem. Main package: phpunit/phpunit.

Packagistphpunit/phpunitGHSA-r7c9-c69m-rph8

Upgrade to 5.6.3 or later

Set the version to 5.6.3 or later in your composer.json.

The first fix for CVE-2017-9841. No other CVE tracked by Patchfirst affects this package.

Affected versions, by release line

If you runUpgrade to
5.0.10 up to 5.6.35.6.3
4.8.19 up to 4.8.284.8.28

“Up to” means the second version is the fix and is not affected.

Check your lockfile against all CVEs

What security researchers reported

Named in 1 threat report
1 reportpicussecurity.com

Reports are matched by finding the exact id CVE-2017-9841 in their text; nobody has reviewed the match. One passage is shown per report, at most 320 characters, linked to the original.

Also mentioned in 50 community threat pulses (AlienVault OTX)

Weaker evidence

Pulses are indicator collections that anyone can publish. A mention is not confirmation of exploitation.

References

8 links, grouped by NVD tag (7 duplicates merged)
↑ ↓ chooseEnter openEsc close