Skip to content

🚨 [security] [php] Update phpunit/phpunit 11.5.24 → 11.5.55 (patch)#59

Open
depfu[bot] wants to merge 1 commit intomainfrom
depfu/update/composer/phpunit/phpunit-11.5.55
Open

🚨 [security] [php] Update phpunit/phpunit 11.5.24 → 11.5.55 (patch)#59
depfu[bot] wants to merge 1 commit intomainfrom
depfu/update/composer/phpunit/phpunit-11.5.55

Conversation

@depfu
Copy link

@depfu depfu bot commented Feb 19, 2026


Welcome to Depfu 👋

This is one of the first three pull requests with dependency updates we've sent your way. We tried to start with a few easy patch-level updates. Hopefully your tests will pass and you can merge this pull request without too much risk. This should give you an idea how Depfu works in general.

After you merge your first pull request, we'll send you a few more. We'll never open more than seven PRs at the same time so you're not getting overwhelmed with updates.

Let us know if you have any questions. Thanks so much for giving Depfu a try!



🚨 Your current dependencies have known security vulnerabilities 🚨

This dependency update fixes known security vulnerabilities. Please see the details below and assess their impact carefully. We recommend to merge and deploy this as soon as possible!


Here is everything you need to know about this update. Please take a good look at what changed and the test results before merging this pull request.

What changed?

✳️ phpunit/phpunit (11.5.24 → 11.5.55) · Repo

Security Advisories 🚨

🚨 PHPUnit Vulnerable to Unsafe Deserialization in PHPT Code Coverage Handling

Overview

A vulnerability has been discovered 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.

Technical Details

Affected Component: PHPT test runner, method cleanupForCoverage()
Affected Versions: <= 8.5.51, <= 9.6.32, <= 10.5.61, <= 11.5.49, <= 12.5.7

Vulnerable Code Pattern

if ($buffer !== false) {
    // Unsafe call without restrictions
    $coverage = @unserialize($buffer);
}

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.

Attack Prerequisites and Constraints

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

Critical Context: Running test suites from unreviewed pull requests without isolated execution is inherently a code execution risk, independent of this specific vulnerability. This represents a broader class of Poisoned Pipeline Execution (PPE) attacks affecting CI/CD systems.

Proposed Remediation Approach

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.

Rationale for Error-Based Approach:

  1. Visibility Over Silence: When an invariant is violated (a .coverage file existing before test execution), the error must be visible in CI/CD output, alerting operators to investigate the root cause rather than proceeding with sanitized input
  2. Operational Security: A .coverage file should never exist before tests run, coverage data is generated by executing tests, not sourced from artifacts. Its presence indicates:
    • A malicious actor placed it intentionally
    • Build artifacts from a previous run contaminated the environment
    • An unexpected filesystem state requiring investigation
  3. Defense-in-Depth Principle: Protecting a single deserialization call does not address the fundamental attack surface. Proper mitigations for PPE attacks lie outside PHPUnit's scope:
    • Isolate CI/CD runners (ephemeral, containerized environments)
    • Restrict code execution on protected branches
    • Scan pull requests and artifacts for tampering
    • Use branch protection rules to prevent unreviewed code execution

Severity Classification

  • Attack Vector (AV): Local (L) — requires write access to the file system where tests execute
  • Attack Complexity (AC): Low (L) — exploitation is straightforward once the malicious file is placed
  • Privileges Required (PR): Low (L) — PR submitter status or contributor role provides sufficient access
  • User Interaction (UI): None (N) — automatic execution during standard test execution
  • Scope (S): Unchanged (U) — impact remains within the affected test execution context
  • Confidentiality Impact (C): High (H) — full remote code execution enables complete system compromise
  • Integrity Impact (I): High (H) — arbitrary code execution allows malicious modifications
  • Availability Impact (A): High (H) — full code execution permits denial-of-service actions

Mitigating Factors (Environmental Context)

Organizations can reduce the effective risk of this vulnerability through proper CI/CD configuration:

  • Ephemeral Runners: Use containerized, single-use CI/CD runners that discard filesystem state between runs
  • Code Review Enforcement: Require human review and approval before executing code from pull requests
  • Branch Protection: Enforce branch protection rules that block unreviewed code execution
  • Artifact Isolation: Separate build artifacts from source; never reuse artifacts across independent builds
  • Access Control: Limit file write permissions in CI environments to authenticated, trusted actors

Fixed Behaviour

When a .coverage file is detected for a PHPT test prior to execution, PHPUnit will emit a clear error message identifying the anomalous state. This ensures:

  • Visibility: The error appears prominently in CI/CD output and test logs
  • Investigation: Operations teams can investigate the root cause (potential tampering, environment contamination)
  • Fail-Fast Semantics: Test execution stops rather than proceeding with an unexpected state

Recommendation

Update to the patched version immediately if a project runs PHPT tests using PHPUnit with coverage instrumentation in any CI/CD environment that executes code from external contributors. Additionally, audit the project's CI/CD configuration to ensure:

  • Pull requests from forks or untrusted sources execute in isolated environments
  • Branch protection rules require human review before code execution
  • CI/CD runners are ephemeral and discarded after each build
  • Build artifacts are not reused across independent runs without validation
Release Notes

Too many releases to show here. View the full release notes.

Commits

See the full diff on Github. The new version differs by 2 commits:

↗️ myclabs/deep-copy (indirect, 1.13.1 → 1.13.4) · Repo

Release Notes

1.13.4

What's Changed

  • Do not call Reflection*::setAccessible() in PHP >= 8.1 by @W0rma in #207

New Contributors

Full Changelog: 1.13.3...1.13.4

1.13.3

What's Changed

Full Changelog: 1.13.2...1.13.3

1.13.2

What's Changed

  • Add generic to DeepCopy::copy method by @ruudk in #205

New Contributors

Full Changelog: 1.13.1...1.13.2

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 6 commits:

↗️ nikic/php-parser (indirect, 5.6.1 → 5.7.0) · Repo · Changelog

Release Notes

5.7.0

Fixed

  • Fixed changing modifier on anonymous class with formatting preserving pretty printer.
  • Emit an error for unparenthesized arrow functions in pipe operator, and print necessary parentheses in the pretty printer.
  • Fix PHP 8.5 deprecation warning in php-parse binary.

Changed

  • When targeting PHP 8.4 or newer, omit parentheses around immediately dereferenced new expressions.

Added

  • Added shouldPrintRawValue attribute to Scalar\Int_, which makes the pretty printer use the rawValue of the node. This can be used to print integers with separators.

5.6.2

Fixed

  • Fixed formatting-preserving pretty-printing when changing the visibility modifier on a node that has attributes.
  • Fixed chr() deprecation warning on PHP 8.4

Added

  • Added Param::isFinal() method.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 15 commits:

↗️ phpunit/php-code-coverage (indirect, 11.0.10 → 11.0.12) · Repo · Changelog

Release Notes

11.0.12

Fixed

  • #1092: Error in DOMDocument::saveXML() is not handled
  • #1131: Invalid XML generated when both PCOV and Xdebug are loaded

11.0.11

Changed

  • #1085: Improve performance by skipping empty lines after filter has been applied

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 33 commits:

↗️ phpunit/php-file-iterator (indirect, 5.1.0 → 5.1.1) · Repo · Changelog

Commits

See the full diff on Github. The new version differs by 28 commits:

↗️ sebastian/comparator (indirect, 6.3.1 → 6.3.3) · Repo · Changelog

Release Notes

6.3.3

Changed

  • #134: Suppress warning introduced in PHP 8.5

6.3.2

Changed

  • Do not use SplObjectStorage methods that will be deprecated in PHP 8.5

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 28 commits:

↗️ sebastian/exporter (indirect, 6.3.0 → 6.3.2) · Repo · Changelog

Release Notes

6.3.2

Changed

  • Suppress unexpected NAN value was coerced to string warning triggered on PHP 8.5

6.3.1

Changed

  • Suppress not representable as an int, cast occurred warning triggered on PHP 8.5

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 31 commits:

↗️ sebastian/recursion-context (indirect, 6.0.2 → 6.0.3) · Repo · Changelog

Release Notes

6.0.3

Changed

  • Do not use SplObjectStorage methods that will be deprecated in PHP 8.5

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 21 commits:

↗️ sebastian/type (indirect, 5.1.2 → 5.1.3) · Repo · Changelog

Release Notes

5.1.3

Fixed

  • #34: infection.json is missing from .gitattributes

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 5 commits:

↗️ theseer/tokenizer (indirect, 1.2.3 → 1.3.1) · Repo · Changelog

Release Notes

1.3.1

  • Fix #37: v1.3.0 introduced a breaking change on the token collection (ArrayAccess interface removed)

1.3.0

  • Require at least PHP 7.3 for building, code should still be PHP 7.2 compliant
  • Merge various performance improvements provided by @staabm
  • Merge some code cleanups provided by @staabm

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 26 commits:


Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu cancel merge
Cancels automatic merging of this PR
@​depfu close
Closes this PR and deletes the branch
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants