PHPCSUtils: Remote code execution via eval() in AbstractArrayDeclarationSniff::getActualArrayKey()
### Impact PHPCSUtils 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()`. Running 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. The 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. ### Known attack vectors Known code paths that reach the vulnerable method include the following PHPCSExtra sniffs: - `Universal.Arrays.DuplicateArrayKey` - `Universal.Arrays.MixedArrayKeyTypes` Other packages that call `AbstractArrayDeclarationSniff::getActualArrayKey()` may also be vulnerable. ### Patches This issue has been fixed in PHPCSUtils 1.2.3. We recommend all users upgrade to 1.2.3 or later. ### Workaround Users who cannot upgrade immediately can disable the sniffs that reach the vulnerable method by adding `` tags to their custom ruleset (replace the placeholder standard and sniff names with the ones used in your setup): ```xml ``` For example, to disable the two PHPCSExtra sniffs listed under "Known attack vectors": ```xml ``` To v
GHSA-r6hr-vr92-vv28
Primary source · Revision 1
Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.
Security context
Source reference: osv:GHSA-r6hr-vr92-vv28
phpcsstandards/phpcsutils
Source reference: /affected/0/package/name
- Affected versions
- 1.0.0
Source reference:
/affected/0/versions1.0.0-alpha1Source reference:
/affected/0/versions1.0.0-alpha2Source reference:
/affected/0/versions1.0.0-alpha3Source reference:
/affected/0/versions1.0.0-alpha4Source reference:
/affected/0/versions1.0.0-rc1Source reference:
/affected/0/versions1.0.1Source reference:
/affected/0/versions1.0.10Source reference:
/affected/0/versions1.0.11Source reference:
/affected/0/versions1.0.12Source reference:
/affected/0/versions1.0.2Source reference:
/affected/0/versions1.0.3Source reference:
/affected/0/versions1.0.4Source reference:
/affected/0/versions1.0.5Source reference:
/affected/0/versions1.0.6Source reference:
/affected/0/versions1.0.7Source reference:
/affected/0/versions1.0.8Source reference:
/affected/0/versions1.0.9Source reference:
/affected/0/versions1.1.0Source reference:
/affected/0/versions1.1.1Source reference:
/affected/0/versions1.1.2Source reference:
/affected/0/versions1.1.3Source reference:
/affected/0/versions1.2.0Source reference:
/affected/0/versions1.2.1Source reference:
/affected/0/versions1.2.2Source reference:
/affected/0/versions - Fixed versions
- 1.2.3
Source reference:
/affected/0/ranges - Prerequisites
- Not stated in this record
Structured affected-version data
Original package identities and version rules from this source.
[
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "1.0.0-alpha1"
},
{
"fixed": "1.2.3"
}
]
}
],
"package": {
"name": "phpcsstandards/phpcsutils",
"purl": "pkg:composer/phpcsstandards/phpcsutils",
"ecosystem": "Packagist"
},
"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"
],
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/09/GHSA-r6hr-vr92-vv28/GHSA-r6hr-vr92-vv28.json"
}
}
]- Related CVEs
- CVE-2026-65954
Source reference:
/aliases
Publisher severity
high
Source reference: /database_specific/severity
- Event
- #29752 · Revision 1
- Added to Heist Feed
- Publisher date