CVE-2026-24765 (GCVE-0-2026-24765)
Vulnerability from cvelistv5 – Published: 2026-01-27 21:35 – Updated: 2026-01-27 21:35
VLAI?
Title
PHPUnit Vulnerable to Unsafe Deserialization in PHPT Code Coverage Handling
Summary
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.
Severity ?
7.8 (High)
CWE
- CWE-502 - Deserialization of Untrusted Data
Assigner
References
| URL | Tags | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|||||||||||||||||||||||
Impacted products
| Vendor | Product | Version | ||
|---|---|---|---|---|
| sebastianbergmann | phpunit |
Affected:
< 8.5.52
Affected: >= 9.0.0, < 9.6.33 Affected: >= 10.0.0, < 10.5.62 Affected: >= 11.0.0, < 11.5.50 Affected: >= 12.0.0, < 12.5.8 |
{
"containers": {
"cna": {
"affected": [
{
"product": "phpunit",
"vendor": "sebastianbergmann",
"versions": [
{
"status": "affected",
"version": "\u003c 8.5.52"
},
{
"status": "affected",
"version": "\u003e= 9.0.0, \u003c 9.6.33"
},
{
"status": "affected",
"version": "\u003e= 10.0.0, \u003c 10.5.62"
},
{
"status": "affected",
"version": "\u003e= 11.0.0, \u003c 11.5.50"
},
{
"status": "affected",
"version": "\u003e= 12.0.0, \u003c 12.5.8"
}
]
}
],
"descriptions": [
{
"lang": "en",
"value": "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 `[\u0027allowed_classes\u0027 =\u003e 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."
}
],
"metrics": [
{
"cvssV3_1": {
"attackComplexity": "LOW",
"attackVector": "LOCAL",
"availabilityImpact": "HIGH",
"baseScore": 7.8,
"baseSeverity": "HIGH",
"confidentialityImpact": "HIGH",
"integrityImpact": "HIGH",
"privilegesRequired": "LOW",
"scope": "UNCHANGED",
"userInteraction": "NONE",
"vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"version": "3.1"
}
}
],
"problemTypes": [
{
"descriptions": [
{
"cweId": "CWE-502",
"description": "CWE-502: Deserialization of Untrusted Data",
"lang": "en",
"type": "CWE"
}
]
}
],
"providerMetadata": {
"dateUpdated": "2026-01-27T21:35:54.292Z",
"orgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
"shortName": "GitHub_M"
},
"references": [
{
"name": "https://github.com/sebastianbergmann/phpunit/security/advisories/GHSA-vvj3-c3rp-c85p",
"tags": [
"x_refsource_CONFIRM"
],
"url": "https://github.com/sebastianbergmann/phpunit/security/advisories/GHSA-vvj3-c3rp-c85p"
},
{
"name": "https://github.com/sebastianbergmann/phpunit/commit/3141742e00620e2968d3d2e732d320de76685fda",
"tags": [
"x_refsource_MISC"
],
"url": "https://github.com/sebastianbergmann/phpunit/commit/3141742e00620e2968d3d2e732d320de76685fda"
},
{
"name": "https://github.com/sebastianbergmann/phpunit/releases/tag/10.5.63",
"tags": [
"x_refsource_MISC"
],
"url": "https://github.com/sebastianbergmann/phpunit/releases/tag/10.5.63"
},
{
"name": "https://github.com/sebastianbergmann/phpunit/releases/tag/11.5.50",
"tags": [
"x_refsource_MISC"
],
"url": "https://github.com/sebastianbergmann/phpunit/releases/tag/11.5.50"
},
{
"name": "https://github.com/sebastianbergmann/phpunit/releases/tag/12.5.8",
"tags": [
"x_refsource_MISC"
],
"url": "https://github.com/sebastianbergmann/phpunit/releases/tag/12.5.8"
},
{
"name": "https://github.com/sebastianbergmann/phpunit/releases/tag/8.5.52",
"tags": [
"x_refsource_MISC"
],
"url": "https://github.com/sebastianbergmann/phpunit/releases/tag/8.5.52"
},
{
"name": "https://github.com/sebastianbergmann/phpunit/releases/tag/9.6.33",
"tags": [
"x_refsource_MISC"
],
"url": "https://github.com/sebastianbergmann/phpunit/releases/tag/9.6.33"
}
],
"source": {
"advisory": "GHSA-vvj3-c3rp-c85p",
"discovery": "UNKNOWN"
},
"title": "PHPUnit Vulnerable to Unsafe Deserialization in PHPT Code Coverage Handling"
}
},
"cveMetadata": {
"assignerOrgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
"assignerShortName": "GitHub_M",
"cveId": "CVE-2026-24765",
"datePublished": "2026-01-27T21:35:54.292Z",
"dateReserved": "2026-01-26T21:06:47.867Z",
"dateUpdated": "2026-01-27T21:35:54.292Z",
"state": "PUBLISHED"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.2",
"vulnerability-lookup:meta": {
"nvd": "{\"cve\":{\"id\":\"CVE-2026-24765\",\"sourceIdentifier\":\"security-advisories@github.com\",\"published\":\"2026-01-27T22:15:56.790\",\"lastModified\":\"2026-01-27T22:15:56.790\",\"vulnStatus\":\"Received\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"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 `[\u0027allowed_classes\u0027 =\u003e 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.\"}],\"metrics\":{\"cvssMetricV31\":[{\"source\":\"security-advisories@github.com\",\"type\":\"Secondary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H\",\"baseScore\":7.8,\"baseSeverity\":\"HIGH\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"LOW\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"HIGH\",\"integrityImpact\":\"HIGH\",\"availabilityImpact\":\"HIGH\"},\"exploitabilityScore\":1.8,\"impactScore\":5.9}]},\"weaknesses\":[{\"source\":\"security-advisories@github.com\",\"type\":\"Primary\",\"description\":[{\"lang\":\"en\",\"value\":\"CWE-502\"}]}],\"references\":[{\"url\":\"https://github.com/sebastianbergmann/phpunit/commit/3141742e00620e2968d3d2e732d320de76685fda\",\"source\":\"security-advisories@github.com\"},{\"url\":\"https://github.com/sebastianbergmann/phpunit/releases/tag/10.5.63\",\"source\":\"security-advisories@github.com\"},{\"url\":\"https://github.com/sebastianbergmann/phpunit/releases/tag/11.5.50\",\"source\":\"security-advisories@github.com\"},{\"url\":\"https://github.com/sebastianbergmann/phpunit/releases/tag/12.5.8\",\"source\":\"security-advisories@github.com\"},{\"url\":\"https://github.com/sebastianbergmann/phpunit/releases/tag/8.5.52\",\"source\":\"security-advisories@github.com\"},{\"url\":\"https://github.com/sebastianbergmann/phpunit/releases/tag/9.6.33\",\"source\":\"security-advisories@github.com\"},{\"url\":\"https://github.com/sebastianbergmann/phpunit/security/advisories/GHSA-vvj3-c3rp-c85p\",\"source\":\"security-advisories@github.com\"}]}}"
}
}
Loading…
Loading…
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Loading…
Loading…