Skip to main content
CVE-2026-24765VulnerabilityPublished Updated

CVE-2026-24765: sebastianbergmann phpunit · Deserialization of Untrusted Data

Affects sebastianbergmann phpunitSource CVE Database V5

0

Not known to be exploited · CVSS 7.8 High · fixed in 12.5.8 : patch sebastianbergmann phpunit soon.

Data as of 26 Oct 2026, 06:26 UTC

CVSS 3.1 base score
7.8High
How severe the flaw is on the 0–10 CVSS scale.
EPSS
0.3% chance of exploitation in 30 days – higher than 32% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
Patch
Available – fixed in 12.5.8, 11.5.50, 10.5.62 +2
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 27 Jan 2026

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponised: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 2026-10-26.

What to do

Upgrade to a fixed release listed under Affected software.

Affected software

ProductAffectedFixed in
sebastianbergmannphpunitAffected
  • <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
Fixed in
  • 12.5.8
  • 11.5.50
  • 10.5.62
  • 9.6.33
  • 8.5.52
Packagistsebastianbergmann/phpunitpkg:composer/sebastianbergmann/phpunitOther threatsAffected
  • <8.5.52
Fixed in
  • 8.5.52

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

1. Upgrade PHPUnit to the fixed versions 12.5.8, 11.5.50, 10.5.62, 9.6.33, or 8.5.52 or later to ensure the vulnerability is patched. 2. Enforce strict access controls on CI/CD runners and development environments to prevent unauthorized local file writes, including using ephemeral runners that are destroyed after each build. 3. Implement artifact isolation and scanning to detect anomalous or pre-existing .coverage files before test execution. 4. Use branch protection and code review policies to prevent injection of malicious code or dependencies that could write to coverage files. 5. Monitor CI/CD logs and PHPUnit error messages for indications of anomalous .coverage files or deserialization errors. 6. Restrict permissions on directories where PHPUnit stores coverage files to trusted users only. 7. Educate development teams about the risks of insecure deserialization and the importance of secure CI/CD pipeline configuration. 8. Consider additional runtime protections such as containerization or sandboxing of test environments to limit impact of potential code execution.

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.

References

Community reviews

Loading reviews…