PHPUnit Vulnerable to Unsafe Deserialization in PHPT Code Coverage Handling
Published Jan 27, 2026
7.8
HIGHCVSS 3.1
EPSS 0.39%
Description
PHPUnit is a testing framework for PHP. A vulnerability has been discovered in versions prior to 12.5.8, 11.5.50, 10.5.62, 9.6.33, and 8.5.52 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 `.coverage` files are present prior to the execution of the PHPT test. The vulnerability occurs when a `.coverage` file, which should not exist before test execution, is deserialized without the `allowed_classes` parameter 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. 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 CI/CD pipeline attacks, the local development environment, and/or compromised dependencies. 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 `.coverage` files for PHPT tests as an error condition. Starting in versions in versions 12.5.8, 11.5.50, 10.5.62, 9.6.33, when a `.coverage` file is detected for a PHPT test prior to execution, PHPUnit will emit a clear error message identifying the anomalous state. Organizations can reduce the effective risk of this vulnerability through proper CI/CD configuration, including ephemeral runners, code review enforcement, branch protection, artifact isolation, and access control.
Affected products
-
- Version < 8.5.52StatusaffectedConstraints-
- Version >= 10.0.0, < 10.5.62StatusaffectedConstraints-
- Version >= 11.0.0, < 11.5.50StatusaffectedConstraints-
- Version >= 12.0.0, < 12.5.8StatusaffectedConstraints-
- Version >= 9.0.0, < 9.6.33StatusaffectedConstraints-
- Version
Default status is the baseline for the product, each version can override it (e.g. patched versions marked unaffected).
| Vendor | Product | Default status | Versions | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Sebastianbergmann | Phpunit | n/a |
|
Configuration 1
- < 8.5.52
- ≥ 9.0.0 · < 9.6.33
- ≥ 10.0.0 · < 10.5.62
- ≥ 11.0.0 · < 11.5.50
- ≥ 12.0.0 · < 12.5.8
Configuration 2
- 11.0
No data.
No Red Hat product state for this CVE.
No package ranges for this CVE.
Remediation
Red Hat statement
This is an IMPORTANT vulnerability in PHPUnit that allows arbitrary code execution. It requires an attacker to have local file write access to the system where PHPUnit tests are executed with code coverage instrumentation enabled. This typically impacts development and CI/CD environments, where malicious `.coverage` files could be introduced.
Metrics
No CVSS v4.0 score for this CVE.
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
No CVSS v3.0 score for this CVE.
No CVSS v2.0 score for this CVE.
This CVE is not in the KEV list.
CISA SSVC (Vulnrichment)
Stakeholder-Specific Vulnerability Categorization from CISA ADP.
Exploitation
NoneAutomatable
NoTechnical Impact
TotalDecision
n/aAssessed Jan 28, 2026 · SSVC 2.0.3
Estimated probability of exploitation in the wild in the next 30 days (FIRST EPSS). As of Oct 1, 2026.
Score over time
Jan–Oct 2026- EPSS v4
- EPSS v5
Percentile over time
- EPSS v4
- EPSS v5
Table of values (3 key points)
Flat stretches are collapsed; showing up to 120 newest points.
| Date | Score | Percentile | Model |
|---|---|---|---|
| Oct 1, 2026 | 0.39% (0.00390) | 30.68th | v5 (v2026.06.15) |
| Jun 15, 2026 | 0.34% (0.00343) | 25.91th | v5 (v2026.06.15) |
| Jan 28, 2026 | 0.08% (0.00085) | 24.90th | v4 (v2025.03.14) |
References (16)
- https://access.redhat.com/security/cve/CVE-2026-24765 Vendor Advisory
- https://bugzilla.redhat.com/show_bug.cgi?id=2433606 Issue Tracking
- https://github.com/FriendsOfPHP/security-advisories/blob/master/phpunit/phpunit/CVE-2026-24765.yaml
- https://github.com/advisories/GHSA-vvj3-c3rp-c85p Advisory
- https://github.com/sebastianbergmann/phpunit/commit/3141742e00620e2968d3d2e732d320de76685fda x_refsource_MISCPatch
- https://github.com/sebastianbergmann/phpunit/commit/613d142f5a8471ca71623ce5ca2795f79248329e
- https://github.com/sebastianbergmann/phpunit/releases/tag/10.5.63 x_refsource_MISCRelease Notes
- https://github.com/sebastianbergmann/phpunit/releases/tag/11.5.50 x_refsource_MISCRelease Notes
- https://github.com/sebastianbergmann/phpunit/releases/tag/12.5.8 x_refsource_MISCRelease Notes
- https://github.com/sebastianbergmann/phpunit/releases/tag/8.5.52 x_refsource_MISCRelease Notes
- https://github.com/sebastianbergmann/phpunit/releases/tag/9.6.33 x_refsource_MISCRelease Notes
- https://github.com/sebastianbergmann/phpunit/security/advisories/GHSA-vvj3-c3rp-c85p x_refsource_CONFIRMMitigationVendor Advisory
- https://lists.debian.org/debian-lts-announce/2026/02/msg00009.html Mailing ListThird Party Advisory
- https://nvd.nist.gov/vuln/detail/CVE-2026-24765
- https://owasp.org/www-project-top-10-ci-cd-security-risks/CICD-SEC-04-Poisoned-Pipeline-Execution
- https://www.cve.org/CVERecord?id=CVE-2026-24765
Change history (0)
No recorded changes yet.