CVE-2026-65954: PHPCSUtils Remote Code Execution Vulnerability
HIGHCVE-2026-65954 is a HIGH (CVSS 8.6) remote code execution vulnerability (CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection')) affecting PHPCSUtils libraries in the Packagist ecosystem. The issue involves remote code execution via eval() in abstractarraydeclarationsniff::getactualarraykey(). Remediation is available by upgrading affected packages to version 1.2.3.
CVE-2026-65954 at a Glance
Security Impact
CVSS: 8.6
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H).
How to Fix CVE-2026-65954
To remediate this vulnerability, upgrade all affected PHPCSUtils dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade phpcsstandards/phpcsutils to 1.2.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for phpcsstandards/phpcsutils
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-65954, inspect your project dependencies for PHPCSUtils:
inspect dependencies for phpcsstandards/phpcsutils
Analyze the terminal output to locate any version of PHPCSUtils in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.2.3), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection'), where the product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes code syntax before using the input in a dynamic evaluation call (e.g. "eval"). In PHPCSUtils, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-65954 Affected PHPCSUtils Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
phpcsstandards/phpcsutils
|
Packagist |
≥ 1.0.0-alpha1
< 1.2.3
|
1.2.3
|
References
Frequently Asked Questions
What is CVE-2026-65954?
Which PHPCSUtils versions are affected?
What version fixes CVE-2026-65954?
Is phpcsstandards/phpcsutils affected?
What is the CVSS score of CVE-2026-65954?
What CWE is associated with CVE-2026-65954?
How can I check Packagist dependencies for CVE-2026-65954?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-r6hr-vr92-vv28",
"modified" : "2026-09-29T17:57:16Z",
"published" : "2026-09-29T17:57:16Z",
"aliases" : [ "CVE-2026-65954" ],
"summary" : "PHPCSUtils: Remote code execution via eval() in AbstractArrayDeclarationSniff::getActualArrayKey()",
"details" : "### Impact\n\nPHPCSUtils 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()`.\n\nRunning 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.\n\nThe 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.\n\n### Known attack vectors\n\nKnown code paths that reach the vulnerable method include the following PHPCSExtra sniffs:\n\n- `Universal.Arrays.DuplicateArrayKey`\n- `Universal.Arrays.MixedArrayKeyTypes`\n\nOther packages that call `AbstractArrayDeclarationSniff::getActualArrayKey()` may also be vulnerable.\n\n### Patches\n\nThis issue has been fixed in PHPCSUtils 1.2.3. We recommend all users upgrade to 1.2.3 or later.\n\n### Workaround\n\nUsers 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):\n\n```xml\n<rule ref=\"Standard\">\n\t<exclude name=\"Standard.Category.SniffName\"/>\n</rule>\n```\n\nFor example, to disable the two PHPCSExtra sniffs listed under \"Known attack vectors\":\n\n```xml\n<rule ref=\"Universal\">\n\t<exclude name=\"Universal.Arrays.DuplicateArrayKey\"/>\n\t<exclude name=\"Universal.Arrays.MixedArrayKeyTypes\"/>\n</rule>\n```\n\nTo 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:\n\n```\nphpcs -e --standard=/path/to/ruleset.xml\n```\n\n### Credits\n\nMany thanks to [@rodrigoprimo](https://github.com/rodrigoprimo) for responsibly disclosing this vulnerability.\n\n### How can I report a security bug?\n\nPlease report security vulnerabilities privately via [the \"Security and quality\" tab on the PHPCSUtils repository](https://github.com/PHPCSStandards/PHPCSUtils/security).",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "phpcsstandards/phpcsutils"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.0.0-alpha1"
}, {
"fixed" : "1.2.3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/PHPCSStandards/PHPCSUtils/security/advisories/GHSA-r6hr-vr92-vv28"
}, {
"type" : "WEB",
"url" : "https://github.com/PHPCSStandards/PHPCSUtils/pull/778"
}, {
"type" : "WEB",
"url" : "https://github.com/PHPCSStandards/PHPCSUtils/commit/9f596b50ea4498ea57b8cb341e920233b044debf"
}, {
"type" : "WEB",
"url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/phpcsstandards/phpcsutils/CVE-2026-65954.yaml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/PHPCSStandards/PHPCSUtils"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-95" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-09-29T17:57:16Z",
"nvd_published_at" : null
}
}