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.

Does your project use an affected phpunit/phpunit version?

Paste your composer.lock to check it for CVE-2017-9841 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my composer.lock

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 (1706 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, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (2)

Affects 1 ecosystem: Packagist (1).

PackageFixed In
phpunit/phpunit Packagist · Affected: 5.0.10, 5.1.0, 5.1.1, 5.1.2 (+44 more)5.6.3
phpunit/phpunit Packagist · Affected: 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. It has a 100.0% probability of exploitation within 30 days (EPSS score). 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

Maximum impact if exploited, often with little effort or access required.

EPSS Score (30-day exploit probability)
100.00%
EPSS percentile: 100

This places it in the top 5% of EPSS-scored vulnerabilities — 100% of tracked vulnerabilities score at or below it, so it is far more likely to be exploited than nearly all other tracked vulnerabilities.

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

  • CVE-2026-63412
    CRITICAL

    Jane: Instantiation RCE via query parameter name -> raw PHPDoc */ breakout (jane-php/open-api-3)

  • CVE-2026-63413
    CRITICAL

    Jane: Instantiation RCE via header parameter name -> raw PHPDoc */ breakout (jane-php/open-api-3)

  • CVE-2026-24765
    HIGH

    PHPUnit Vulnerable to Unsafe Deserialization in PHPT Code Coverage Handling

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my composer.lock