Loading...
Skip to main content

CVE-2017-9841 — Code Injection in phpunit/phpunit — CVE Details

CRITICAL
Actively Exploited

Code Injection in PHPUnit

Published March 26, 2022Updated October 22, 2025Source: osv

What Should I Do?

Patch Immediately

This vulnerability is confirmed under active exploitation (CISA KEV). Patch within 24-48 hours if possible.

Summary

Util/PHP/eval-stdin.php in PHPUnit starting with 4.8.19 and before 4.8.28, as well as 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.

Advisory Timeline

  • First published March 26, 2022 (1661 days ago).
  • Last revised October 22, 2025 — 1307 days after initial publication.
  • Added to CISA's Known Exploited Vulnerabilities catalog 39 days before publication.

Remediation

Upgrade to the fixed version using your package manager.

Composer
Update phpunit/phpunit to 5.6.3 or later
composer require "phpunit/phpunit:^5.6.3"
Composer
Update phpunit/phpunit to 4.8.28 or later
composer require "phpunit/phpunit:^4.8.28"

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (2)

Affects 1 ecosystem: packagist (1).

PackageEcosystemAffectedFixed In
phpunit/phpunit
packagist
5.0.10, 5.1.0, 5.1.1, 5.1.2 (+44 more)5.6.3
phpunit/phpunit
packagist
4.8.19, 4.8.20, 4.8.21, 4.8.22 (+5 more)4.8.28

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.8 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

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

Frequently Asked Questions

What is CVE-2017-9841?
Code Injection in PHPUnit This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.8/10).
How do I check if my project is affected by CVE-2017-9841?
CVE-2017-9841 affects phpunit/phpunit. This vulnerability is listed in CISA's Known Exploited Vulnerabilities (KEV) catalog, meaning it is being actively exploited in the wild. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2017-9841 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.8

Exploitation is straightforward and causes maximum impact. Patch immediately.

Known Exploited Vulnerability

This vulnerability is in CISA's Known Exploited Vulnerabilities (KEV) catalog, indicating active exploitation in the wild.

Added to KEV catalog: February 15, 2022

Remediation deadline: August 15, 2022

Also Known As

GHSA-r7c9-c69m-rph8

Related CVEs

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies