Skip to content
Laskyr

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

Fixed in phpunit/phpunit 12.5.22 and 13.1.6

This remote code execution issue affects phpunit/phpunit in 2 release lines: >= 12.5.21, < 12.5.22; >= 13.1.5, < 13.1.6. Upgrade to the fixed version for your release line (12.5.22 and 13.1.6). The newest release, 13.4.6, is not affected.

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?

Run composer show phpunit/phpunit in your project, then enter the version. We check it against this and every other known phpunit/phpunit advisory.

Who can exploit CVE-2026-41570

CVSS vector (scored by GitHub): CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Your app is only exposed if it uses the affected part of phpunit/phpunit. The advisory below says which part that is. If you are not sure, upgrade anyway: it costs less than finding out.

How to fix CVE-2026-41570 in phpunit/phpunit

  1. Find the installed version: composer show phpunit/phpunit. If you never required it yourself, composer why phpunit/phpunit shows which package pulls it in.
  2. 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).
  3. 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.
  4. Run composer audit. It reads the same advisory data and should no longer list CVE-2026-41570.
  5. Commit composer.lock and deploy it. On the server, run composer install --no-dev from the lock file, not composer update.

If you cannot upgrade yet

General hardening for remote code execution issues while the upgrade waits. None of it replaces the fix.

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.

Description from the CVE record, published by GitHub (the CVE Numbering Authority), via the NVD entry for CVE-2026-41570. Advisory title: “Argument injection via newline in PHP INI values forwarded to child processes”.

References

Other phpunit/phpunit advisories

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 fix

Where this data comes from

First hour checklist

If the site was just hacked, read the emergency kit before you delete files. The page is free. Email is optional.

Read the emergency kit