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

Machine-generated threat intelligence

AILast updated: 02/11/2026, 11:30:41 UTC

Technical Analysis

CVE-2026-24765 is a deserialization vulnerability classified under CWE-502 affecting multiple versions of the PHPUnit PHP testing framework prior to versions 12.5.8, 11.5.50, 10.5.62, 9.6.33, and 8.5.52. The vulnerability exists in the cleanupForCoverage() method, which deserializes code coverage files (.coverage) during PHPT test execution without validating the serialized data or restricting allowed classes. Normally, .coverage files should not exist before test execution; however, if an attacker can place a malicious serialized object containing a __wakeup() method in such a file, PHPUnit will deserialize it, triggering arbitrary code execution. Exploitation requires local file write access to the directory where PHPUnit stores or expects these coverage files, which can be achieved via compromised CI/CD pipelines, local development environments, or malicious dependencies. Instead of silently sanitizing input, the maintainers chose to treat pre-existing .coverage files as an error condition in patched versions, alerting users to the anomaly. This vulnerability can lead to full compromise of the testing environment and potentially the underlying system if the test environment has elevated privileges. The vulnerability has a CVSS 3.1 base score of 7.8, indicating high severity, with attack vector local, low attack complexity, low privileges required, no user interaction, and high impact on confidentiality, integrity, and availability. No known exploits are currently reported in the wild, but the risk is significant in environments with lax CI/CD security or shared development infrastructure.

Potential Impact

For European organizations, this vulnerability poses a significant risk primarily in development and CI/CD environments where PHPUnit is used for PHP application testing. Successful exploitation could lead to arbitrary code execution, allowing attackers to execute malicious payloads, potentially compromising build servers, injecting backdoors into software artifacts, or pivoting to other parts of the network. This can disrupt software development lifecycles, cause supply chain contamination, and lead to data breaches or service outages. Organizations relying heavily on PHP and PHPUnit, especially those with automated testing pipelines that do not isolate runners or enforce strict access controls, are at heightened risk. The impact extends beyond development environments if compromised artifacts are deployed to production. Given the widespread use of PHP in European web applications and the increasing adoption of CI/CD pipelines, the vulnerability could affect a broad range of sectors including finance, government, and technology. The lack of required user interaction and the ability to exploit with low privileges but local file write access increases the risk in multi-tenant or shared infrastructure environments.

Mitigation Recommendations

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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/11/2026, 11:30:41 AM

Last updated: 3/26/2026, 7:53:45 AM

Views: 775

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 for AI refresh and higher limits.

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

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses