CVE-2026-24765:PHPUnit 不安全反序列化漏洞威胁 CI/CD 流水线安全
好的,我现在需要帮用户总结一篇关于PHPUnit安全更新的文章,控制在100字以内。首先,我得仔细阅读文章内容,抓住关键点。 文章提到PHPUnit发布了关键安全更新,修复了一个高危漏洞CVE-2026-24765,CVSS评分7.8。这个漏洞允许攻击者通过操纵代码覆盖率文件实现远程代码执行(RCE)。问题出在PHPT测试运行器的cleanupForCoverage()方法中,该方法在处理代码覆盖率数据时存在反序列化漏洞。 漏洞利用需要攻击者能够写入恶意的.coverage文件到PHPUnit预期的位置。常见场景包括CI/CD管道攻击、本地开发环境或依赖供应链攻击。受影响的版本包括多个主要版本,建议升级到指定的补丁版本。 此外,文章还提到除了打补丁外,还需要加强CI/CD环境的安全配置,比如隔离运行器、限制执行和扫描构建 artifacts。 现在我要把这些信息浓缩到100字以内。首先说明PHPUnit修复了高危漏洞,导致RCE。然后指出问题所在的方法和利用条件。最后提到受影响版本和建议措施。 确保语言简洁明了,不使用“这篇文章”等开头词。 </think> PHPUnit修复了高危漏洞CVE-2026-24765(CVSS 7.8),该漏洞通过操纵代码覆盖率文件实现远程代码执行。问题出在PHPT测试运行器的cleanupForCoverage()方法中,因反序列化未验证数据导致。攻击者需写入恶意.coverage文件至预期位置。建议升级到指定补丁版本,并加强CI/CD安全配置以防御此类攻击。 2026-1-29 02:48:35 Author: securityonline.info(查看原文) 阅读量:3 收藏

PHPUnit Vulnerability CVE-2026-24765

The maintainers of PHPUnit, the industry-standard testing framework for PHP, have released a critical security update to address a high-severity vulnerability that turns the testing process itself into an attack vector. Tracked as CVE-2026-24765, the flaw carries a CVSS score of 7.8 and allows attackers to achieve Remote Code Execution (RCE) by manipulating code coverage artifacts.

The vulnerability strikes at the heart of automated testing environments, exploiting how PHPUnit cleans up after running tests.

The issue lies within the PHPT test runner, specifically in a method ironically named cleanupForCoverage(). This function is responsible for handling code coverage data generated during test execution.

According to the security advisory, the method “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 technical root cause is a classic Unsafe Deserialization (CWE-502) flaw. The code attempts to process a buffer using @unserialize($buffer) without checking if the data is safe. If an attacker can plant a malicious serialized object—specifically one with a __wakeup() method—into a .coverage file on the system, PHPUnit will blindly execute it during the cleanup phase.

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: A malicious pull request that places a .coverage file alongside test files, executed when the CI system runs tests using PHPUnit and collects code coverage information
  • Local Development Environment: An attacker with shell access or ability to write files to the project directory
  • Compromised Dependencies: A supply chain attack inserting malicious files into a package or monorepo

The vulnerability affects a wide range of PHPUnit versions, spanning several major releases. Users are vulnerable if they are running:

  • PHPUnit 8: Version 8.5.51 and below
  • PHPUnit 9: Version 9.6.32 and below
  • PHPUnit 10: Version 10.5.61 and below
  • PHPUnit 11: Version 11.5.49 and below
  • PHPUnit 12: Version 12.5.7 and below

The maintainers have released patched versions (8.5.52, 9.6.33, 10.5.62, 11.5.50, and 12.5.8) and urge users to update immediately.

However, the advisory also stresses that software patches are only part of the solution. The root problem often lies in how CI/CD environments are configured. “Protecting a single deserialization call does not address the fundamental attack surface,” the report warns.

To truly secure the pipeline, organizations must adopt Defense-in-Depth principles:

  • Isolate Runners: Ensure CI/CD runners are ephemeral (discarded after each run) to prevent cross-contamination.
  • Restrict Execution: Use branch protection rules to prevent unreviewed code from triggering tests.
  • Scan Artifacts: Monitoring for tampering in pull requests and build artifacts is essential.

Related Posts:


文章来源: https://securityonline.info/cve-2026-24765-phpunit-vulnerability-exposes-ci-cd-pipelines-to-rce/
如有侵权请联系:admin#unsafe.sh