CVE-2026-65954High· 8.6▾ TwilightPHPCSUtils: Remote code execution via eval() in AbstractArrayDeclarationSniff::getActualArrayKey()
▾ Twilight zone — High severity, or a signal on a lesser flaw
impact 47.3 · likelihood 0 · exploitation 0
Need a working PoC? Pro members can cast a request and our team develops one — it lands right here.
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 code paths that reach the vulnerable method include the following PHPCSExtra sniffs:
Universal.Arrays.DuplicateArrayKeyUniversal.Arrays.MixedArrayKeyTypesOther packages that call AbstractArrayDeclarationSniff::getActualArrayKey() may also be vulnerable.
This issue has been fixed in PHPCSUtils 1.2.3. We recommend all users upgrade to 1.2.3 or later.
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
Many thanks to @rodrigoprimo for responsibly disclosing this vulnerability.
Please report security vulnerabilities privately via the "Security and quality" tab on the PHPCSUtils repository.
phpcsstandards/phpcsutils >= 1.0.0-alpha1, < 1.2.3Upgrade to a patched release:
phpcsstandards/phpcsutils 1.2.3Connected by shared product, vendor, weakness, or advisory.
CVE-2026-45293High· 8.6WordPress Coding Standards is a set of PHP_CodeSniffer rules (sniffs) that enforce WordPress coding conventions
CVE-2026-49273HighMantisBT: Remote Code Execution via eval() Class Hoisting in adm_config_set.php
CVE-2026-40187HighEGroupware has Authenticated RCE via Malicious eTemplate Upload
CVE-2024-42002High· 8.4A code injection vulnerability has been discovered in the Robot Operating System 2 (ROS 2) 'ros2topic' command-line tool, affecting all ROS 2 distributions from Crystal Clemmys up to and including Lyrical Luth and Rolling Ridley
CVE-2026-101861Medium· 4.1Langflow 1.0.16 before 1.12.0 and 0.0.94 before 1.12.0 contain an unsafe eval() vulnerability in schema.py that allows authenticated attackers to achieve code execution by placing a Python object with a malicious __repr__ method into com…
CVE-2026-100741Critical· 9.8Eval injection in the JScript event-script dispatcher in Progressive Robot Ltd's hMailServer, versions 6.0.0 through 6.3.3 on Windows, allows a remote, unauthenticated attacker to run arbitrary JScript inside the hMailServer service proc…