Read the docs
TI-2026-19966 Aliases CVE-2026-24765GHSA-vvj3-c3rp-c85p

PHPUnit Vulnerable to Unsafe Deserialization in PHPT Code Coverage Handling

Priority LOW 36CWE-502Published · Updated

Key facts

Attack vector
Local
Privileges required
Low
User interaction
None
Attack complexity
Low
Impact type
Code execution
Confidentiality · integrity · availability
High · High · High
Fix status
Fixed

Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-502.

Summary

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.

Why it matters now

Exploitation None reported CISA SSVC · not in CISA KEV
EPSS 0.00384 32nd percentileScored 2026-11-07
Fix Fixed phpunit (sebastianbergmann): 8.5.52, 9.6.33, 10.5.62 +2phpunit/phpunit (Packagist): 8.5.52, 9.6.33, 10.5.62 +2

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
None
Automatable
No
Technical impact
Total

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
sebastianbergmannphpunitbefore 8.5.52; 9.0.0 to before 9.6.33; 10.0.0 to before 10.5.62; 11.0.0 to before 11.5.50; 12.0.0 to before 12.5.88.5.52, 9.6.33, 10.5.62, 11.5.50, 12.5.8Patch availableCNA
—phpunit/phpunit (Packagist)before 8.5.528.5.52Patch availableGHSA-vvj3-c3rp-c85p
—phpunit/phpunit (Packagist)9.0.0 to before 9.6.339.6.33Patch availableGHSA-vvj3-c3rp-c85p
—phpunit/phpunit (Packagist)10.0.0 to before 10.5.6210.5.62Patch availableGHSA-vvj3-c3rp-c85p
—phpunit/phpunit (Packagist)11.0.0 to before 11.5.5011.5.50Patch availableGHSA-vvj3-c3rp-c85p
—phpunit/phpunit (Packagist)12.0.0 to before 12.5.812.5.8Patch availableGHSA-vvj3-c3rp-c85p
  • phpunit Vendorsebastianbergmann Affected before 8.5.52; 9.0.0 to before 9.6.33; 10.0.0 to before 10.5.62; 11.0.0 to before 11.5.50; 12.0.0 to before 12.5.8 Fixed in 8.5.52, 9.6.33, 10.5.62, 11.5.50, 12.5.8 Patch available CNA
  • phpunit/phpunit (Packagist) Vendor— Affected before 8.5.52 Fixed in 8.5.52 Patch available GHSA-vvj3-c3rp-c85p
  • phpunit/phpunit (Packagist) Vendor— Affected 9.0.0 to before 9.6.33 Fixed in 9.6.33 Patch available GHSA-vvj3-c3rp-c85p
  • phpunit/phpunit (Packagist) Vendor— Affected 10.0.0 to before 10.5.62 Fixed in 10.5.62 Patch available GHSA-vvj3-c3rp-c85p
  • phpunit/phpunit (Packagist) Vendor— Affected 11.0.0 to before 11.5.50 Fixed in 11.5.50 Patch available GHSA-vvj3-c3rp-c85p
  • phpunit/phpunit (Packagist) Vendor— Affected 12.0.0 to before 12.5.8 Fixed in 12.5.8 Patch available GHSA-vvj3-c3rp-c85p

CPE configurations NVD · 2

CPEVersionsRoleVendor
cpe:2.3:a:phpunit_project:phpunit:*:*:*:*:*:-:*:*before 8.5.52; 9.0.0 to before 9.6.33; 10.0.0 to before 10.5.62; 11.0.0 to before 11.5.50; 12.0.0 to before 12.5.8VulnerablePhpunit Project
cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*11.0VulnerableDebian
  • cpe:2.3:a:phpunit_project:phpunit:*:*:*:*:*:-:*:* Versions before 8.5.52; 9.0.0 to before 9.6.33; 10.0.0 to before 10.5.62; 11.0.0 to before 11.5.50; 12.0.0 to before 12.5.8 Vulnerable ·Phpunit Project
  • cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:* Versions 11.0 Vulnerable ·Debian

Remediation

  • Fix · CNA phpunit (sebastianbergmann) Fixed in 8.5.52, 9.6.33, 10.5.62, 11.5.50, 12.5.8
  • Fix · GHSA-vvj3-c3rp-c85p phpunit/phpunit (Packagist) Fixed in 8.5.52 Advisory →
  • Fix · GHSA-vvj3-c3rp-c85p phpunit/phpunit (Packagist) Fixed in 9.6.33 Advisory →
  • Fix · GHSA-vvj3-c3rp-c85p phpunit/phpunit (Packagist) Fixed in 10.5.62 Advisory →
  • Fix · GHSA-vvj3-c3rp-c85p phpunit/phpunit (Packagist) Fixed in 11.5.50 Advisory →
  • Fix · GHSA-vvj3-c3rp-c85p phpunit/phpunit (Packagist) Fixed in 12.5.8 Advisory →

Vendor assessments

Red Hat

Red Hat's page for this CVE →

Not affected: 1 product
  • Red Hat

Timeline

  1. 2026-10-02 Threatist record created from CVE-2026-24765
  2. 2026-10-03 Alias added: GHSA-vvj3-c3rp-c85p

References

  • TI-2026-82740 Insecure temporary directory in PHPUnit allows local code execution CVSS 4.0MEDIUM 5.4

Sources