CVE-2026-65954 is a high-severity (CVSS 8.6) CWE-95 vulnerability in phpcsstandards/phpcsutils. A fix is available for phpcsstandards/phpcsutils — see the affected versions and patch details below.
PHPCSUtils: Remote code execution via eval() in AbstractArrayDeclarationSniff::getActualArrayKey()
Exploitation Status
No confirmed exploitation observed yet
- A successful exploit gives an attacker total control of the affected component, not partial access.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-65954.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2026-65954 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 394,803 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
phpcsstandards/phpcsutilsReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Packagist packages — download data is not available via public APIs for these ecosystems.
Description
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.DuplicateArrayKeyUniversal.Arrays.MixedArrayKeyTypes
Other packages that call AbstractArrayDeclarationSniff::getActualArrayKey() may also be vulnerable.
Patches
This issue has been fixed in PHPCSUtils 1.2.3. We recommend all users upgrade to 1.2.3 or later.
Workaround
Users who cannot upgrade immediately can disable the sniffs that reach the vulnerable method by adding <exclude> tags to their custom ruleset (replace the placeholder standard and sniff names with the ones used in your setup):
<rule ref="Standard">
<exclude name="Standard.Category.SniffName"/>
</rule>
For example, to disable the two PHPCSExtra sniffs listed under "Known attack vectors":
<rule ref="Universal">
<exclude name="Universal.Arrays.DuplicateArrayKey"/>
<exclude name="Universal.Arrays.MixedArrayKeyTypes"/>
</rule>
To verify that the sniffs have been disabled, run PHPCS with the -e flag, which lists all the sniffs a standard will run. The excluded sniffs should no longer appear in the output:
phpcs -e --standard=/path/to/ruleset.xml
Credits
Many thanks to @rodrigoprimo for responsibly disclosing this vulnerability.
How can I report a security bug?
Please report security vulnerabilities privately via the "Security and quality" tab on the PHPCSUtils repository.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐘Packagist | phpcsstandards/phpcsutils | ≥ 1.0.0-alpha1&&< 1.2.3 | 1.2.3composer require phpcsstandards/phpcsutils:^1.2.3 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for phpcsstandards/phpcsutils, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update phpcsstandards/phpcsutils to 1.2.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-65954 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Frequently Asked Questions
Is CVE-2026-65954 in your dependencies?
Find it across Packagist, including transitive dependencies.