{"id":"CVE-2026-65954","aliases":["GHSA-r6hr-vr92-vv28"],"url":"https://o3.security/vulnerability/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).","published":"2026-10-12T18:51:01.522Z","modified":"2026-10-24T02:30:16.392239824Z","cvss":{"score":8.6,"severity":"HIGH","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H"},"epss":null,"cisaKev":null,"exploitsKnown":null,"affectedPackages":[{"ecosystem":"Packagist","name":"phpcsstandards/phpcsutils","fixedVersion":"1.2.3"}],"fix":{"url":"https://github.com/PHPCSStandards/PHPCSUtils/commit/e8648633ff5b8219b1b3e6346ce85abfc30f1429","label":"PHPCSStandards/PHPCSUtils@e864863"},"references":[{"type":"WEB","url":"https://github.com/PHPCSStandards/PHPCSUtils/releases/tag/1.2.3"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/65xxx/CVE-2026-65954.json"},{"type":"ADVISORY","url":"https://github.com/PHPCSStandards/PHPCSUtils/security/advisories/GHSA-r6hr-vr92-vv28"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-65954"},{"type":"FIX","url":"https://github.com/PHPCSStandards/PHPCSUtils/commit/e8648633ff5b8219b1b3e6346ce85abfc30f1429"},{"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"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-10-24T02:30:16.392239824Z"}}