CVE-2026-41570: PHPUnit has Argument injection via newline in PHP INI values that are forwarded to child processes

CVE-2026-41570 · Severity: high · CVSS 7.8 · Published 2026-05-08

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.

Technologies: phpunit/phpunit (Packagist). Vendors: Packagist.

Quick answers

Is CVE-2026-41570 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-41570 being exploited in the wild.
How severe is CVE-2026-41570?
High severity, with a CVSS score of 7.8, published 8 May 2026.
Which products and versions are affected?
phpunit/phpunit (Packagist) ECOSYSTEM:introduced=12.5.21,fixed=12.5.22.
Is there a fix for CVE-2026-41570?
Yes. phpunit/phpunit (Packagist): upgrade to 12.5.22 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
Am I affected by CVE-2026-41570?
Check whether you run phpunit/phpunit (Packagist) or Phpunit Project Phpunit at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • phpunit/phpunit (Packagist): upgrade to 12.5.22 or later
    composer require phpunit/phpunit:^12.5.22

Affected products

  • phpunit/phpunit (Packagist) ECOSYSTEM:introduced=12.5.21,fixed=12.5.22
  • Phpunit Project Phpunit

Identifiers

  • CVE-2026-41570
  • GHSA-qrr6-mg7r-m243

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.