Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-24765: CWE-502: Deserialization of Untrusted Data in sebastianbergmann phpunit

0
High
VulnerabilityCVE-2026-24765cvecve-2026-24765cwe-502
Published: Tue Jan 27 2026 (01/27/2026, 21:35:54 UTC)
Source: CVE Database V5
Vendor/Project: sebastianbergmann
Product: phpunit

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.

AI-Powered Analysis

AILast updated: 02/04/2026, 09:14:52 UTC

Technical Analysis

CVE-2026-24765 is a vulnerability classified under CWE-502 (Deserialization of Untrusted Data) affecting the PHPUnit testing framework for PHP. The flaw exists in the `cleanupForCoverage()` method, which deserializes code coverage files (.coverage) without validating or restricting the classes allowed during deserialization. Normally, .coverage files should not exist before PHPT test execution; however, if an attacker can place a malicious serialized object file with a crafted `__wakeup()` method in the expected location, PHPUnit will deserialize it during test runs with code coverage enabled. This leads to arbitrary code execution within the context of the test runner. Exploitation requires local file write access, which can be achieved through compromised CI/CD pipelines, local developer environments, or malicious dependencies. Instead of silently sanitizing input, the maintainers have updated PHPUnit in versions 12.5.8, 11.5.50, 10.5.62, and 9.6.33 to treat the presence of pre-existing .coverage files as an explicit error, preventing silent exploitation. The vulnerability affects multiple major PHPUnit versions prior to the specified patched releases. Although no known exploits are reported in the wild, the risk is significant due to the potential for remote code execution and the common use of PHPUnit in development and CI/CD workflows.

Potential Impact

For European organizations, this vulnerability poses a significant risk primarily in development, testing, and CI/CD environments where PHPUnit is used. Successful exploitation can lead to arbitrary code execution, potentially allowing attackers to compromise build servers, inject malicious code into software artifacts, or pivot into internal networks. This can result in intellectual property theft, supply chain attacks, and disruption of software delivery pipelines. Organizations relying heavily on automated testing and continuous integration with PHPUnit are particularly vulnerable. The impact extends beyond confidentiality to integrity and availability, as attackers may alter codebases or disrupt development workflows. Given the widespread use of PHP and PHPUnit in European software development, especially in countries with strong IT sectors, the threat could affect a broad range of industries including finance, manufacturing, and government services. The requirement for local file write access limits remote exploitation but does not eliminate risk, as CI/CD environments often run code from multiple sources and may be targeted via compromised dependencies or insider threats.

Mitigation Recommendations

1. Upgrade PHPUnit to the fixed versions: 12.5.8, 11.5.50, 10.5.62, 9.6.33, or later. 2. Enforce strict access controls on CI/CD runners and build environments to prevent unauthorized file writes, especially to directories used for code coverage files. 3. Use ephemeral CI/CD runners that are destroyed after each build to avoid persistent malicious files. 4. Implement branch protection and code review policies to reduce risk of malicious code or dependencies entering the pipeline. 5. Isolate build artifacts and restrict artifact sharing to trusted sources only. 6. Monitor for unexpected .coverage files prior to test execution and configure alerting on anomalous file presence. 7. Regularly audit and harden developer workstations and build servers to prevent local compromise. 8. Consider disabling code coverage instrumentation in environments where it is not strictly necessary. 9. Educate development teams about the risks of deserialization vulnerabilities and secure coding/testing practices. 10. Integrate security scanning tools to detect vulnerable PHPUnit versions and unsafe deserialization patterns in code.

Need more detailed analysis?Upgrade to Pro Console

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-01-26T21:06:47.867Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 697933434623b1157c49959a

Added to database: 1/27/2026, 9:50:59 PM

Last enriched: 2/4/2026, 9:14:52 AM

Last updated: 2/7/2026, 12:37:20 AM

Views: 325

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats