Skip to main content

PHPUnit CVE-2026-41570

| EUVDEUVD-2026-28649 HIGH
Improper Neutralization of CRLF Sequences ('CRLF Injection') (CWE-93)
2026-05-08 GitHub_M GHSA-qrr6-mg7r-m243
7.8
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Modify phpunit.xml in pull request
  2. Delivery
    CI executes PHPUnit against PR branch
  3. Exploit
    PHPUnit spawns isolated child process
  4. Execution
    Inject auto_prepend_file directive via newline
  5. Persist
    PHP loads attacker-controlled file
  6. Impact
    Execute arbitrary code in CI context

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization CRLF sequence sanitization
Exploitation Conditions

Exploitation requires: (1) PHPUnit version exactly 12.5.21 or 13.1.5, (2) Attacker ability to modify content of INI values read by PHPUnit - specifically write access to phpunit.xml, phpunit.xml.dist, host php.ini files, or the PHP binary's environment variables, (3) PHPUnit execution with --process-isolation flag enabled or execution of PHPT tests (both spawn child processes that receive INI settings via command-line arguments), (4) For remote code execution via auto_prepend_file injection, the child process must have filesystem write access or the attacker must predict/control an existing file path that PHP will execute. The primary realistic condition is CI/CD pipelines configured to run PHPUnit tests against untrusted pull requests without code sandboxing (Poisoned Pipeline Execution). Standard local development usage where developers run PHPUnit on their own machines is low risk unless the developer's environment is already compromised. Deployments not using process isolation or PHPT tests are not affected even with vulnerable versions installed.

Impact

CVSS 7.8 (High) reflects local attack vector requiring low-privilege local access (AV:L/AC:L/PR:L), but real-world risk depends heavily on deployment context. The CVSS score alone suggests standard local privilege escalation, but the GitHub advisory emphasizes Poisoned Pipeline Execution (PPE) as the primary threat model: a contributor submits a pull request modifying phpunit.xml to include a malicious newline-encoded INI value, which executes when CI runs PHPUnit tests against the untrusted branch. Newlines are not visually distinctive in diff reviews, creating a realistic social engineering vector. EPSS data not provided, but exploitation requires specific conditions (PHPUnit with process isolation, attacker control of INI configuration sources). No CISA KEV listing indicates no confirmed widespread exploitation. The public GitHub Security Advisory (GHSA-qrr6-mg7r-m243) and merged pull request #6592 constitute public disclosure of exploit technique, though no standalone POC tool identified. Primary risk is to CI/CD pipelines executing PHPUnit tests on external contributions without sandboxing, not general local privilege escalation scenarios. Organizations not using PHPUnit in CI or already isolating untrusted code execution face minimal practical risk despite high CVSS.

Exploit ScenarioDerived

A malicious contributor forks a PHP project using PHPUnit and submits a pull request modifying phpunit.xml to add <ini name="display_errors" value="1\nauto_prepend_file=/tmp/backdoor.php"/> where \n is a literal newline character. The project's CI system automatically runs PHPUnit tests against the PR branch. PHPUnit spawns a child process with arguments -d display_errors=1 -d auto_prepend_file=/tmp/backdoor.php, injecting the second directive. If the attacker previously wrote /tmp/backdoor.php via another vulnerability or predictable temp file creation, PHP loads and executes it before running tests, achieving code execution in the CI environment. The attacker can exfiltrate secrets, modify build artifacts, or persist access. Public pull request #6592 demonstrates the injection mechanism and can be adapted into working exploit code.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 08, 2026

Arbitrary PHP directive injection in PHPUnit 12.5.21 and 13.1.5 enables local attackers with write access to phpunit.xml to achieve code execution in isolated test child processes by embedding newlines in INI setting values. The vulnerability exploits PHPUnit's unsanitized forwarding of INI settings to child processes via command-line arguments, where PHP's INI parser treats newlines as directive separators, allowing injection of auto_prepend_file to load attacker-controlled code. Fixed in versions 12.5.22 and 13.1.6. Primary exposure vector is Poisoned Pipeline Execution (PPE) in CI/CD environments running PHPUnit against untrusted pull requests without isolation.

RemediationAI

Upgrade PHPUnit to patched version 12.5.22 (for 12.x branch) or 13.1.6 (for 13.x branch) via Composer: composer update phpunit/phpunit. The fix implemented in pull request #6592 (https://github.com/sebastianbergmann/phpunit/pull/6592) adds validation in JobRunner::settingsToParameters() to throw PhpProcessException when INI values contain newline or carriage return characters, and quotes values containing semicolons or double-quotes to neutralize their metacharacter interpretation. If immediate patching is not feasible, implement compensating controls: (1) Enable branch protection requiring administrator review of phpunit.xml changes before CI execution, (2) Run PHPUnit in isolated containers/VMs with read-only filesystem mounts for configuration, preventing auto_prepend_file from loading writable paths, (3) Configure CI to execute tests from trusted branches only, rejecting direct execution of untrusted PR code, (4) Audit phpunit.xml and phpunit.xml.dist for existing INI values containing embedded newlines or suspicious directives. Note that disabling --process-isolation completely eliminates the vulnerable code path but breaks test isolation guarantees and PHPT test execution. Official advisory available at https://github.com/sebastianbergmann/phpunit/security/advisories/GHSA-qrr6-mg7r-m243.

Affected VersionsENISA

phpunit = 12.5.21
phpunit = 13.1.5

Affected Packages

composer phpunit/phpunit fix: 12.5.22, 13.1.6
euvd phpunit no fix

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in composer, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

PHPUnit's JobRunner::settingsToParameters() method forwards PHP INI configuration to child processes (used for --process-isolation and PHPT tests) by constructing command-line arguments in the format -d name=value. The method previously passed these values without neutralizing PHP INI metacharacters. PHP's INI parser treats newline (\n) as a directive separator, semicolon (;) as comment start, and double-quote (") as string delimiter. An attacker embedding a newline in an INI value can inject additional directives like auto_prepend_file=/tmp/evil.php, which PHP executes before the test script. This is an instance of CWE-93 (Improper Neutralization of CRLF Sequences in HTTP Headers / Argument Injection). INI values can originate from <ini name="..." value="..."/> elements in phpunit.xml configuration files or be inherited from the parent PHP runtime via ini_get_all(). The fix adds validation to reject values containing \n or \r and quotes values containing ; or " to prevent parser interpretation.

Know when Phpunit gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 7.8 HIGH
AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
SUSE HIGH

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

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

DescriptionCVE.org

PHPUnit is a testing framework for PHP. In versions 12.5.21 and 13.1.5, PHPUnit forwards PHP INI settings to child processes (used for isolated/PHPT test execution) as -d name=value command-line arguments without neutralizing INI metacharacters. Because PHP's INI parser interprets " as a string delimiter, ; as the start of a comment, and most importantly a newline as a directive separator, a value containing a newline is parsed by the child process as multiple INI directives. An attacker able to influence a single INI value can therefore inject arbitrary additional directives into the child's configuration, including auto_prepend_file, extension, disable_functions, open_basedir, and others. Setting auto_prepend_file to an attacker-controlled path yields remote code execution in the child process. This issue has been patched in versions 12.5.22 and 13.1.6.

Executive ViewAI

Why It Matters

PHPUnit versions 12.5.21 and 13.1.5 contain an arbitrary code execution vulnerability that allows local attackers with write access to phpunit.xml to inject malicious PHP directives into child test processes. Organizations using PHPUnit in CI/CD pipelines face critical risk of code execution during test execution, particularly when processing untrusted pull requests, potentially compromising build integrity and enabling supply chain attacks.

Business Impact: High
Compensating Controls

Until patch deployment: (1) Restrict phpunit.xml file write permissions to trusted developers only via version control access controls; (2) Disable or isolate CI/CD pipeline execution of PHPUnit for pull requests from external contributors; (3) Run PHPUnit in sandboxed or containerized environments with minimal privilege; (4) Implement file integrity monitoring on phpunit.xml across all repositories; (5) Review CI/CD logs for suspicious INI directive injection patterns (newlines in php_value/php_flag settings).

Threat Intelligence Overview

EPSS Score
0.1%
Top 79% exploitable
Threat Intel
1
1 source
Data Quality
8 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
Poc
System Exposure· derived
Small
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

39
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +39
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

Vendor StatusVendor

SUSE

Severity: High

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy