Skip to content
FlawDB
Sign in
Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

CVE-2026-24765

HIGH 7.8EPSS 58%

PHPUnit Vulnerable to Unsafe Deserialization in PHPT Code Coverage Handling

Also known as GHSA-vvj3-c3rp-c85p

Mitigation

  • Upgrade phpunit/phpunit to one of 8.5.52, 9.6.33, 10.5.62, 11.5.50, 12.5.8 (or later in the same release line).

Who should check

  • Projects that depend on Packagist package phpunit/phpunit (< 8.5.52)
  • Anyone running sebastianbergmann phpunit < 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

Vulnerability facts

Affected
phpunit/phpunit < 8.5.52
Fixed in
8.5.52, 9.6.33, 10.5.62, 11.5.50, 12.5.8
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Not remotely exploitable (local or adjacent access needed)
CVSS
7.8 (v3.1, CNA)CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
  • Attack vector: Local
  • Attack complexity: Low
  • Privileges required: Low
  • User interaction: None
  • Scope: Unchanged
  • Confidentiality impact: High
  • Integrity impact: High
  • Availability impact: High
EPSS
0.90% chance of exploitation in 30 days (percentile 58, 2026-11-26)
CWE
CWE-502
Published
Modified

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 and fixed versions

Package / productAffectedFixedSource
Packagist phpunit/phpunit< 8.5.528.5.52, 9.6.33, 10.5.62, 11.5.50, 12.5.8osv
sebastianbergmann phpunit< 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—cvelist

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

Check whether anything I run is affected by CVE-2026-24765. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-24765.md
Affected: phpunit/phpunit < 8.5.52
Fixed in: 8.5.52, 9.6.33, 10.5.62, 11.5.50, 12.5.8

Steps:
1. Search this machine and project for phpunit/phpunit (Packagist), sebastianbergmann phpunit: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.

References

FAQ

Is CVE-2026-24765 being exploited?

There is no confirmed exploitation: CVE-2026-24765 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.90% chance of exploitation in the next 30 days (as of 2026-11-26).

How serious is CVE-2026-24765?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

Which versions are affected by CVE-2026-24765?

phpunit/phpunit < 8.5.52.

Is there a fix for CVE-2026-24765?

Yes. Fixed in 8.5.52, 9.6.33, 10.5.62, 11.5.50, 12.5.8. Upgrade phpunit/phpunit to one of 8.5.52, 9.6.33, 10.5.62, 11.5.50, 12.5.8 (or later in the same release line).

How do I check if I'm affected by CVE-2026-24765?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

Sponsors