{"schema":"threatline.record/2","record":{"id":"CVE-2026-65954","aliases":["GHSA-r6hr-vr92-vv28"],"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).","categories":["Libraries & packages"],"product":"phpcsstandards/phpcsutils","vendor":"PHPCSStandards","ecosystem":"composer","affected_ranges":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-r6hr-vr92-vv28","source_modified_at":"2026-09-29T17:57:17Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"composer","name":"phpcsstandards/phpcsutils"},"range":">= 1.0.0-alpha1, < 1.2.3"},{"source":"CVE List","source_url":"https://www.cve.org/CVERecord?id=CVE-2026-65954","source_modified_at":"2026-10-13T16:00:35.790Z","fetched_at":"2026-10-23T18:45:31.882637Z","product":"PHPCSUtils","vendor":"PHPCSStandards","versions":[{"version":">= 1.0.0-alpha1, <= 1.2.2","status":"affected"}],"defaultStatus":null},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-r6hr-vr92-vv28","source_modified_at":"2026-09-29T18:15:04.713403731Z","fetched_at":"2026-10-23T18:45:31.882637Z","package":{"name":"phpcsstandards/phpcsutils","ecosystem":"Packagist","purl":"pkg:composer/phpcsstandards/phpcsutils"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"1.0.0-alpha1"},{"fixed":"1.2.3"}]}],"versions":["1.0.0","1.0.0-alpha1","1.0.0-alpha2","1.0.0-alpha3","1.0.0-alpha4","1.0.0-rc1","1.0.1","1.0.10","1.0.11","1.0.12","1.0.2","1.0.3","1.0.4","1.0.5","1.0.6","1.0.7","1.0.8","1.0.9","1.1.0","1.1.1","1.1.2","1.1.3","1.2.0","1.2.1","1.2.2"]}],"fixed_versions":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-r6hr-vr92-vv28","source_modified_at":"2026-09-29T17:57:17Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"composer","name":"phpcsstandards/phpcsutils"},"version":"1.2.3"},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-r6hr-vr92-vv28","source_modified_at":"2026-09-29T18:15:04.713403731Z","fetched_at":"2026-10-23T18:45:31.882637Z","package":{"name":"phpcsstandards/phpcsutils","ecosystem":"Packagist","purl":"pkg:composer/phpcsstandards/phpcsutils"},"version":"1.2.3"}],"cvss":8.6,"severity":"High","kev":{"listed":false},"epss":{"probability":0.00215,"percentile":0.11363,"score_date":"2026-10-23"},"published_at":"2026-10-12T18:51:01.522Z","modified_at":"2026-10-13T16:00:35.790Z","provenance":[{"source":"GitHub Advisory Database","url":"https://github.com/advisories/GHSA-r6hr-vr92-vv28","fetched_at":"2026-10-23T18:42:43.628194Z","source_modified_at":"2026-09-29T17:57:17Z"},{"source":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2026-65954","fetched_at":"2026-10-23T18:45:31.882637Z","source_modified_at":"2026-10-13T16:00:35.790Z"},{"source":"OSV","url":"https://osv.dev/vulnerability/GHSA-r6hr-vr92-vv28","fetched_at":"2026-10-23T18:45:31.882637Z","source_modified_at":"2026-09-29T18:15:04.713403731Z"},{"source":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2026-65954","fetched_at":"2026-10-23T18:42:43.628194Z","source_modified_at":"2026-10-23"}],"sources":["GitHub Advisory Database","CVE List","OSV","EPSS"],"references":[{"source":"CVE List","url":"https://github.com/PHPCSStandards/PHPCSUtils/security/advisories/GHSA-r6hr-vr92-vv28","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/PHPCSStandards/PHPCSUtils/pull/778","source":"GitHub Advisory Database"},{"url":"https://github.com/PHPCSStandards/PHPCSUtils/commit/9f596b50ea4498ea57b8cb341e920233b044debf","source":"GitHub Advisory Database"},{"url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/phpcsstandards/phpcsutils/CVE-2026-65954.yaml","source":"GitHub Advisory Database"},{"url":"https://github.com/advisories/GHSA-r6hr-vr92-vv28","source":"GitHub Advisory Database"},{"source":"CVE List","url":"https://github.com/PHPCSStandards/PHPCSUtils/commit/e8648633ff5b8219b1b3e6346ce85abfc30f1429","tags":["x_refsource_MISC"]},{"source":"CVE List","url":"https://github.com/PHPCSStandards/PHPCSUtils/releases/tag/1.2.3","tags":["x_refsource_MISC"]}],"locations":[],"motoko_assessment":{"status":"requires_architecture_review","automatic_remediation":false},"cve_state":"PUBLISHED","ssvc":{"exploitation":"none","automatable":"no","technical_impact":"total","assessed_at":"2026-10-13T16:00:20.413719Z"},"classification":{"method":"product-first software-layer rules","rules_version":"2.1","matched_on":"ecosystem","confidence":"heuristic","reviewed":false},"change_timestamp":"2026-10-13T16:00:35.790Z","content_hash":"824e0d0057bc7fcd7e26410cbe863abfd83fe587f65fd52d6fa1d4b443f10a80"}}
