llamaCVEVulnerability Intelligence
/
Advisory · GitHub · Packagist · phpunit/phpunit

GHSA-MH6W-VXFF-9WQP

PHPUnit: Argument injection via newline in PHP INI values forwarded to child processes

Texto original en inglés · Ver en español

Parche disponible
Descargar PNG JSON
CVSS
—
high
Fuente: —
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche2 versiones12.5.22 · 13.1.6
Exposición213 dDesde la divulgación, 22 abr 2026, 9:56 a. m.
Detección208 dDesde la divulgación hasta su ingreso al índice
Decisión estimadaSeguir
Remediar en la ventana regular de mantenimiento
Estimación de Llama con el árbol SSVC de CISA a partir de la severidad declarada por GHSA (alta) y la evidencia de explotación (sin evaluación oficial): sin explotación conocida, no automatizable e impacto técnico parcial. Hay versiones corregidas disponibles.
Ponle una regla en tu SIEM y seguimos.No corre prisa, pero no la pierdas de vista.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada +1
Explotación
Remediación
Monitoreo
Detectada
22 abr 26
17 nov 26
21 nov 26
22 abr 26
14 jun 26
7 ago 26
29 sept 26
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-MH6W-VXFF-9WQP divulgada
Divulgación Modificada Última actualización del registro
Monitoreo Detectada Ingresó al índice
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

Impact

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 in `phpunit.xml` / `phpunit.xml.dist`
  • INI settings inherited from the host PHP runtime via `ini_get_all()`

Threat Model

Exploitation 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.

Affected Component

`PHPUnit\Util\PHP\JobRunner::settingsToParameters()`

Patches

The fix has two parts:

1. Reject line-break characters

Because 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.

2. Quote remaining metacharacters

Values 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 & ~E_NOTICE`) retain their INI semantics.

Workarounds

If upgrading is not immediately possible:

  1. Audit INI values: Ensure no `<ini value="…">` entry in `phpunit.xml` / `phpunit.xml.dist` contains newline, `"`, or `;` characters, and that nothing writes such values into configuration at build time.
  2. 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.
  3. Restrict who can modify `phpunit.xml`: Treat `phpunit.xml` as security-sensitive in code review, particularly `<ini>` entries.
  4. Sanitize host INI: Ensure the host PHP's `php.ini` does not contain values with embedded newlines or unescaped metacharacters.

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

Versiones

Rangos afectados

Afectada Corregida
phpunit/phpunit≥ 12.5.21 < 12.5.22
phpunit/phpunit≥ 13.1.5 < 13.1.6
12.5.21
12.5.22
13.1.5
13.1.6
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
Packagistphpunit/phpunit
Corregida 12.5.22, 13.1.6 — —
Versiones corregidas12.5.2213.1.6
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Otrahttps://github.com/sebastianbergmann/phpunit/security/advisories/GHSA-qrr6-mg7r-m243
Otrahttps://github.com/sebastianbergmann/phpunit/pull/6592
Otrahttps://github.com/FriendsOfPHP/security-advisories/blob/master/phpunit/phpunit/GHSA-qrr6-mg7r-m243.yaml
Otrahttps://github.com/sebastianbergmann/phpunit
Otrahttps://owasp.org/www-project-top-10-ci-cd-security-risks/CICD-SEC-04-Poisoned-Pipeline-Execution

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.