Skip to content

Update dependency phpunit/phpunit to v12.5.22 [SECURITY] - autoclosed#19

Closed
renovate[bot] wants to merge 1 commit intomainfrom
renovate/packagist-phpunit-phpunit-vulnerability
Closed

Update dependency phpunit/phpunit to v12.5.22 [SECURITY] - autoclosed#19
renovate[bot] wants to merge 1 commit intomainfrom
renovate/packagist-phpunit-phpunit-vulnerability

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate Bot commented Apr 18, 2026

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
phpunit/phpunit (source) 12.5.812.5.22 age adoption passing confidence

GitHub Vulnerability Alerts

GHSA-qrr6-mg7r-m243

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:

  • 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.
  • 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.
  • Restrict who can modify phpunit.xml: Treat phpunit.xml as security-sensitive in code review, particularly <ini> entries.
  • Sanitize host INI: Ensure the host PHP's php.ini does not contain values with embedded newlines or unescaped metacharacters.

References

Severity
  • CVSS Score: 7.8 / 10 (High)
  • Vector String: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Release Notes

sebastianbergmann/phpunit (phpunit/phpunit)

v12.5.22

Compare Source

v12.5.21

Compare Source

v12.5.20

Compare Source

v12.5.19: PHPUnit 12.5.19

Compare Source

Fixed
  • Regression in XML configuration migration introduced in PHPUnit 12.5.8

Learn how to install or update PHPUnit 12.5 in the documentation.

Keep up to date with PHPUnit:

v12.5.18: PHPUnit 12.5.18

Compare Source

Fixed
  • #​4571: No warning when --random-order-seed is used when test execution order is not random
  • #​4975: --filter does not work when filter string starts with #
  • #​5354: JUnit XML logger does not handle TestSuiteSkipped event
  • #​6276: Exit with non-zero exit code when explicit test selection (--filter, --group, --testsuite) yields no tests
  • #​6583: Failing output expectation skips tearDown() and handler restoration, causing subsequent tests to be marked as risky

Learn how to install or update PHPUnit 12.5 in the documentation.

Keep up to date with PHPUnit:

v12.5.17: PHPUnit 12.5.17

Compare Source

Changed
  • #​4793: Exit with non-zero exit code when exit was called from some test
Fixed
  • #​5881: colors="true" in XML configuration file does not unconditionally enable colored output
  • #​6019: --migrate-configuration does not update schema location when XML content already validates against current schema
  • #​6372: Assertion failure inside willReturnCallback() is silently swallowed when code under test catches exceptions
  • #​6464: Process isolation template unconditionally calls set_include_path()
  • #​6571: Static analysis errors for TestDoubleBuilder method chaining

Learn how to install or update PHPUnit 12.5 in the documentation.

Keep up to date with PHPUnit:

v12.5.16: PHPUnit 12.5.16

Compare Source

Added
  • #​6547: Support for %r...%r in EXPECTF section
Fixed
  • #​6025: FILE_EXTERNAL breaks __DIR__
  • #​6351: No warning when the same test runner extension is configured more than once
  • #​6433: Logic in TestSuiteLoader is brittle and causes "Class FooTest not found" even for valid tests in valid filenames
  • #​6463: Process Isolation fails on non-serializable globals and quietly ignore closures

Learn how to install or update PHPUnit 12.5 in the documentation.

Keep up to date with PHPUnit:

v12.5.15: PHPUnit 12.5.15

Compare Source

Changed
  • #​4440: Improve error when configured code coverage file list is empty
  • #​6549: Allow to stub both hooks of non-virtual properties
Fixed
  • #​6529: Git "detached HEAD state" in Open Test Reporting (OTR) XML logger not handled properly
  • #​6545: Stubbing a class with set property hook leaves property uninitialized by default
  • The RegularExpression and StringMatchesFormatDescription did not handle preg_match() errors such as Compilation failed: regular expression is too large

Learn how to install or update PHPUnit 12.5 in the documentation.

Keep up to date with PHPUnit:

v12.5.14: PHPUnit 12.5.14

Compare Source

Fixed
  • #​6521: Performance regression in PHPUnit 11.5.54, PHPUnit 12.5.13, and PHPUnit 13.0.4

Learn how to install or update PHPUnit 12.5 in the documentation.

Keep up to date with PHPUnit:

v12.5.13: PHPUnit 12.5.13

Compare Source

Fixed
  • #​6489: Classification of self/direct/indirect deprecation triggers is not aligned with Symfony's bridge for PHPUnit

Learn how to install or update PHPUnit 12.5 in the documentation.

Keep up to date with PHPUnit:

v12.5.12: PHPUnit 12.5.12

Compare Source

Fixed
  • #​6511: TestDox variables out of order with named arguments
  • #​6514: <ini /> can silently fail

Learn how to install or update PHPUnit 12.5 in the documentation.

Keep up to date with PHPUnit:

v12.5.11: PHPUnit 12.5.11

Compare Source

Deprecated
  • #​6510: Deprecate using with*() on test stubs
Fixed
  • #​6503: Temporary file used by SourceMapper may be deleted prematurely when multiple PHPUnit processes run in parallel
  • #​6509: "No expectations were configured for the mock object ..." notice is emitted when with() is used without expects()

Learn how to install or update PHPUnit 12.5 in the documentation.

Keep up to date with PHPUnit:

v12.5.10: PHPUnit 12.5.10

Compare Source

Fixed
  • #​6495: Source map for issue trigger identification is regenerated in process isolation child processes

Learn how to install or update PHPUnit 12.5 in the documentation.

Keep up to date with PHPUnit:

v12.5.9: PHPUnit 12.5.9

Compare Source

Added
  • #​6488: Allow disabling issue trigger identification for improved performance
Fixed
  • #​6486: Incorrect file name reported for errors for test methods declared in traits
  • #​6490: Incorrect test count when tests are skipped in before-class method

Learn how to install or update PHPUnit 12.5 in the documentation.

Keep up to date with PHPUnit:

Configuration

📅 Schedule: (in timezone UTC)

  • Branch creation
    • ""
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

| datasource | package         | from   | to      |
| ---------- | --------------- | ------ | ------- |
| packagist  | phpunit/phpunit | 12.5.8 | 12.5.22 |


Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@renovate renovate Bot added the renovate label Apr 18, 2026
@renovate
Copy link
Copy Markdown
Contributor Author

renovate Bot commented Apr 18, 2026

Branch automerge failure

This PR was configured for branch automerge. However, this is not possible, so it has been raised as a PR instead.


  • Branch has one or more failed status checks

@renovate renovate Bot changed the title Update dependency phpunit/phpunit to v12.5.22 [SECURITY] Update dependency phpunit/phpunit to v12.5.22 [SECURITY] - autoclosed Apr 20, 2026
@renovate renovate Bot closed this Apr 20, 2026
@renovate renovate Bot deleted the renovate/packagist-phpunit-phpunit-vulnerability branch April 20, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants