Update dependency phpunit/phpunit to v12 [SECURITY]#904
Open
renovate[bot] wants to merge 1 commit intomainfrom
Open
Update dependency phpunit/phpunit to v12 [SECURITY]#904renovate[bot] wants to merge 1 commit intomainfrom
renovate[bot] wants to merge 1 commit intomainfrom
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



This PR contains the following updates:
9.6.33→12.5.22GitHub Vulnerability Alerts
GHSA-qrr6-mg7r-m243
Impact
PHPUnit forwards PHP INI settings to child processes (used for isolated/PHPT test execution) as
-d name=valuecommand-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. Settingauto_prepend_fileto 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.distini_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 hostphp.ini, or the PHP binary's environment. The most realistic exposure is Poisoned Pipeline Execution (PPE): a pull request from an untrusted contributor that modifiesphpunit.xmlto 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
\nor\ris now rejected with an explicitPhpProcessException. 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 asddtrace'sdatadog.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:
<ini value="…">entry inphpunit.xml/phpunit.xml.distcontains newline,", or;characters, and that nothing writes such values into configuration at build time.pull_request_targetand similar). These mitigations apply to the broader PPE risk class and are effective against this vulnerability as well.phpunit.xml: Treatphpunit.xmlas security-sensitive in code review, particularly<ini>entries.php.inidoes not contain values with embedded newlines or unescaped metacharacters.References
Severity
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HRelease Notes
sebastianbergmann/phpunit (phpunit/phpunit)
v12.5.22Compare Source
v12.5.21Compare Source
v12.5.20Compare Source
v12.5.19: PHPUnit 12.5.19Compare Source
Fixed
Learn how to install or update PHPUnit 12.5 in the documentation.
Keep up to date with PHPUnit:
v12.5.18: PHPUnit 12.5.18Compare Source
Fixed
--random-order-seedis used when test execution order is not random--filterdoes not work when filter string starts with#TestSuiteSkippedevent--filter,--group,--testsuite) yields no teststearDown()and handler restoration, causing subsequent tests to be marked as riskyLearn how to install or update PHPUnit 12.5 in the documentation.
Keep up to date with PHPUnit:
v12.5.17: PHPUnit 12.5.17Compare Source
Changed
exitwas called from some testFixed
colors="true"in XML configuration file does not unconditionally enable colored output--migrate-configurationdoes not update schema location when XML content already validates against current schemawillReturnCallback()is silently swallowed when code under test catches exceptionsset_include_path()TestDoubleBuildermethod chainingLearn how to install or update PHPUnit 12.5 in the documentation.
Keep up to date with PHPUnit:
v12.5.16: PHPUnit 12.5.16Compare Source
Added
%r...%rinEXPECTFsectionFixed
FILE_EXTERNALbreaks__DIR__TestSuiteLoaderis brittle and causes "Class FooTest not found" even for valid tests in valid filenamesLearn how to install or update PHPUnit 12.5 in the documentation.
Keep up to date with PHPUnit:
v12.5.15: PHPUnit 12.5.15Compare Source
Changed
Fixed
RegularExpressionandStringMatchesFormatDescriptiondid not handlepreg_match()errors such asCompilation failed: regular expression is too largeLearn how to install or update PHPUnit 12.5 in the documentation.
Keep up to date with PHPUnit:
v12.5.14: PHPUnit 12.5.14Compare Source
Fixed
Learn how to install or update PHPUnit 12.5 in the documentation.
Keep up to date with PHPUnit:
v12.5.13: PHPUnit 12.5.13Compare Source
Fixed
Learn how to install or update PHPUnit 12.5 in the documentation.
Keep up to date with PHPUnit:
v12.5.12: PHPUnit 12.5.12Compare Source
Fixed
<ini />can silently failLearn how to install or update PHPUnit 12.5 in the documentation.
Keep up to date with PHPUnit:
v12.5.11: PHPUnit 12.5.11Compare Source
Deprecated
with*()on test stubsFixed
SourceMappermay be deleted prematurely when multiple PHPUnit processes run in parallelwith()is used withoutexpects()Learn how to install or update PHPUnit 12.5 in the documentation.
Keep up to date with PHPUnit:
v12.5.10: PHPUnit 12.5.10Compare Source
Fixed
Learn how to install or update PHPUnit 12.5 in the documentation.
Keep up to date with PHPUnit:
v12.5.9: PHPUnit 12.5.9Compare Source
Added
Fixed
Learn how to install or update PHPUnit 12.5 in the documentation.
Keep up to date with PHPUnit:
v12.5.8: PHPUnit 12.5.8Compare Source
Changed
.coveragefiles in pull requests, a PHPT test will no longer be run if the temporary file for writing code coverage information already exists before the test runsLearn how to install or update PHPUnit 12.5 in the documentation.
Keep up to date with PHPUnit:
v12.5.7: PHPUnit 12.5.7Compare Source
Fixed
Count::getCountOf()for unusal implementations ofIteratororIteratorAggregateLearn how to install or update PHPUnit 12.5 in the documentation.
Keep up to date with PHPUnit:
v12.5.6: PHPUnit 12.5.6Compare Source
Changed
Learn how to install or update PHPUnit 12.5 in the documentation.
Keep up to date with PHPUnit:
v12.5.5: PHPUnit 12.5.5Compare Source
Deprecated
any()matcher (soft deprecation)Fixed
Learn how to install or update PHPUnit 12.5 in the documentation.
Keep up to date with PHPUnit:
v12.5.4: PHPUnit 12.5.4Compare Source
Changed
#[AllowMockObjectsWithoutExpectations]attribute can now be used on the method levelFixed
Timer::start() has to be called before Timer::stop()Learn how to install or update PHPUnit 12.5 in the documentation.
Keep up to date with PHPUnit:
v12.5.3: PHPUnit 12.5.3Compare Source
Changed
Learn how to install or update PHPUnit 12.5 in the documentation.
Keep up to date with PHPUnit:
v12.5.2: PHPUnit 12.5.2Compare Source
Added
#[AllowMockObjectsWithoutExpectations]for excluding tests from the check that emits the notice for test methods that create a mock object but do not configure an expectation for itLearn how to install or update PHPUnit 12.5 in the documentation.
Keep up to date with PHPUnit:
v12.5.1: PHPUnit 12.5.1Compare Source
Added
TestCase::getStubBuilder()(analogous toTestCase::getMockBuilder()) for creating (partial) test stubs using a fluent APILearn how to install or update PHPUnit 12.5 in the documentation.
Keep up to date with PHPUnit:
v12.5.0: PHPUnit 12.5.0Compare Source
Added
--allCLI option to ignore test selection configured in XML configuration file<source>element in XML code coverage report optionalChanged
ThrowableinexpectExceptionObject()Learn how to install or update PHPUnit 12.5 in the documentation.
Keep up to date with PHPUnit:
v12.4.5: PHPUnit 12.4.5Compare Source
Changed
Fixed
Learn how to install or update PHPUnit 12.4 in the documentation.
Keep up to date with PHPUnit:
v12.4.4: PHPUnit 12.4.4Compare Source
Fixed
Learn how to install or update PHPUnit 12.4 in the documentation.
Keep up to date with PHPUnit:
v12.4.3: PHPUnit 12.4.3Compare Source
Fixed
STDOUTwhenrewind()failsLearn how to install or update PHPUnit 12.4 in the documentation.
Keep up to date with PHPUnit:
v12.4.2: PHPUnit 12.4.2Compare Source
Changed
Fixed
Learn how to install or update PHPUnit 12.4 in the documentation.
Keep up to date with PHPUnit:
v12.4.1: PHPUnit 12.4.1Compare Source
Fixed
--filterformat used by PhpStorm stopped workingDataProviderMethodCalledevent value objectLearn how to install or update PHPUnit 12.4 in the documentation.
Keep up to date with PHPUnit:
v12.4.0: PHPUnit 12.4.0Compare Source
Added
#[IgnoreDeprecations]attributeDeprecated
#[RunClassInSeparateProcess]attributeLearn how to install or update PHPUnit 12.4 in the documentation.
Keep up to date with PHPUnit:
v12.3.15: PHPUnit 12.3.15Compare Source
Fixed
failOnPhpunitWarning="false"has no effectLearn how to install or update PHPUnit 12.3 in the documentation.
Keep up to date with PHPUnit:
v12.3.14: PHPUnit 12.3.14Compare Source
phpunit.pharrebuilt with updated dependenciesLearn how to install or update PHPUnit 12.3 in the documentation.
Keep up to date with PHPUnit:
v12.3.13: PHPUnit 12.3.13Compare Source
phpunit.pharrebuilt with updated dependenciesLearn how to install or update PHPUnit 12.3 in the documentation.
Keep up to date with PHPUnit:
v12.3.12: PHPUnit 12.3.12Compare Source
phpunit.pharrebuilt with updated dependenciesLearn how to install or update PHPUnit 12.3 in the documentation.
Keep up to date with PHPUnit:
v12.3.11: PHPUnit 12.3.11Compare Source
Changed
__sleep()and__wakeup()from test double code generation on PHP >= 8.5Learn how to install or update PHPUnit 12.3 in the documentation.
Keep up to date with PHPUnit:
v12.3.10: PHPUnit 12.3.10Compare Source
Changed
E_DEPRECATEDissues when building the test suiteLearn how to install or update PHPUnit 12.3 in the documentation.
Keep up to date with PHPUnit:
v12.3.9: PHPUnit 12.3.9Compare Source
Changed
__sleep()method (which will be deprecated in PHP 8.5)Learn how to install or update PHPUnit 12.3 in the documentation.
Keep up to date with PHPUnit:
v12.3.8: PHPUnit 12.3.8Compare Source
Fixed
Learn how to install or update PHPUnit 12.3 in the documentation.
Keep up to date with PHPUnit:
v12.3.7: PHPUnit 12.3.7Compare Source
Changed
#[IgnorePhpunitDeprecations]is now considered for test runner deprecations (where applicable)Learn how to install or update PHPUnit 12.3 in the documentation.
Keep up to date with PHPUnit:
v12.3.6Compare Source
v12.3.5: PHPUnit 12.3.5Compare Source
Changed
error_reporting=E_ALLfor--check-php-configurationFixed
expectUserDeprecationMessage*()fails when test is run in separate processLearn how to install or update PHPUnit 12.3 in the documentation.
Keep up to date with PHPUnit:
v12.3.4: PHPUnit 12.3.4Compare Source
Changed
--check-php-configurationFixed
ini_set('error_log')sets filepath outsideopen_basedirLearn how to install or update PHPUnit 12.3 in the documentation.
Keep up to date with PHPUnit:
v12.3.3: PHPUnit 12.3.3Compare Source
Fixed
#[IgnorePhpunitDeprecations]is now considered for test runner deprecations" from PHPUnit 12.3.1)Learn how to install or update PHPUnit 12.3 in the documentation.
Keep up to date with PHPUnit:
v12.3.2: PHPUnit 12.3.2Compare Source
Changed
testSplObjectStoragemethods that will be deprecated in PHP 8.5Learn how to install or update PHPUnit 12.3 in the documentation.
Keep up to date with PHPUnit:
v12.3.1: PHPUnit 12.3.1Compare Source
Added
--check-php-configurationCLI option for checking whether PHP is configured for testingChanged
#[IgnorePhpunitDeprecations]is now considered for test runner deprecations (where applicable)Fixed
#[TestWith]or#[TestWithJson]attributes are now properly reportedDataProviderMethodFinishedevent is now also emitted when the provided data set has an invalid keyLearn how to install or update PHPUnit 12.3 in the documentation.
Keep up to date with PHPUnit:
v12.3.0: PHPUnit 12.3.0Compare Source
Added
#[IgnorePHPUnitWarnings]attribute for ignoring PHPUnit warnings#[TestDoxFormatter]and#[TestDoxFormatterExternal]attributes for configuring a custom TestDox formatter for tests that use data from data providersTestRunner\ChildProcessErroredeventConfiguration::includeTestSuites()andConfiguration::excludeTestSuites()Changed
@<data-set-name>format (compatible with--filterCLI option) in defect messages#[DataProvider*]attributes are mixed with#[TestWith*]attributesDeprecated
Configuration::includeTestSuite(), useConfiguration::includeTestSuites()insteadConfiguration::excludeTestSuite(), useConfiguration::excludeTestSuites()instead#[CoversNothing]on a test methodHow to install or update PHPUnit
v12.2.9: PHPUnit 12.2.9Compare Source
Fixed
fileattribute of<testClass>node of XML test list can be wrongHow to install or update PHPUnit
v12.2.8: PHPUnit 12.2.8Compare Source
Fixed
How to install or update PHPUnit
v12.2.7: PHPUnit 12.2.7Compare Source
Fixed
defects,randomconfiguration is supported by implementation, but it is not allowed by the XML configuration file schematestprefixHow to install or update PHPUnit
v12.2.6: PHPUnit 12.2.6Compare Source
Fixed
@no-named-argumentsleads to static analysis errors for variadic argumentsHow to install or update PHPUnit
v12.2.5: PHPUnit 12.2.5Compare Source
Fixed
<testsuite>element is missing requirednameattributeHow to install or update PHPUnit
v12.2.4: PHPUnit 12.2.4Compare Source
Changed
--include-git-informationCLI option or theincludeGitInformationattribute in the XML configuration fileHow to install or update PHPUnit
v12.2.3: PHPUnit 12.2.3Compare Source
Added
failOnPhpunitWarningattribute on the<phpunit>element of the XML configuration file and--fail-on-phpunit-warningCLI option for controlling whether PHPUnit should fail on PHPUnit warnings (default:true)--do-not-fail-on-deprecation,--do-not-fail-on-phpunit-warning,--do-not-fail-on-phpunit-deprecation,--do-not-fail-on-empty-test-suite,--do-not-fail-on-incomplete,--do-not-fail-on-notice,--do-not-fail-on-risky,--do-not-fail-on-skipped, and--do-not-fail-on-warningCLI options--do-not-report-useless-testsCLI option as a replacement for--dont-report-useless-testsDeprecated
--dont-report-useless-testsCLI option (use--do-not-report-useless-testsinstead)Fixed
ExpectationFailedExceptionHow to install or update PHPUnit
v12.2.2: PHPUnit 12.2.2Compare Source
Fixed
shortenArraysForExportThresholdXML configuration setting has no effect on all arrays exported for event-related value objectsHow to install or update PHPUnit
v12.2.1: PHPUnit 12.2.1Compare Source
Fixed
How to install or update PHPUnit
v12.2.0: PHPUnit 12.2.0Compare Source
Added
Experimental Support for Open Test Reporting XML
PHPUnit has supported reporting test results in the JUnit XML format for a long time. Unfortunately, there has never been a standard schema for the JUnit XML format. Common consumers of Clover XML log files interpret these files differently, which has led to frequent problems.
To address this, the JUnit team started the Open Test Reporting project, creating and maintaining language-agnostic XML and HTML test reporting formats. Unlike JUnit XML, Open Test Reporting's XML formats are extensible.
Logging in the Open Test Reporting XML format is controlled by the new
--log-otrCLI option and the new<otr>XML configuration element.This feature is experimental and the generated XML may change in order to enhance compliance with the Open Test Reporting project's XML schema definitions. The same applies to the XML schema definitions for information that is specific for PHP and PHPUnit. Please note that such changes may occur in bugfix or minor releases and could potentially break backwards compatibility.
Experimental Support for OpenClover XML
PHPUnit has supported reporting code coverage information in the Clover XML format for a long time. Unfortunately, there has never been a standard schema for the Clover XML format. Common consumers of Clover XML log files interpret these files differently, which leads to frequent problems.
The original commercial Clover project has been superseded by the Open Source OpenClover project, which provides an XML schema for its OpenClover XML format. Rather than modifying the existing Clover XML reporter to comply with the OpenClover XML schema, thereby breaking backward compatibility, a new OpenClover XML reporter has been introduced.
This new reporter is controlled by the new CLI option,
--coverage-openclover, and the new XML configuration element,<openclover>. This code coverage reporter generates XML documents that validate against the OpenClover project's XML schema definition, with one exception: the<testproject>element is not generated.The existing Clover XML reporter, controlled by the
--coverage-cloverCLI option and the<clover>XMLConfiguration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ 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.
This PR was generated by Mend Renovate. View the repository job log.