CVE-2026-24765

PHPUnit Vulnerable to Unsafe Deserialization in PHPT Code Coverage Handling

HIGH
7.8
CVSS Score
Published: January 27, 2026 at 09:35 PM UTC
Updated: June 17, 2026 at 10:23 AM UTC
3 products affected across 3 vendorsDebian LinuxPhpunitPHPUnit

Using phpunit by sebastianbergmann?

Get instant alerts when new vulnerabilities affect phpunit - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH7.8
Exploit prediction
EPSS 0.4%
SSVC
No known exploit

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

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 8.5.5210.0.0 ≤ v < 10.5.6211.0.0 ≤ v < 11.5.5012.0.0 ≤ v < 12.5.89.0.0 ≤ v < 9.6.33
v < 10.5.62v < 11.5.50v < 12.5.8v < 8.5.52v < 9.6.33
Affected range stops below 10.5.62, so it looks safe — our inference, not a vendor statement
Affected range stops below 11.5.50, so it looks safe — our inference, not a vendor statement
Affected range stops below 12.5.8, so it looks safe — our inference, not a vendor statement
Affected range stops below 8.5.52, so it looks safe — our inference, not a vendor statement
Affected range stops below 9.6.33, so it looks safe — our inference, not a vendor statement

Remediation

No guide yet

No remediation guidance has been written for this CVE yet. What the record does show:

References (8)

x_refsource_CONFIRMMitigationVendor Advisory
Source: cverecord
https://github.com/sebastianbergmann/phpunit/security/advisories/GHSA-vvj3-c3rp-c85p
x_refsource_MISCRelease Notes
Source: cverecord
https://github.com/sebastianbergmann/phpunit/releases/tag/10.5.63
x_refsource_MISCRelease Notes
Source: cverecord
https://github.com/sebastianbergmann/phpunit/releases/tag/11.5.50
x_refsource_MISCRelease Notes
Source: cverecord
https://github.com/sebastianbergmann/phpunit/releases/tag/12.5.8
x_refsource_MISCRelease Notes
Source: cverecord
https://github.com/sebastianbergmann/phpunit/releases/tag/8.5.52
x_refsource_MISCRelease Notes
Source: cverecord
https://github.com/sebastianbergmann/phpunit/releases/tag/9.6.33
Mailing ListThird Party Advisory
Source: af854a3a-2127-422b-91ae-364da2661108
https://lists.debian.org/debian-lts-announce/2026/02/msg00009.html

SSVC — Action Prioritization

SSVCNo known exploitNot automatableTotal impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

7.8HIGHGitHub_M
Attack Vector
LOCAL
Complexity
LOW
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
HIGH
Availability
HIGH
Vector?

Quick Info

StatusANALYZED
CWE
CWE-502

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card