Skip to main content

PHPCSUtils: Remote code execution via eval() in AbstractArrayDeclarationSniff::getActualArrayKey() (CVE-2026-65954)

0
High
Published: 09/29/2026 (09/29/2026, 17:57:16 UTC)
Source: GCVE Database
Product: phpcsstandards/phpcsutils

Description

PHPCSUtils versions 1.0.0-alpha1 through 1.2.2 contain a remote code execution vulnerability in the AbstractArrayDeclarationSniff::getActualArrayKey() method. This vulnerability arises from the use of eval() on array keys, allowing maliciously crafted PHP code to execute arbitrary commands on the host running PHPCS. The issue affects any sniff extending AbstractArrayDeclarationSniff that calls this method, including known vulnerable sniffs in PHPCSExtra. The vulnerability is fixed in version 1.2.3. Users unable to upgrade immediately can mitigate risk by disabling the vulnerable sniffs via custom ruleset exclusions.

CVSS v3.1

Score 8.6high

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H

Affected software

Packagistghsa
phpcsstandards/phpcsutils
Affected versions
>=1.0.0-alpha1 <1.2.3

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 09/29/2026, 21:22:55 UTC

Technical Analysis

PHPCSUtils versions from 1.0.0-alpha1 up to but not including 1.2.3 have an arbitrary code execution vulnerability (CVE-2026-65954) in the method AbstractArrayDeclarationSniff::getActualArrayKey(). The method uses eval() to determine array key values, which can be exploited by maliciously crafted array keys such as 'system('id')' to execute arbitrary commands on the scanning host. This vulnerability can be triggered by running PHPCS with sniffs that extend AbstractArrayDeclarationSniff, including PHPCSExtra sniffs Universal.Arrays.DuplicateArrayKey and Universal.Arrays.MixedArrayKeyTypes. The vulnerability is fixed in PHPCSUtils version 1.2.3. Users are advised to upgrade to 1.2.3 or later. As a workaround, disabling the vulnerable sniffs in the ruleset can mitigate the risk until an upgrade is possible.

Potential Impact

Exploitation of this vulnerability allows an attacker to execute arbitrary code on the host machine running PHPCS, potentially leading to full compromise of that system. This can occur when scanning untrusted PHP code, such as in CI pipelines or developer environments. The vulnerability affects the confidentiality, integrity, and availability of the scanning host, as indicated by the CVSS score of 8.6 with high impact on all three security properties.

Mitigation Recommendations

A patch is available in PHPCSUtils version 1.2.3 that fixes this vulnerability. Users should upgrade to version 1.2.3 or later to remediate the issue. For users who cannot upgrade immediately, the vendor recommends disabling the vulnerable sniffs that call getActualArrayKey() by excluding them in the PHPCS ruleset configuration. For example, exclude Universal.Arrays.DuplicateArrayKey and Universal.Arrays.MixedArrayKeyTypes sniffs. Verification of exclusion can be done using the 'phpcs -e' command with the custom ruleset. No other mitigation steps are specified by the vendor.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-r6hr-vr92-vv28
Osv Schema Version
1.4.0
Aliases
["CVE-2026-65954"]
Ecosystems
["Packagist"]
Database Specific Severity
HIGH
Cvss Version
3.1

Threat ID: 6abc27d2680226ef6846f931

Added to database: 09/29/2026, 21:04:18 UTC

Last enriched: 09/29/2026, 21:22:55 UTC

Last updated: 09/30/2026, 03:11:28 UTC

Views: 3

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses