Advisory Database
  • Advisories
  • Dependency Scanning
  1. composer
  2. ›
  3. phpunit/phpunit
  4. ›
  5. CVE-2026-24765

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

January 27, 2026 (updated February 6, 2026)

Overview

A vulnerability has been discovered 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.

Technical Details

Affected Component: PHPT test runner, method cleanupForCoverage() Affected Versions: <= 8.5.51, <= 9.6.32, <= 10.5.61, <= 11.5.49, <= 12.5.7

Vulnerable Code Pattern

if ($buffer !== false) {
    // Unsafe call without restrictions
    $coverage = @unserialize($buffer);
}

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.

Attack Prerequisites and Constraints

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: A malicious pull request that places a .coverage file alongside test files, executed when the CI system runs tests using PHPUnit and collects code coverage information
  • Local Development Environment: An attacker with shell access or ability to write files to the project directory
  • Compromised Dependencies: A supply chain attack inserting malicious files into a package or monorepo

References

  • github.com/advisories/GHSA-vvj3-c3rp-c85p
  • github.com/sebastianbergmann/phpunit
  • github.com/sebastianbergmann/phpunit/commit/3141742e00620e2968d3d2e732d320de76685fda
  • github.com/sebastianbergmann/phpunit/commit/613d142f5a8471ca71623ce5ca2795f79248329e
  • github.com/sebastianbergmann/phpunit/releases/tag/10.5.63
  • github.com/sebastianbergmann/phpunit/releases/tag/11.5.50
  • github.com/sebastianbergmann/phpunit/releases/tag/12.5.8
  • github.com/sebastianbergmann/phpunit/releases/tag/8.5.52
  • github.com/sebastianbergmann/phpunit/releases/tag/9.6.33
  • github.com/sebastianbergmann/phpunit/security/advisories/GHSA-vvj3-c3rp-c85p
  • lists.debian.org/debian-lts-announce/2026/02/msg00009.html
  • nvd.nist.gov/vuln/detail/CVE-2026-24765
  • owasp.org/www-project-top-10-ci-cd-security-risks/CICD-SEC-04-Poisoned-Pipeline-Execution

Code Behaviors & Features

Detect and mitigate CVE-2026-24765 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 8.5.52, all versions starting from 9.0.0 before 9.6.33, all versions starting from 10.0.0 before 10.5.62, all versions starting from 11.0.0 before 11.5.50, all versions starting from 12.0.0 before 12.5.8

Fixed versions

  • 8.5.52
  • 9.6.33
  • 10.5.62
  • 11.5.50
  • 12.5.8

Solution

Upgrade to versions 10.5.62, 11.5.50, 12.5.8, 8.5.52, 9.6.33 or above.

Impact 7.8 HIGH

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-502: Deserialization of Untrusted Data

Source file

packagist/phpunit/phpunit/CVE-2026-24765.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Thu, 19 Feb 2026 00:19:05 +0000.