Description
PHPCSUtils is a suite of utility functions for use with PHP_CodeSniffer. From 1.0.0-alpha1 until 1.2.3, PHPCSUtils\AbstractSniffs\AbstractArrayDeclarationSniff::getActualArrayKey() evaluates attacker-controlled array-key expressions with eval(), allowing callback-form keys in untrusted PHP code scanned by an extending sniff to execute arbitrary commands on the scanning host. Known reachable paths include Universal.Arrays.DuplicateArrayKey and Universal.Arrays.MixedArrayKeyTypes. This issue is fixed in version 1.2.3.
Published: 2026-10-12
Score: 8.6 High
EPSS: < 1% Very Low
KEV: No
Impact: Remote Code Execution
Action: Immediate Patch
AI Analysis

Impact

PHPCSUtils, which supplies utility functions for PHP_CodeSniffer, contains a flaw in the function that extracts array keys during static code analysis. The flaw uses eval() on array‑key expressions that originate from user‑supplied PHP code. An attacker who supplies PHP code to be scanned can supply arbitrary expressions that evaluate to executable code, allowing the attacker to run arbitrary commands on the host performing the scan. This is a classic remote code execution vulnerability, classified under CWE‑95.

Affected Systems

Vulnerable versions of PHPCSUtils from 1.0.0‑alpha1 through 1.2.3 are affected. Users who run these releases during PHP_CodeSniffer scans are at risk. The issue is fixed in PHPCSUtils 1.2.3.

Risk and Exploitability

The vulnerability has a CVSS score of 8.6, indicating high severity. No EPSS score is available, and the vulnerability is not listed in the CISA KEV catalog. The likely attack path requires an attacker to supply or influence PHP code that will be scanned; this is typically a local or privileged code‑execution scenario where the scanning host processes untrusted code. Exploitation is straightforward for users that import or scan external PHP files without validating their contents.

Generated by OpenCVE AI on October 12, 2026 at 20:55 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade PHPCSUtils to version 1.2.3 or later, which removes the eval() call and fixes the flaw.
  • If an upgrade is not immediately possible, disable the sniffs that invoke AbstractArrayDeclarationSniff::getActualArrayKey() or configure PHP_CodeSniffer to skip scans of untrusted code.
  • Avoid using PHPCSUtils with external or user‑generated PHP code until the vulnerability is fixed, and ensure any third‑party code is sanitized before analysis.

Generated by OpenCVE AI on October 12, 2026 at 20:55 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-r6hr-vr92-vv28 PHPCSUtils: Remote code execution via eval() in AbstractArrayDeclarationSniff::getActualArrayKey()
History

Tue, 13 Oct 2026 16:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Tue, 13 Oct 2026 07:45:00 +0000

Type Values Removed Values Added
First Time appeared Phpcsstandards
Phpcsstandards phpcsutils
Vendors & Products Phpcsstandards
Phpcsstandards phpcsutils

Mon, 12 Oct 2026 19:00:00 +0000

Type Values Removed Values Added
Description PHPCSUtils is a suite of utility functions for use with PHP_CodeSniffer. From 1.0.0-alpha1 until 1.2.3, PHPCSUtils\AbstractSniffs\AbstractArrayDeclarationSniff::getActualArrayKey() evaluates attacker-controlled array-key expressions with eval(), allowing callback-form keys in untrusted PHP code scanned by an extending sniff to execute arbitrary commands on the scanning host. Known reachable paths include Universal.Arrays.DuplicateArrayKey and Universal.Arrays.MixedArrayKeyTypes. This issue is fixed in version 1.2.3.
Title PHPCSUtils: Remote code execution via eval() in AbstractArrayDeclarationSniff::getActualArrayKey()
Weaknesses CWE-95
References
Metrics cvssV3_1

{'score': 8.6, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H'}


Subscriptions

Phpcsstandards Phpcsutils
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-10-13T16:00:35.790Z

Reserved: 2026-07-23T18:15:14.578Z

Link: CVE-2026-65954

cve-icon Vulnrichment

Updated: 2026-10-13T16:00:29.014Z

cve-icon NVD

Status : Deferred

Published: 2026-10-12T19:16:39.567

Modified: 2026-10-16T20:04:29.760

Link: CVE-2026-65954

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-13T07:26:01Z

Weaknesses
  • CWE-95

    Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection')