🔍 CVE-2026-24765

7.8
CVSS Score
HIGH
2026-01-27
2026-01-27 22:15
✅ 완료

🇰🇷 한글 설명

PHPUnit은 PHP를 위한 테스트 프레임워크입니다. 12.5.8, 11.5.50, 10.5.62, 9.6.33, 8.5.52 이전 버전에서 코드 커버리지 데이터의 불안전한 역직렬화 취약성이 발견되었습니다. 이 취약성은 `cleanupForCoverage()` 메서드에서 유효성 검증 없이 코드 커버리지 파일을 역직렬화하여 원격 코드 실행을 허용할 수 있습니다.

💡 쉬운 설명

PHPUnit의 이전 버전은 코드 커버리지 데이터를 안전하지 않게 처리하여 원격 코드 실행 취약성이 있습니다. 공격자는 이 취약성을 이용하여任意 코드를 실행할 수 있습니다. 이 취약성은 PHPUnit 12.5.8, 11.5.50, 10.5.62, 9.6.33, 8.5.52 버전에서 해결되었습니다.

🇺🇸 원문 (English)

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.

📍 영향받는 시스템

PHPUnit 12.5.8, 11.5.50, 10.5.62, 9.6.33, 8.5.52 이전 버전

⚔️ 공격 벡터

로컬 파일 쓰기 접근을 통해 공격자가 `.coverage` 파일을 생성하고, PHPUnit이 이를 역직렬화하여 원격 코드 실행을 허용

🛡️ 대응 방법

PHPUnit을 12.5.8, 11.5.50, 10.5.62, 9.6.33, 8.5.52 버전 이상으로 업데이트하고, CI/CD 파이프라인을 안전하게 구성하여 취약성을 완화

🔧 검증 코드

로컬 시스템에서 composer를 사용하여 PHPUnit 버전을 확인합니다. verification_code를 실행하기 전에 composer를 설치해야 합니다. 결과는 JSON 형식으로 출력됩니다.

Shell / Script
import subprocess
result = subprocess.run(['composer', 'show', 'phpunit/phpunit'], capture_output=True, text=True)
if 'version' in result.stdout and ('12.5.8' in result.stdout or '11.5.50' in result.stdout or '10.5.62' in result.stdout or '9.6.33' in result.stdout or '8.5.52' in result.stdout):
    print('{"result": "양호", "reason": "PHPUnit 버전이 최신입니다."}')
else:
    print('{"result": "취약", "reason": "PHPUnit 버전이 구버전입니다."}')

📊 CVSS Vector String

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

💻 영향받는 소프트웨어

PHP