Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessModify phpunit.xml in pull request
-
DeliveryCI executes PHPUnit against PR branch
-
ExploitPHPUnit spawns isolated child process
-
ExecutionInject auto_prepend_file directive via newline
-
PersistPHP loads attacker-controlled file
-
ImpactExecute 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
Affected Packages
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
AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
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
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.
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
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
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 c
Unsafe deserialization in PHPUnit versions before 8.5.52, 9.6.33, 10.5.62, 11.5.50, and 12.5.8 allows local attackers to
Local code execution against developers running PHPT tests with code coverage in PHPUnit 13.4.0 through 13.4.3, where th
Cross-site scripting (XSS) vulnerability in the PHPUnit extension before 3.5.15 for TYPO3 allows remote attackers to inj
EUVD-2026-28649
GHSA-qrr6-mg7r-m243
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB