Skip to main content

Phpunit CVE-2026-24765

HIGH
Deserialization of Untrusted Data (CWE-502)
2026-01-27 security-advisories@github.com GHSA-vvj3-c3rp-c85p
7.8
CVSS 3.1 · GitHub Advisory
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Place malicious .coverage file in test directory
  2. Exploit
    Execute PHPT test suite
  3. Execution
    cleanupForCoverage() deserializes file
  4. Impact
    Arbitrary code execution with user privileges

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A08:2025 - Software or Data Integrity Failures
ASVS 5.0
V1 - Encoding and Sanitization Safe deserialization, type allowlists
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Initial Access

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Local file write access to PHPUnit test directory; PHPT test execution initiated by authenticated user; vulnerable PHPUnit versions (prior to 12.5.8, 11.5.50, 10.5.62, 9.6.33, or 8.5.52); malicious .coverage file present before test execution

Impact

CVSS 7.8 (HIGH). Attack vector: Local. Complexity: Low. Privileges required: Low. User interaction: None. Exploitable via remote/network.

Exploit ScenarioDerived

A remote attacker could exploit this flaw, arbitrary code execution during test runs with code coverage.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Mar 12, 2026

Unsafe deserialization in PHPUnit versions before 8.5.52, 9.6.33, 10.5.62, 11.5.50, and 12.5.8 allows local attackers to execute arbitrary code by placing malicious serialized objects in .coverage files that are deserialized without validation during PHPT test execution. An attacker with file write access can exploit the cleanupForCoverage() method's lack of object class restrictions to trigger gadget chains through __wakeup() methods. This high-severity vulnerability (CVSS 7.8) affects developers and CI/CD systems running PHPUnit on Linux systems.

Earlier versions of this analysis (1)
v1 Mar 12, 2026 - 21:55 CVSS 7.8

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. [CVSS 7.8 HIGH]

RemediationAI

A vendor patch is available — apply it immediately.

Affected Packages

composer phpunit/phpunit fix: 8.5.52, 9.6.33, 10.5.62, 11.5.50, 12.5.8

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in composer

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Classified as CWE-502 (Deserialization of Untrusted Data). Affects Phpunit. 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

Know when Phpunit gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

GitHub Advisory PRIMARY 7.8 HIGH
AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
SUSE HIGH
Red Hat 7.8 HIGH

Primary rating from GitHub Advisory.

CVSS VectorGitHub Advisory

Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

2
Patch released
Mar 03, 2026 - 15:25 nvd
Patch available
CVE Published
Jan 27, 2026 - 22:15 nvd
HIGH 7.8

DescriptionGitHub Advisory

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.

Executive ViewAI

Why It Matters

PHPUnit versions before specified patch levels contain a deserialization vulnerability that could allow attackers to execute arbitrary code on systems running affected versions. Organizations using PHPUnit in development, testing, or CI/CD pipelines should prioritize patching to prevent potential compromise of build environments and source code repositories.

Business Impact: High
Compensating Controls

Apply vendor patch. If immediate patching is not feasible: restrict PHPUnit execution to isolated, sandboxed environments; disable code coverage reporting features if not essential; implement network segmentation to limit lateral movement from compromised build systems; enforce strict access controls on test infrastructure and artifact repositories.

Threat Intelligence Overview

EPSS Score
0.1%
Top 76% exploitable
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
Data Quality
4 sources
Confidence: Medium
NVD CVE.org EPSS GHSA Vendor GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC Yes
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
Poc
System Exposure· derived
Small
Automatable· derived
No
Human Impact
High

Priority Score

59
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +39
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Insecure deserialization occurs when an application converts serialized data (a stream of bytes representing an object's state) back into a living object without proper validation.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

Affected Products (CPE)GitHub Advisory

cpe:2.3:a:phpunit_project:phpunit:*:*:*:*:*:-:*:*
cpe:2.3:a:phpunit_project:phpunit:*:*:*:*:*:-:*:*
cpe:2.3:a:phpunit_project:phpunit:*:*:*:*:*:-:*:*
cpe:2.3:a:phpunit_project:phpunit:*:*:*:*:*:-:*:*
cpe:2.3:a:phpunit_project:phpunit:*:*:*:*:*:-:*:*
cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*

Vendor StatusVendor

SUSE

Severity: High

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy