GitHub Advisoryadvisory · Packagist

GHSA-3pwp-g2mj-5p3v WordPress Coding Standards (WordPressCS) contains an arbitrary code execution vulnerability

HIGH Published 2026-07-28 Modified 2026-07-28 Official page ↗
Aliases
CVE-2026-45293
Ecosystem
Packagist
Packages
wp-coding-standards/wpcs
Severity
High
CVSS vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
Weaknesses
CWE-95
Reviewed
2026-07-28

Affected packages

• Packagist wp-coding-standards/wpcs: >= 0.14.1, < 3.4.1 → fixed in 3.4.1

Description

Impact WordPress Coding Standards (WordPressCS) versions before 3.4.1 contain an arbitrary code execution vulnerability in the `WordPress.WP.EnqueuedResourceParameters` sniff. As a result, running PHPCS with WordPressCS over untrusted PHP code, 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. This affects users of the `WordPress` and `WordPress-Extra` rulesets. The `WordPress-Core` ruleset and the `WordPress-Docs` ruleset are not affected. The vulnerability happens when the sniff checks whether the `$var` argument passed to functions such as `wp_enqueue_script()` or `wp_register_script()` evaluates to a falsy value. The sniff's `is_falsy()` method reconstructed the argument and ran it through `eval()`. Because of this, a maliciously crafted `$ver` argument such as `'system'('id')` would be executed during the scan. Patches This issue has been fixed in WordPressCS 3.4.1. We recommend all users upgrade to 3.4.1 or later. Workaround Users of the `WordPress` and `WordPress-Extra` rulesets, who cannot upgrade immediately, can disable the affected sniff by adding an `` tag to their custom ruleset (the `` `ref` value might vary depending on the ruleset): ```xml ``` To verify that the sniff has been disabled, run PHPCS with the `-e` flag, which lists all the sniffs a standard will run. `WordPress.WP.EnqueuedResourceParameters` should no longer appear in the output under the `WordPress` section: ``` phpcs -e --standard=/path/to/ruleset.xml ``` Credits Many thanks to @FORIMOC 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 WPCS repository.

Related

Alias · CVE (1)

  • CVE-2026-45293 WordPress Coding Standards is a set of PHP_CodeSniffer rules (sniffs) that enforce WordPress coding conventions. vulnerability

Weakness · CWE (1)

  • CWE-95 Improper Neutralization of Directives in Dynamically Evaluated Code weakness

References