phpunit/phpunit security advisory
CVE-2026-41570: Argument injection via newline in PHP INI values forwarded to child processes in phpunit/phpunit
CVE-2026-41570 is a high-severity remote code execution vulnerability in the PHP package phpunit/phpunit (CVSS 7.8), published 8 May 2026. It is fixed in 12.5.22 and 13.1.6, one per release line; earlier versions on each line are affected. Exploiting it needs a low-privilege user account.
high 7.8 published 2026-05-08 · updated 2026-10-26
- Affected versions
- >= 12.5.21, < 12.5.22
>= 13.1.5, < 13.1.6 - Fixed in
- 12.5.22, 13.1.6
- Newest release
- 13.4.6
- Severity
- High · CVSS 7.8
- Type
- Remote code execution
CWE-88, CWE-93 - Exploited in the wild
- Not on the CISA KEV list
checked 2026-11-04
Is your phpunit/phpunit version affected?
Who can exploit CVE-2026-41570
- Access: A normal, low-privilege user account in the app.
- Position: The attacker needs local access to the server.
CVSS vector (scored by GitHub): CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
How to fix CVE-2026-41570 in phpunit/phpunit
- Find the installed version:
composer show phpunit/phpunit. If you never required it yourself,composer why phpunit/phpunitshows which package pulls it in. - Update it:
composer update phpunit/phpunit --with-all-dependencies. You need the fixed version for your release line (12.5.22 and 13.1.6). - If Composer will not go that high, your composer.json constraint is holding it back. Widen it (for example
"phpunit/phpunit": "^13.1.6"if you can take that version), or upgrade the package that requires it. - Run
composer audit. It reads the same advisory data and should no longer list CVE-2026-41570. - Commit composer.lock and deploy it. On the server, run
composer install --no-devfrom the lock file, notcomposer update.
If you cannot upgrade yet
- Never pass user-controlled data to unserialize() or to template rendering, and restrict who can edit templates or settings.
- Put a web application firewall in front of the app and watch for new PHP files or admin users.
- If your app does not use the affected feature, note that in your audit, but still plan the upgrade.
The CVE-2026-41570 advisory
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.
References
- GitHub security advisory GHSA-qrr6-mg7r-m243 github.com
- Pull request #6592 github.com
Other phpunit/phpunit advisories
- medium CVE-2026-119193: PHPUnit vulnerable to code execution by other local users via shared temporary directory in PHPT code coverage handling 2026-10-27
- high PHPUnit: Argument injection via newline in PHP INI values forwarded to child processes 2026-04-22
- high CVE-2026-24765: Unsafe Deserialization in PHPT Code Coverage Handling 2026-01-27
- critical CVE-2017-9841: RCE vulnerability in phpunit 2016-11-13
Related
Need help patching or upgrading? Laskyr does PHP and Laravel security fixes and upgrades. Tell us what you run and we reply with a plan and a price.
Ask about a fixWhere this data comes from
- Affected and fixed versions: the Packagist security advisories API (GitHub Advisory Database and FriendsOfPHP), the same data
composer audituses. Synced 2026-11-03. - Description, score, weakness and references: NIST National Vulnerability Database (NVD), checked 2026-11-04. This product uses data from the NVD API but is not endorsed or certified by the NVD.
- Exploited-in-the-wild status: the CISA Known Exploited Vulnerabilities catalog, checked 2026-11-04.
- Compiled by Daniel Lasek at Laskyr from the sources above. The summary, “who can exploit it”, “how to fix it” and hardening sections are our plain-English reading of the record and are generated from it. The quoted description is the record's own text. Spot an error? Tell us.