High, CVSS 8.6PackagistAmendedPublished
PHPCSUtils: Remote code execution via eval() in AbstractArrayDeclarationSniff::getActualArrayKey()
CVE-2026-65954 · GHSA-r6hr-vr92-vv28
- Affected
- Packagist phpcsstandards/phpcsutils >= 1.0.0-alpha1, < 1.2.3
- Fixed in
- 1.2.3· Vendor fix available
- Issue
- Impact PHPCSUtils versions 1.0.0-alpha1 through 1.2.2 contain an arbitrary code execution vulnerability in PHPCSUtils\AbstractSniffs\AbstractArrayDeclarationSniff::getActualArrayKey(). The vulnerable method is reached by any sniff that extends AbstractArrayDeclarationSniff and calls getActualArrayKey(). Running PHPCS over untrusted PHP code through such a sniff, for example, in a CI pipeline that lints pull requests, or on a developer machine reviewing third-party code, could lead to arbitrary command execution on the scanning host. The vulnerability happens when the method determines the value of an array key using eval(). A maliciously crafted array key such as 'system'('id') would be executed when the code was scanned. Known attack vectors Known code paths that reach the vulnerable method include the following PHPCSExtra sniffs: - Universal.Arrays.DuplicateArrayKey - Universal.Arrays.MixedArrayKeyTypes Other packages that call AbstractArrayDeclarationSniff::getActualArrayKey() may…
Recommended action: Upgrade to 1.2.3 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.