Skip to content

Bump PHPUnit to ^8.5.52 (GHSA-vvj3-c3rp-c85p) - #46

Merged
aflanagan merged 2 commits into
masterfrom
agent/phpunit-8-5-52-38eb
Oct 27, 2026
Merged

aflanagan merged 2 commits into
masterfrom
agent/phpunit-8-5-52-38eb

Conversation

@aflanagan

@aflanagan aflanagan commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes Dependabot alert #1, GHSA-vvj3-c3rp-c85p (CVE-2026-24765, Packagist advisory PKSA-z3gr-8qht-p93v): unsafe deserialization of PHPT code-coverage files in PHPUnit. The patched floor on the 8.5 line is 8.5.52.

require-dev now requires phpunit/phpunit: ^8.5.52 instead of ^6.0. The runtime constraint stays php: >=5.6, and the public SDK API is unchanged. composer.lock remains untracked because .gitignore excludes it; CI continues to resolve dependencies from composer.json.

CI restoration

Master Test (test.yml) has been red since 2026-09-26. Composer refuses to install every PHPUnit 6 release under PKSA-z3gr-8qht-p93v, and codeception/aspect-mock 3.1 also requires phpunit/phpunit > 6.0.0, so composer install failed before the suite ran.

^8.5.52 is inside aspect-mock 3.1's PHPUnit constraint and outside that advisory range. The current resolution is PHPUnit 8.5.56. CI stays on PHP 7.2, which PHPUnit 8.5 supports (php: >=7.2). The install step no longer passes Composer's deprecated --no-suggest flag, which Composer 3 will reject.

Tests

Locally, on PHP 7.2.34 (the CI version):

  • composer validate --strict passed
  • composer install installed PHPUnit 8.5.56, codeception/aspect-mock 3.1.1, and goaop/framework 2.3.5, and Composer reported no security advisories
  • composer run-script test: OK (23 tests, 36 assertions)

AspectMock 3.1.1 with Go! AOP 2.x ran under PHPUnit 8 without test-side edits. Existing setUp(): void / tearDown(): void signatures and assertions already match PHPUnit 8. src/ was not modified.

Open in Web Open in Cursor 

Composer blocks every PHPUnit 6 release under PKSA-z3gr-8qht-p93v, which has failed master CI since 2026-09-26. 8.5.52 is the first patched 8.5 release and stays inside aspect-mock 3.1's PHPUnit constraint.

Co-authored-by: August Flanagan <aflanagan@users.noreply.github.com>
@cursor

cursor Bot commented Oct 27, 2026

Copy link
Copy Markdown

Opus 5.5 High — review of head 79529cc23103ec78fd7747caf21a51f4b2428d08

Verdict: APPROVE. There are no blocking findings. (This is posted as a comment because this environment can't submit a formal approving review.)

The change is one line, require-dev phpunit/phpunit ^6.0 → ^8.5.52. I reproduced the CI steps locally on PHP 7.2.34 with Composer 2.10.3.

1. Advisory cleared (non-blocking, verified)

  • GHSA-vvj3-c3rp-c85p / CVE-2026-24765 (Packagist PKSA-z3gr-8qht-p93v) affects >=0,<8.5.52 | >=9.0.0,<9.6.33 | .... The lowest version ^8.5.52 allows is the first patched 8.5 release, so no version allowed by the new constraint is affected.
  • Composer resolves this to phpunit 8.5.56. composer audit reports "No security vulnerability advisories found".
  • No other Packagist advisory for phpunit/phpunit touches 8.5.x. The others cover 12.5.21, 13.1.5, 13.4.0–13.4.3 and CVE-2017-9841 (4.8 and 5.x).
  • I couldn't read the Dependabot alert state because the alerts API returned 403. Since the manifest's lowest allowed version is now the patched one, the alert should auto-close once this is merged to master.

2. aspect-mock 3.1.1 and goaop 2.x on PHPUnit 8.5 (non-blocking, verified)

  • Resolved versions: codeception/aspect-mock 3.1.1, goaop/framework 2.3.5, goaop/parser-reflection 2.1.3. aspect-mock 3.1's requirement phpunit/phpunit > 6.0.0 allows 8.5.
  • vendor/bin/phpunit ./tests gives OK (23 tests, 36 assertions) on PHPUnit 8.5.56, with no deprecations or risky-test warnings. Running --testdox lists all 23 tests by name.
  • The weaving is real. With the stock bootstrap, cache/lib/{Client,HttpClient,Monitor,Monitors}.php are generated. As a negative control I pointed includePaths away from lib/ and 11 tests failed: 7 errors and 4 failures, in testPut, testGetYaml, testDelete, testPause, testUnpause, testGetData, MonitorsTest::*, testGenerateConfig, testApplyConfig and testValidateConfig. So test::double really intercepts under PHPUnit 8.
  • The tests already use setUp(): void and tearDown(): void. They don't use @expectedException, assertInternalType, assertArraySubset or assertAttribute*, which PHPUnit 8 deprecates.

3. SDK consumers (non-blocking, verified unaffected)

  • require is unchanged (php >=5.6, symfony/yaml ^4.4|…|^8.0), and lib/ and init.php are untouched.
  • require-dev of a dependency is never installed downstream. As a check, a consumer project installing this branch from a path repository got only cronitor/cronitor-php, symfony/yaml, symfony/polyfill-ctype and symfony/deprecation-contracts, with no PHPUnit, aspect-mock or goaop.

4. Other risks (all non-blocking; most predate this PR)

  • Dev dependencies float. composer.lock is gitignored, so every CI run re-resolves. A future advisory against PHPUnit 8.5.x, aspect-mock or goaop would break CI again the same way master broke on 2026-09-26. Note that setup-php sets COMPOSER_NO_AUDIT=1, so CI only catches advisories that block resolution. Consider adding an explicit composer audit --abandoned=report step, or tracking a lock file for dev tooling.
  • The test toolchain is close to end of life. PHP 7.2 is end of life, and PHPUnit 8.5 only gets security fixes. aspect-mock appears unmaintained (3.1.1 is the latest release), and goaop 2.x does not support PHP 8. Moving CI past PHP 7.x will eventually mean replacing AspectMock with injectable HTTP doubles. Three dev dependencies are also abandoned: doctrine/annotations, doctrine/cache and php-cs-fixer/diff. Because of them, plain composer audit on Composer 2.10 exits 1 even though it finds no vulnerabilities.
  • Contributors on PHP below 7.2 can't install dev dependencies. Previously the floor was 7.0, from PHPUnit 6. The runtime floor of 5.6 is unaffected, and CI already uses 7.2.
  • Some tests are weak. ClientTest::testJob sends a real telemetry request (the "Cronitor Telemetry Error: 0" output). Some double-based tests, such as testPing, testOk and testGetYamlFailure, still pass with weaving disabled, so they don't prove the mocked path. This is a pre-existing test-quality issue.
  • CI hygiene. The cache key ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} collapses to the constant Linux-php- because there is no lock file. That's harmless today since Composer re-resolves anyway. Separately, --no-suggest is deprecated and slated to break in Composer 3.

CI status of head

Test / build passed in run 40541289566 on PHP 7.2, with PHPUnit 8.5.56 and OK (23 tests, 36 assertions). The master failure from 2026-09-26 (run 36266621767) was Composer refusing to install PHPUnit 6.x under PKSA-z3gr-8qht-p93v. This PR removes that cause.

Composer 2 already ignores it and Composer 3 will reject it, which would fail the Test workflow install step.

Co-authored-by: August Flanagan <aflanagan@users.noreply.github.com>
@cursor

cursor Bot commented Oct 27, 2026

Copy link
Copy Markdown

The other review notes are skipped as out of scope for this security bump:

  • Adding composer audit to CI. A plain composer audit exits 1 on the three abandoned dev packages even when there are no vulnerabilities, so wiring it in needs its own decision.
  • PHP 7.2 / aspect-mock / goaop end of life. That toolchain predates this PR and needs a separate migration.
  • Weak tests. testJob sends real telemetry, and testPing, testOk, and testGetYamlFailure pass even when unmocked. Those gaps predate this PR.
  • Constant vendor cache key. It comes from composer.lock being gitignored, which also predates this PR.

The deprecated --no-suggest flag is removed from the Composer install step in test.yml on this branch.

@cursor

cursor Bot commented Oct 27, 2026

Copy link
Copy Markdown

Opus 5.5 High re-review @ 90fd74d:

Verdict: APPROVE. There are no blocking notes.

Changes since 79529cc (1 commit, 90fd74d): .github/workflows/test.yml drops --no-suggest from composer install --prefer-dist --no-progress. On Composer 2, which setup-php installs, that flag does nothing; Composer itself warned that it "has no effect and will break in Composer 3". So dependency resolution and installation are unchanged, and the earlier deprecation warning is gone. The other workflow steps (PHP 7.2, composer validate --strict, the cache, composer run-script test) are untouched.

Full PR at the current head: two one-line changes against master@0405c57, which hasn't moved:

  • composer.json changes require-dev phpunit/phpunit from ^6.0 to ^8.5.52. My earlier findings still hold:
    • Its lowest allowed version is the first patched release, so GHSA-vvj3-c3rp-c85p / CVE-2026-24765 is cleared.
    • require (php >=5.6, symfony/yaml) and lib/ are unchanged, so SDK consumers are unaffected.
    • aspect-mock 3.1.1 and goaop 2.3.5 do weave under PHPUnit 8.5. Locally, disabling the weaving made 11 tests fail.
  • test.yml drops --no-suggest, as described above.

CI on 90fd74d: Test / build passed (run 40544260418, headSha 90fd74d). It resolved phpunit 8.5.56, aspect-mock 3.1.1 and goaop/framework 2.3.5, and the suite passed with OK (23 tests, 36 assertions). The vendor cache was restored from the constant key Linux-php-, but because there is no lock file Composer still re-resolved from composer.json, so the result reflects this head.

My earlier non-blocking notes are unchanged: dev dependencies float with no lock file or composer audit step, the PHP 7.2 / PHPUnit 8.5 / AspectMock toolchain is near end of life, the vendor cache key never changes, and some tests are weak or touch the network.

@aflanagan
aflanagan merged commit 2eff5c1 into master Oct 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants