CVE-2026-65954

CVE-2026-65954 is a high-severity security vulnerability in phpcsstandards/phpcsutils (composer), affecting versions >= 1.0.0-alpha1, < 1.2.3. It is fixed in 1.2.3.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

PHPCSUtils: Remote code execution via eval() in AbstractArrayDeclarationSniff::getActualArrayKey()

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.

Workaround

Users 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):

<rule ref="Standard">
	<exclude name="Standard.Category.SniffName"/>
</rule>

For example, to disable the two PHPCSExtra sniffs listed under "Known attack vectors":

<rule ref="Universal">
	<exclude name="Universal.Arrays.DuplicateArrayKey"/>
	<exclude name="Universal.Arrays.MixedArrayKeyTypes"/>
</rule>

To 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:

phpcs -e --standard=/path/to/ruleset.xml

Credits

Many thanks to @rodrigoprimo for responsibly disclosing this vulnerability.

How can I report a security bug?

Please report security vulnerabilities privately via the "Security and quality" tab on the PHPCSUtils repository.

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.

CVE-2026-65954 has a CVSS score of 8.6 (High). The vector is requires local access, no privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (1.2.3); upgrading removes the vulnerable code path.

Affected versions

phpcsstandards/phpcsutils (>= 1.0.0-alpha1, < 1.2.3)

Security releases

phpcsstandards/phpcsutils → 1.2.3 (composer)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

This issue has been fixed in PHPCSUtils 1.2.3. We recommend all users upgrade to 1.2.3 or later.

Frequently Asked Questions

  1. What is CVE-2026-65954? CVE-2026-65954 is a high-severity security vulnerability in phpcsstandards/phpcsutils (composer), affecting versions >= 1.0.0-alpha1, < 1.2.3. It is fixed in 1.2.3.
  2. How severe is CVE-2026-65954? CVE-2026-65954 has a CVSS score of 8.6 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of phpcsstandards/phpcsutils are affected by CVE-2026-65954? phpcsstandards/phpcsutils (composer) versions >= 1.0.0-alpha1, < 1.2.3 is affected.
  4. Is there a fix for CVE-2026-65954? Yes. CVE-2026-65954 is fixed in 1.2.3. Upgrade to this version or later.
  5. Is CVE-2026-65954 exploitable, and should I be worried? Whether CVE-2026-65954 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2026-65954 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2026-65954? Upgrade phpcsstandards/phpcsutils to 1.2.3 or later.

Stop the waste.
Protect your environment with Kodem.