chore(deps): update dependency phpunit/phpunit to v10.5.62 [security] #205
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:
10.5.46→10.5.62GitHub Vulnerability Alerts
CVE-2026-24765
Overview
A vulnerability has been discovered involving unsafe deserialization of code coverage data in PHPT test execution. The vulnerability exists in the
cleanupForCoverage()method, which deserializes code coverage files without validation, potentially allowing remote code execution if malicious.coveragefiles are present prior to the execution of the PHPT test.Technical Details
Affected Component: PHPT test runner, method
cleanupForCoverage()Affected Versions: <= 8.5.51, <= 9.6.32, <= 10.5.61, <= 11.5.49, <= 12.5.7
Vulnerable Code Pattern
The vulnerability occurs when a
.coveragefile, which should not exist before test execution, is deserialized without theallowed_classesparameter restriction. An attacker with local file write access can place a malicious serialized object with a__wakeup()method into the file system, leading to arbitrary code execution during test runs with code coverage instrumentation enabled.Attack Prerequisites and Constraints
This vulnerability requires local file write access to the location where PHPUnit stores or expects code coverage files for PHPT tests. This can occur through:
.coveragefile alongside test files, executed when the CI system runs tests using PHPUnit and collects code coverage informationCritical Context: Running test suites from unreviewed pull requests without isolated execution is inherently a code execution risk, independent of this specific vulnerability. This represents a broader class of Poisoned Pipeline Execution (PPE) attacks affecting CI/CD systems.
Proposed Remediation Approach
Rather than just silently sanitizing the input via
['allowed_classes' => false], the maintainer has chosen to make the anomalous state explicit by treating pre-existing.coveragefiles for PHPT tests as an error condition.Rationale for Error-Based Approach:
.coveragefile existing before test execution), the error must be visible in CI/CD output, alerting operators to investigate the root cause rather than proceeding with sanitized input.coveragefile should never exist before tests run, coverage data is generated by executing tests, not sourced from artifacts. Its presence indicates:Severity Classification
Mitigating Factors (Environmental Context)
Organizations can reduce the effective risk of this vulnerability through proper CI/CD configuration:
Fixed Behaviour
When a
.coveragefile is detected for a PHPT test prior to execution, PHPUnit will emit a clear error message identifying the anomalous state. This ensures:Recommendation
Update to the patched version immediately if a project runs PHPT tests using PHPUnit with coverage instrumentation in any CI/CD environment that executes code from external contributors. Additionally, audit the project's CI/CD configuration to ensure:
Release Notes
sebastianbergmann/phpunit (phpunit/phpunit)
v10.5.62Compare Source
v10.5.61: PHPUnit 10.5.61Compare Source
Changed
PHPUnit\Framework\MockObjectexceptions are now subtypes ofPHPUnit\ExceptionLearn how to install or update PHPUnit 10.5 in the documentation.
Keep up to date with PHPUnit:
v10.5.60: PHPUnit 10.5.60Compare Source
phpunit.pharrebuilt with PHP 8.4 to work around PHP-Scoper issue #1139Learn how to install or update PHPUnit 10.5 in the documentation.
Keep up to date with PHPUnit:
v10.5.59: PHPUnit 10.5.59Compare Source
Changed
PHPUnit\Runner\TestSuiteSorterthat was only used in the tests for this classLearn how to install or update PHPUnit 10.5 in the documentation.
Keep up to date with PHPUnit:
v10.5.58: PHPUnit 10.5.58Compare Source
Fixed
failOnPhpunitWarning="false"has no effectLearn how to install or update PHPUnit 10.5 in the documentation.
Keep up to date with PHPUnit:
v10.5.57: PHPUnit 10.5.57Compare Source
phpunit.pharrebuilt with updated dependenciesLearn how to install or update PHPUnit 10.5 in the documentation.
Keep up to date with PHPUnit:
v10.5.56: PHPUnit 10.5.56Compare Source
phpunit.pharrebuilt with updated dependenciesLearn how to install or update PHPUnit 10.5 in the documentation.
Keep up to date with PHPUnit:
v10.5.55: PHPUnit 10.5.55Compare Source
Changed
__sleep()and__wakeup()from test double code generation on PHP >= 8.5Learn how to install or update PHPUnit 10.5 in the documentation.
Keep up to date with PHPUnit:
v10.5.54: PHPUnit 10.5.54Compare Source
Changed
__sleep()method (which will be deprecated in PHP 8.5)Learn how to install or update PHPUnit 10.5 in the documentation.
Keep up to date with PHPUnit:
v10.5.53Compare Source
v10.5.52: PHPUnit 10.5.52Compare Source
Changed
error_reporting=E_ALLfor--check-php-configurationLearn how to install or update PHPUnit 10.5 in the documentation.
Keep up to date with PHPUnit:
v10.5.51: PHPUnit 10.5.51Compare Source
Changed
--check-php-configurationLearn how to install or update PHPUnit 10.5 in the documentation.
Keep up to date with PHPUnit:
v10.5.50: PHPUnit 10.5.50Compare Source
Changed
testSplObjectStoragemethods that will be deprecated in PHP 8.5Learn how to install or update PHPUnit 10.5 in the documentation.
Keep up to date with PHPUnit:
v10.5.49: PHPUnit 10.5.49Compare Source
Added
--check-php-configurationCLI option for checking whether PHP is configured for testingFixed
#[TestWith]or#[TestWithJson]attributes are now properly reportedLearn how to install or update PHPUnit 10.5 in the documentation.
Keep up to date with PHPUnit:
v10.5.48: PHPUnit 10.5.48Compare Source
Fixed
defects,randomconfiguration is supported by implementation, but it is not allowed by the XML configuration file schemaHow to install or update PHPUnit
v10.5.47: PHPUnit 10.5.47Compare 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
v10.5.46: PHPUnit 10.5.46Compare Source
Added
displayDetailsOnAllIssuesattribute on the<phpunit>element of the XML configuration file and--display-all-issuesCLI option for controlling whether PHPUnit should display details on all issues that are triggered (default:false)failOnAllIssuesattribute on the<phpunit>element of the XML configuration file and--fail-on-all-issuesCLI option for controlling whether PHPUnit should fail on all issues that are triggered (default:false)Changed
E_STRICTconstantHow to install or update PHPUnit
v10.5.45: PHPUnit 10.5.45Compare Source
Changed
--debugoutputHow to install or update PHPUnit
v10.5.44: PHPUnit 10.5.44Compare Source
Fixed
stringcannot be used in customized TestDox outputHow to install or update PHPUnit
v10.5.43: PHPUnit 10.5.43Compare Source
Changed
How to install or update PHPUnit
v10.5.42: PHPUnit 10.5.42Compare Source
Fixed
SourceMapperto scan all<source/>filesHow to install or update PHPUnit
v10.5.41: PHPUnit 10.5.41Compare Source
Added
Test\AfterLastTestMethodErrored,Test\AfterTestMethodErrored,Test\BeforeTestMethodErrored,Test\PostConditionErrored, andTest\PreConditionErroredeventsFixed
system-outelement in JUnit XML logfileHow to install or update PHPUnit
v10.5.40: PHPUnit 10.5.40Compare Source
Fixed
assertArrayHasKey(),assertArrayNotHasKey(),arrayHasKey(), andArrayHasKey::__construct()do not support all possible key types--migrate-configurationdoes not removebeStrictAboutTodoAnnotatedTestsattribute from XML configuration fileHow to install or update PHPUnit
v10.5.39: PHPUnit 10.5.39Compare Source
Added
DefaultResultCache::mergeWith()for merging result cache instancesFixed
How to install or update PHPUnit
v10.5.38: PHPUnit 10.5.38Compare Source
Changed
How to install or update PHPUnit
v10.5.37: PHPUnit 10.5.37Compare Source
Fixed
How to install or update PHPUnit
v10.5.36: PHPUnit 10.5.36Compare Source
Changed
StringMatchesFormatDescriptionconstraint to be consistent with PHP'srun-tests.phpFixed
PHPUnit\Framework\Exceptiondoes not handle string error codes (PDOExceptionwith error code'HY000', for example)How to install or update PHPUnit
v10.5.35: PHPUnit 10.5.35Compare Source
Changed
E_STRICTconstant in PHP 8.4Fixed
trim()med when it contains$characterHow to install or update PHPUnit
v10.5.34: PHPUnit 10.5.34Compare Source
Fixed
nameproperty on<testsuites>element in JUnit XML logfileCallbackthrows aTypeErrorwhen checking acallablehas variadic parametersHow to install or update PHPUnit
v10.5.33: PHPUnit 10.5.33Compare Source
Fixed
assertJsonStringEqualsJsonString()considers objects with sequential numeric keys equal to be arraysCallbackconstraint does not handle variadic arguments correctly when used for mock object expectations$at the beginning gets truncated when used with a data providerHow to install or update PHPUnit
v10.5.32: PHPUnit 10.5.32Compare Source
Added
failOnPhpunitDeprecationattribute on the<phpunit>element of the XML configuration file and--fail-on-phpunit-deprecationCLI option for controlling whether PHPUnit deprecations should be considered when determining the test runner's shell exit code (default: do not consider)displayDetailsOnPhpunitDeprecationsattribute on the<phpunit>element of the XML configuration file and--display-phpunit-deprecationsCLI option for controlling whether details on PHPUnit deprecations should be displayed (default: do not display)Changed
--fail-on-phpunit-deprecationCLI option or thefailOnPhpunitDeprecation="true"attribute on the<phpunit>element of the XML configuration file.--display-phpunit-deprecationsCLI option or thedisplayDetailsOnPhpunitDeprecationsattribute on the<phpunit>element of the XML configuration file.How to install or update PHPUnit
v10.5.31: PHPUnit 10.5.31Compare Source
Changed
nameproperty on<testsuites>element in JUnit XML logfile.phpstorm.meta.phpfile as methods such asTestCase::createStub()use generics / template types for their return types and PhpStorm, for example, uses that informationFixed
@operatorHow to install or update PHPUnit
v10.5.30: PHPUnit 10.5.30Compare Source
Changed
How to install or update PHPUnit
v10.5.29: PHPUnit 10.5.29Compare Source
Fixed
--list-testsand--list-tests-xmlCLI options do not report error when data provider method throws exceptionHow to install or update PHPUnit
v10.5.28: PHPUnit 10.5.28Compare Source
Fixed
Test\Passedevent is not emitted for PHPT tests--coverage-filterCLI option could not be used multiple timesHow to install or update PHPUnit
v10.5.27: PHPUnit 10.5.27Compare Source
Changed
--prefer-lowestCLI option also get recent versions)Fixed
phpunit.xmlare not handled correctly when--generate-configurationis usedHow to install or update PHPUnit
v10.5.26: PHPUnit 10.5.26Compare Source
Added
--only-summary-for-coverage-textCLI option to reduce the code coverage report in text format to a summary--show-uncovered-for-coverage-textCLI option to expand the code coverage report in text format to include a list of uncovered filesHow to install or update PHPUnit
v10.5.25: PHPUnit 10.5.25Compare Source
Changed
How to install or update PHPUnit
v10.5.24: PHPUnit 10.5.24Compare Source
Changed
array_pop()instead ofarray_shift()for processingTestobjects inTestSuite::run()and optimizeTestSuite::isEmpty()How to install or update PHPUnit
v10.5.23: PHPUnit 10.5.23Compare Source
Changed
TestCaseobjects early that use a data providerHow to install or update PHPUnit
v10.5.22: PHPUnit 10.5.22Compare Source
Changed
debug_backtrace()How to install or update PHPUnit
v10.5.21: PHPUnit 10.5.21Compare Source
Changed
TestCaseobject after its test was runHow to install or update PHPUnit
v10.5.20: PHPUnit 10.5.20Compare Source
How to install or update PHPUnit
v10.5.19: PHPUnit 10.5.19Compare Source
Fixed
method()on a test stub created usingcreateStubForIntersectionOfInterfaces()throws an unexpected exceptionHow to install or update PHPUnit
v10.5.18: PHPUnit 10.5.18Compare Source
Deprecated
Fixed
@testWithannotation may generatePHP Warning: Uninitialized string offset 0How to install or update PHPUnit
v10.5.17: PHPUnit 10.5.17Compare Source
Changed
PHPUnitPHARinstead of justPHPUnitfor the PHAR distribution of PHPUnitHow to install or update PHPUnit
v10.5.16: PHPUnit 10.5.16Compare Source
Changed
proc_open()if not really neededFixed
How to install or update PHPUnit
v10.5.15: PHPUnit 10.5.15Compare Source
Fixed
How to install or update PHPUnit
v10.5.14: PHPUnit 10.5.14Compare Source
Changed
Groups::groups()NamePrettifier::prettifyTestMethodName()NamePrettifier::prettifyTestMethodName()once againFixed
How to install or update PHPUnit
v10.5.13: PHPUnit 10.5.13Compare Source
Changed
NamePrettifier::prettifyTestMethodName()NamePrettifier::prettifyTestMethodName()TestRunner::runTestWithTimeout()Telemetry\System::snapshot()ExecutionOrderDependency::getTarget()callNamePrettifier::prettifyTestMethodName()Fixed
-dCLI option multiple times triggers warningHow to install or update PHPUnit
v10.5.12: PHPUnit 10.5.12Compare Source
Fixed
HRTime::duration()throwsInvalidArgumentExceptionHow to install or update PHPUnit
v10.5.11Compare Source
v10.5.10Compare Source
v10.5.9Compare Source
v10.5.8Compare Source
v10.5.7Compare Source
v10.5.6Compare Source
v10.5.5Compare Source
v10.5.4Compare Source
v10.5.3Compare Source
v10.5.2Compare Source
v10.5.1Compare Source
v10.5.0Compare Source
v10.4.2Compare Source
v10.4.1Compare Source
v10.4.0Compare Source
v10.3.5Compare Source
v10.3.4Compare Source
v10.3.3Compare Source
Configuration
📅 Schedule: Branch creation - "" (UTC), 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.
This PR was generated by Mend Renovate. View the repository job log.