CVE-2026-65954: 
PHP vulnerability analysis and mitigation

Overview

CVE-2026-65954 is an eval injection vulnerability in PHPCSUtils (GHSA-r6hr-vr92-vv28) that allows arbitrary code execution on the host running PHP_CodeSniffer scans. The flaw exists in PHPCSUtils\AbstractSniffs\AbstractArrayDeclarationSniff::getActualArrayKey(), which uses eval() to evaluate array key expressions found in scanned PHP code. Affected versions span from 1.0.0-alpha1 through 1.2.2 (inclusive); version 1.2.3 contains the fix. It carries a CVSS v3.1 base score of 8.6 (High) (Github Advisory, PHPCSUtils Advisory).

Technical details

The root cause is CWE-95 (Improper Neutralization of Directives in Dynamically Evaluated Code — 'Eval Injection'): the getActualArrayKey() method passes attacker-controlled array key expressions directly to PHP's eval() without sanitization, enabling execution of arbitrary PHP and OS-level commands (Github Advisory). The attack vector is local (the malicious code must be present in a file scanned by PHPCS), requires no privileges, but does require user interaction (a developer or CI system must trigger a scan). Known reachable code paths include the PHPCSExtra sniffs Universal.Arrays.DuplicateArrayKey and Universal.Arrays.MixedArrayKeyTypes; any other sniff extending AbstractArrayDeclarationSniff and calling getActualArrayKey() is also affected (PHPCSUtils Advisory). The fix (commit e8648633) introduces a $callbackIndicators token list and bails out of eval() processing whenever a callback-format function call is detected in an array key (PHPCSUtils Commit).

Impact

Successful exploitation allows an unauthenticated attacker to execute arbitrary OS commands with the privileges of the process running PHPCS — typically a developer account or a CI/CD service account — resulting in full confidentiality, integrity, and availability compromise of the scanning host (Github Advisory). The scope is marked as Changed, meaning the impact extends beyond the vulnerable component itself; a compromised CI pipeline could enable lateral movement into build infrastructure, secret stores, or deployment environments. A concrete example payload is 'system'('id') used as an array key, which executes the id command when the file is scanned (PHPCSUtils Advisory).

Exploitability

No public proof-of-concept exploit code is known to exist, and there is no evidence of in-the-wild exploitation at this time (Github Advisory). The EPSS score is approximately 0.215% (11th percentile), indicating a low near-term exploitation probability. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Exploitation is not automatable — it requires a victim to scan a maliciously crafted PHP file — but the attack is trivially simple once a target scans attacker-controlled code (e.g., via a pull request in a CI pipeline).

Exploitation steps

  1. Craft malicious PHP file: Create a PHP file containing an array with a callback-format key that executes an OS command, for example:
<?php
$arr = [
    'system'('id') => 'value',
];
  1. Deliver the file to the target: Submit the malicious PHP file as part of a pull request to a repository whose CI pipeline runs PHPCS with a vulnerable version of PHPCSUtils (1.0.0-alpha1 through 1.2.2) and a sniff that calls getActualArrayKey() (e.g., Universal.Arrays.DuplicateArrayKey or Universal.Arrays.MixedArrayKeyTypes).
  2. Trigger the scan: Wait for the CI pipeline (or a developer) to run phpcs against the submitted file. The scan invokes AbstractArrayDeclarationSniff::getActualArrayKey(), which passes the array key expression to eval().
  3. Achieve code execution: The eval() call executes 'system'('id') (or any other OS command), running arbitrary commands on the scanning host with the privileges of the PHPCS process — enabling data exfiltration, reverse shell establishment, or further lateral movement within the CI/CD environment (PHPCSUtils Advisory, PHPCSUtils Commit).

Indicators of compromise

  • Process: Unexpected child processes spawned by the PHP/PHPCS process (e.g., sh, bash, id, curl, wget, python) during a code scan.
  • Logs: CI pipeline logs showing unexpected command output (e.g., user/group information, hostname) interleaved with PHPCS scan output; PHP error logs referencing eval() execution errors in AbstractArrayDeclarationSniff.
  • File System: New or modified files in the CI workspace or developer home directory created during a PHPCS scan run; unexpected cron jobs, SSH keys, or scripts added by the PHPCS process user.
  • Network: Outbound connections from the CI runner or developer machine to unknown external IPs initiated by the PHPCS process (e.g., reverse shell callbacks or data exfiltration) during or immediately after a scan.

Mitigation and workarounds

Upgrade PHPCSUtils to version 1.2.3 or later, which resolves the vulnerability by preventing eval() from processing callback-format array keys (PHPCSUtils Release). As a temporary workaround for those unable to upgrade immediately, disable the vulnerable sniffs by adding <exclude name="Universal.Arrays.DuplicateArrayKey"/> and <exclude name="Universal.Arrays.MixedArrayKeyTypes"/> (and any other sniffs calling getActualArrayKey()) to your custom PHPCS ruleset; verify exclusion with phpcs -e --standard=/path/to/ruleset.xml (PHPCSUtils Advisory). Additionally, avoid scanning untrusted or third-party PHP code with vulnerable versions of PHPCSUtils, particularly in automated CI pipelines that process pull requests from external contributors.

Community reactions

The vulnerability was responsibly disclosed by researcher @rodrigoprimo and fixed by maintainer @jrfnl, with @edorian serving as remediation reviewer (PHPCSUtils Advisory). The release notes for version 1.2.3 explicitly label it a security release and advise all users to update as soon as possible (PHPCSUtils Release). No significant broader media coverage or notable social media commentary beyond standard vulnerability database aggregation has been observed.

Additional resources


Source: This report was generated using AI

Related PHP vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-wwq7-mh3q-hwrhHIGH8.2
  • PHP logoPHP
  • web-token/jwt-framework
NoYesNov 08, 2026
GHSA-jgv7-g4jg-6hqvHIGH8.2
  • PHP logoPHP
  • web-token/jwt-framework
NoYesNov 08, 2026
GHSA-jc6j-46g2-xwqcHIGH8.2
  • PHP logoPHP
  • web-token/jwt-framework
NoYesNov 08, 2026
GHSA-wwcr-82mc-w3pwMEDIUM6.3
  • PHP logoPHP
  • web-token/jwt-framework
NoYesNov 08, 2026
GHSA-44cp-9fph-8778MEDIUMN/A
  • PHP logoPHP
  • austintoddj/canvas
NoYesNov 08, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management