CVE-2026-24765

PHPUnit Vulnerable to Unsafe Deserialization in PHPT Code Coverage Handling

7.8 high EPSS 0.38%

Published 27 Jan 2026 Updated 6 Feb 2026 CNA: GitHub_M

Check your servers for CVE-2026-24765

The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2026-24765 affects phpunit, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.

Check my servers

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.

Severity (CVSS)

7.8 high CVSS 3.1 from GitHub_M (CNA)
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Attack vector
local: the attacker needs local access, or a user has to open a prepared file
Attack complexity
low: an attack works without special conditions
Privileges required
low: the attacker needs an ordinary user account
User interaction
none: nobody has to click or open anything
Scope
unchanged: the damage stays inside the vulnerable component
Impact
confidentiality high, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)

Exploitation

EPSS 0.38%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 34.6% of all scored CVEs. Scores of 1 Dec 2026.

The assessment of CISA (SSVC, 28 Jan 2026):

Exploitation
none: CISA did not find evidence of exploitation or a public proof of concept
Automatable
no: each attack takes manual steps
Technical impact
total: full control of the component or of its data

Weakness

  • CWE-502 Deserialization of Untrusted Data

Affected products

As the CNA lists them.

ProductVersions
phpunit
affected < 8.5.52
affected >= 9.0.0, < 9.6.33
affected >= 10.0.0, < 10.5.62
affected >= 11.0.0, < 11.5.50
affected >= 12.0.0, < 12.5.8

Is my server affected?

Find the installed version of phpunit and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.

Debian, Ubuntu

dpkg -l | grep -i phpunit
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2026-24765 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2026-24765

RHEL, Rocky, Alma, Fedora

rpm -q phpunit
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2026-24765

Alpine

apk list --installed | grep -i phpunit

With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:

trivy rootfs --scanners vuln / | grep CVE-2026-24765
trivy image --scanners vuln IMAGE | grep CVE-2026-24765

Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.

References

Advisories

Other references

Source: the record CVE-2026-24765 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.