CVE-2026-24765 PHPUnit Vulnerable to Unsafe Deserialization in PHPT Code Coverage Handling

High 7.8 Published Updated

An attacker with local file write access can achieve arbitrary code execution by placing malicious serialized data in code coverage files during PHPT test runs.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2026-24765?

CVE-2026-24765 is a high-severity unsafe deserialization vulnerability in Debian Debian Linux, published on 27 Jan 2026. It can only be exploited from the same machine or local network, with no action from the victim.

Official 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.

Weakness: CWE-502

Which versions are affected by CVE-2026-24765?

10 open source packages ship an affected version, including phpunit/phpunit. It affects 2 products.

PackageAffectedFixed in
phpunit/phpunit PackagistAll versions8.5.52
phpunit/phpunit PackagistAll versions8.5.52
phpunit/phpunit PackagistFrom 10.0.010.5.62
phpunit/phpunit PackagistFrom 10.0.010.5.62
phpunit/phpunit PackagistFrom 11.0.011.5.50
phpunit/phpunit PackagistFrom 11.0.011.5.50
4 more packages
phpunit/phpunit PackagistFrom 12.0.012.5.8
phpunit/phpunit PackagistFrom 12.0.012.5.8
phpunit/phpunit PackagistFrom 9.0.09.6.33
phpunit/phpunit PackagistFrom 9.0.09.6.33

Products include Debian Debian Linux, Phpunit Project Phpunit.

How do I fix CVE-2026-24765?

Upgrade phpunit/phpunit to a fixed version for your release line: 8.5.52, 10.5.62, 11.5.50 or 12.5.8.

Upgrade, and only deserialise data from trusted sources or with an allow-list of types. More about Unsafe deserialization.

Is CVE-2026-24765 being exploited?

There is no known exploitation of CVE-2026-24765 in the wild and no public exploit code.

All Debian Debian Linux vulnerabilities

Sources

Also known as CLSA-2026-1771980787, CLSA-2026-1773276786, CLSA-2026-1776732788, CLSA-2026-1776818215, CLSA-2026-1776818222, CLSA-2026-1776818223 and 6 more.

Is CVE-2026-24765 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free