LiveActive security incident?Get immediate response
CVE Record

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

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.

HighCVSS 7.8Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

PHPUnit can execute malicious code during certain test runs if an attacker can plant a crafted coverage file beforehand. This is mainly a CI/CD, developer workstation, or dependency-compromise risk, not a typical internet-facing service bug. The business priority is protecting build pipelines and upgrading PHPUnit in affected projects.

Executive priority

Treat as high priority for engineering and DevSecOps teams using PHPUnit. Focus on CI/CD hardening and dependency trust because successful exploitation can compromise build runners, secrets, and release integrity. Internet perimeter teams are less likely to be directly affected unless test tooling is exposed improperly.

Technical view

CVE-2026-24765 is unsafe deserialization in PHPUnit PHPT code coverage handling. The cleanupForCoverage() path deserializes pre-existing .coverage files without class restrictions. With local file write access to the expected coverage location, a malicious serialized object can run code during PHPT tests with coverage instrumentation enabled. CWE-502; CVSS 7.8.

Likely exposure

Exposure is most likely where affected PHPUnit versions run PHPT tests with code coverage in CI, local development, or package build environments. Attackers need local file write access to the relevant coverage-file location, such as through compromised dependencies, weak pipeline isolation, or malicious repository changes.

Exploitation context

The source bundle does not show CISA KEV listing or confirmed active exploitation. Exploitation requires a pre-positioned malicious .coverage file before PHPT execution. This makes the issue more constrained than remote unauthenticated RCE, but serious in trusted build environments.

Researcher notes

The vulnerable condition is anomalous pre-existing .coverage files for PHPT tests. The fix makes that state an explicit error rather than silently deserializing. The source bundle has a minor version-reference inconsistency around the 10.5.x release, so confirm exact fixed package versions against vendor and distro advisories.

Mitigation direction

  • Upgrade PHPUnit to the vendor-advised fixed release for your supported branch.
  • Use 8.5.52, 9.6.33, 10.5.62 or later, 11.5.50, or 12.5.8.
  • Review vendor advisories for exact branch guidance and packaging updates.
  • Use ephemeral CI runners and isolate build artifacts between jobs.
  • Restrict write access to test workspaces and coverage-file locations.
  • Enforce code review, branch protection, and dependency integrity controls.

Validation and detection

  • Inventory repositories and build images for PHPUnit versions in affected ranges.
  • Identify CI jobs running PHPT tests with code coverage enabled.
  • Check whether build workspaces persist files across jobs or pull requests.
  • Confirm upgraded PHPUnit behavior errors on pre-existing PHPT .coverage files.
  • Review Debian LTS guidance if using Debian-packaged PHPUnit.
Prepared
Confidence
high
Sources
10

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · medium confidence lookup

CWE-502: Code execution behavior lookup

Code execution and unsafe deserialization weaknesses often justify reviewing execution behavior and process telemetry. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
description · low confidence lookup

Execution behavior lookup

The CVE wording references code or command execution, so execution technique review may help defensive triage. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2026-24765 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
High
CVSS
7.8 (3.1)
Known Exploited
No
Published

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

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
0Timeline events
0ADP providers
9Source links

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
7.8CVSS 3.1HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H1.85.9Primary CVE score

Vulnerability scoring details

Base CVSS 3.1 score

7.8High
CVSS 3.1 vector shape for CVE-2026-24765Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

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

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone
Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
sebastianbergmannphpunit< 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.8Listed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-502 · source CWE mapping

Deserialization of Untrusted Data

Deserialization of Untrusted Data represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.