GHSA-mh6w-vxff-9wqp: PHPUnit: Argument injection via newline in PHP INI values forwarded to child processes
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.
Sources of INI values that participate in the attack:
<ini name="…" value="…"/>entries inphpunit.xml/phpunit.xml.dist- INI settings inherited from the host PHP runtime via
ini_get_all()
References
- github.com/FriendsOfPHP/security-advisories/blob/master/phpunit/phpunit/GHSA-qrr6-mg7r-m243.yaml
- github.com/advisories/GHSA-mh6w-vxff-9wqp
- github.com/sebastianbergmann/phpunit
- github.com/sebastianbergmann/phpunit/pull/6592
- github.com/sebastianbergmann/phpunit/security/advisories/GHSA-qrr6-mg7r-m243
- owasp.org/www-project-top-10-ci-cd-security-risks/CICD-SEC-04-Poisoned-Pipeline-Execution
Code Behaviors & Features
Detect and mitigate GHSA-mh6w-vxff-9wqp with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →