{"answers":{"affected":"4 open source packages ship an affected version, including phpunit/phpunit.","exploited":"There is no known exploitation of GHSA-mh6w-vxff-9wqp in the wild and no public exploit code.","fix":"Upgrade phpunit/phpunit to a fixed version for your release line: 12.5.22 or 13.1.6.","what":"GHSA-mh6w-vxff-9wqp is a command injection vulnerability in phpunit/phpunit, published on 22 Apr 2026. It can only be exploited from the same machine or local network, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-mh6w-vxff-9wqp and fix it if it is affected.\n\nWhat it is: GHSA-mh6w-vxff-9wqp is a command injection vulnerability in phpunit/phpunit, published on 22 Apr 2026. It can only be exploited from the same machine or local network, with no action from the victim.\nExploitation: There is no known exploitation of GHSA-mh6w-vxff-9wqp in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- phpunit/phpunit (Packagist): affected from 12.5.21; fixed in 12.5.22\n- phpunit/phpunit (Packagist): affected from 12.5.21; fixed in 12.5.22\n- phpunit/phpunit (Packagist): affected from 13.1.5; fixed in 13.1.6\n- phpunit/phpunit (Packagist): affected from 13.1.5; fixed in 13.1.6\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-mh6w-vxff-9wqp/ (Markdown: https://insights.sbomify.com/GHSA-mh6w-vxff-9wqp/index.md)","id":"GHSA-mh6w-vxff-9wqp","markdown":"https://insights.sbomify.com/GHSA-mh6w-vxff-9wqp/index.md","name":"GHSA-mh6w-vxff-9wqp","record":{"aliases":[],"analysis":{"component_type":"developer_tool","fix_type":"patch","impacts":["code_execution"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"PHPUnit testing framework","requires_auth":"low_privilege","summary":"Attackers with write access to PHPUnit configuration can inject newlines to execute arbitrary code in child processes via argument injection.","user_interaction":"not_required","vuln_class":"command_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"# Impact\n\nPHPUnit 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**.\n\nAn 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.\n\n**Sources of INI values that participate in the attack:**\n\n- `\u003cini name=\"…\" value=\"…\"/\u003e` entries in `phpunit.xml` / `phpunit.xml.dist`\n- INI settings inherited from the host PHP runtime via `ini_get_all()`\n\n## Threat Model\n\nExploitation requires the attacker to control the content of an INI value read by PHPUnit. In practice this means write access to the project's `phpunit.xml`, the host `php.ini`, or the PHP binary's environment. The most realistic exposure is **Poisoned Pipeline Execution (PPE)**: a pull request from an untrusted contributor that modifies `phpunit.xml` to include a newline-containing INI value, executed by a CI system that runs PHPUnit against the PR without isolation. A malicious newline is not visibly distinguishable from a legitimate value in a typical diff review.\n\n## Affected Component\n\n`PHPUnit\\Util\\PHP\\JobRunner::settingsToParameters()`\n\n## Patches\n\nThe fix has two parts:\n\n### 1. Reject line-break characters\n\nBecause a newline or carriage return in an INI value has no legitimate use and is the primitive that enables directive injection, any PHP setting value containing `\\n` or `\\r` is now rejected with an explicit `PhpProcessException`. This follows the same \"visibility over silence\" principle applied in **CVE-2026-24765**: the anomalous state fails loudly in CI output rather than being silently sanitized, giving operators an opportunity to investigate whether it reflects tampering, environment contamination, or an unexpected upstream change.\n\n### 2. Quote remaining metacharacters\n\nValues containing `\"` or `;`, both of which have legitimate uses (e.g., regex-valued INI settings such as ddtrace's `datadog.appsec.obfuscation_parameter_value_regexp`), are wrapped in double quotes with inner `\"` escaped as `\\\"`, so PHP's INI parser reads them as literal string contents rather than comment/delimiter tokens. Plain values are forwarded unchanged so that boolean keywords (`On`/`Off`) and bitwise expressions (`E_ALL \u0026 ~E_NOTICE`) retain their INI semantics.\n\n## Workarounds\n\nIf upgrading is not immediately possible:\n\n1. **Audit INI values:** Ensure no `\u003cini value=\"…\"\u003e` entry in `phpunit.xml` / `phpunit.xml.dist` contains newline, `\"`, or `;` characters, and that nothing writes such values into configuration at build time.\n2. **Isolate CI execution of untrusted code:** Run PHPUnit against pull requests only in ephemeral, containerized runners that discard filesystem state between jobs; require human review before executing PRs from forks; enforce branch protection on workflows that handle secrets (`pull_request_target` and similar). These mitigations apply to the broader PPE risk class and are effective against this vulnerability as well.\n3. **Restrict who can modify `phpunit.xml`:** Treat `phpunit.xml` as security-sensitive in code review, particularly `\u003cini\u003e` entries.\n4. **Sanitize host INI:** Ensure the host PHP's `php.ini` does not contain values with embedded newlines or unescaped metacharacters.","ecosystems":["Packagist"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"PHPUnit: Argument injection via newline in PHP INI values forwarded to child processes","id":"GHSA-mh6w-vxff-9wqp","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"Packagist","product":null,"products":[],"type":"command_injection","year":"2026"},"n_packages":4,"n_references":null,"packages":[{"ecosystem":"Packagist","fixed":["12.5.22"],"introduced":["12.5.21"],"last_affected":[],"package":"phpunit/phpunit","purl":null,"source":"GHSA-mh6w-vxff-9wqp"},{"ecosystem":"Packagist","fixed":["12.5.22"],"introduced":["12.5.21"],"last_affected":[],"package":"phpunit/phpunit","purl":"pkg:composer/phpunit/phpunit","source":"GHSA-mh6w-vxff-9wqp"},{"ecosystem":"Packagist","fixed":["13.1.6"],"introduced":["13.1.5"],"last_affected":[],"package":"phpunit/phpunit","purl":null,"source":"GHSA-mh6w-vxff-9wqp"},{"ecosystem":"Packagist","fixed":["13.1.6"],"introduced":["13.1.5"],"last_affected":[],"package":"phpunit/phpunit","purl":"pkg:composer/phpunit/phpunit","source":"GHSA-mh6w-vxff-9wqp"}],"products":null,"published":"2026-04-22","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Attackers with write access to PHPUnit configuration can inject newlines to execute arbitrary code in child processes via argument injection.","url":"https://insights.sbomify.com/GHSA-mh6w-vxff-9wqp/"}