Skip to content

Raise php_codesniffer minimum to 4.0.2 for CVE-2026-67434 - #75

Merged
dereuromark merged 1 commit into
masterfrom
raise-phpcs-minimum
Aug 6, 2026
Merged

Raise php_codesniffer minimum to 4.0.2 for CVE-2026-67434#75
dereuromark merged 1 commit into
masterfrom
raise-phpcs-minimum

Conversation

@dereuromark

Copy link
Copy Markdown
Contributor

The prefer-lowest job has been failing:

1 error (make sure you ran `composer update --prefer-lowest` before):
 - squizlabs/php_codesniffer: Defined `4.0.1.0` as minimum, but is `4.0.2.0`

That reads like a stale constraint, but the cause is a security advisory published on 2026-08-05:

| Package           | squizlabs/php_codesniffer                       |
| Advisory ID       | PKSA-rdkp-vv9z-mjkg                             |
| CVE               | CVE-2026-67434                                  |
| Title             | OS Command injection                            |
| Affected versions | <3.13.6|>=4.0.0,<4.0.2                          |

composer.json required ^4.0.1, so a fresh install could pull an affected version. Composer will not resolve a package under an active advisory, so --prefer-lowest could not select the declared 4.0.1 minimum and landed on 4.0.2 - which is exactly the mismatch validate-prefer-lowest reports.

Raising the floor to ^4.0.2 fixes the advisory exposure and the job in one move.

$ composer audit
No security vulnerability advisories found.

Suite passes on 8.4 and 8.5 against 4.0.4, so the tokenizer changes between 4.0.1 and 4.0.4 do not affect any sniff here.

PHP_CodeSniffer published an OS command injection advisory on 2026-08-05,
covering everything below 3.13.6 and 4.0.0 up to but not including 4.0.2.
The constraint here allowed 4.0.1, so a fresh install could pull an affected
version.

This is also what turned the prefer-lowest job red. Composer refuses to
resolve packages under an active advisory, so it could not pick the declared
4.0.1 minimum and settled on 4.0.2, which validate-prefer-lowest then
reported as a mismatch between the declared minimum and the installed one.

Verified locally against 4.0.4: composer audit is clean and the suite passes
on 8.4 and 8.5, so nothing between 4.0.1 and 4.0.4 affects a sniff here.
Copilot AI lite review requested due to automatic review settings August 6, 2026 11:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Raises the minimum required squizlabs/php_codesniffer version to avoid installing versions affected by CVE-2026-67434 and to unblock the CI prefer-lowest job that cannot resolve an advised-against minimum.

Changes:

  • Update composer.json to require squizlabs/php_codesniffer ^4.0.2 (instead of ^4.0.1) to align the declared minimum with Composer’s security advisory constraints.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dereuromark
dereuromark merged commit 815fa88 into master Aug 6, 2026
6 checks passed
@dereuromark
dereuromark deleted the raise-phpcs-minimum branch August 6, 2026 11:31
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