GIVE YOUR AGENT THE EVIDENCE

Set up in your agent.

One prompt to get started. Paste it into your coding agent to connect cve.new through MCP and bring vulnerability context into your workflow.

Your agent needs remote MCP support and access to https://cve.new/mcp.

Read the setup guide

GIVE YOUR AGENT THE EVIDENCE

Investigate in your agent.

Turn this advisory into a focused investigation. Ask your agent to check your project’s versions, explain the evidence, and suggest a compatible fix.

Your agent needs remote MCP support and access to https://cve.new/mcp.

Read the setup guide

GHSA-3pwp-g2mj-5p3vhigh8.6

WordPress Coding Standards (WordPressCS) contains an arbitrary code execution vulnerability

Check your stack

The advisory, in context

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 <exclude> tag to their custom ruleset (the <rule> ref value might vary depending on the ruleset):

<rule ref="WordPress">
	<exclude name="WordPress.WP.EnqueuedResourceParameters"/>
</rule>

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.

Affected packages

Start with the recorded fix for your release branch. Check your installed version and test compatibility before upgrading. Fixing this advisory does not rule out other vulnerabilities in the release.

Ecosystem versions

From 0.14.1 before 3.4.1

Fixed in 3.4.1

18 explicitly affected versions

0.14.1, 1.0.0, 1.1.0, 1.2.0, 1.2.1, 2.0.0, 2.0.0-RC1, 2.1.0, 2.1.1, 2.2.0, 2.2.1, 2.3.0, 3.0.0, 3.0.1, 3.1.0, 3.2.0, 3.3.0, 3.4.0

View affected-version evidence
{
  "ranges": [
    {
      "events": [
        {
          "introduced": "0.14.1"
        },
        {
          "fixed": "3.4.1"
        }
      ],
      "type": "ECOSYSTEM"
    }
  ],
  "versions": [
    "0.14.1",
    "1.0.0",
    "1.1.0",
    "1.2.0",
    "1.2.1",
    "2.0.0",
    "2.0.0-RC1",
    "2.1.0",
    "2.1.1",
    "2.2.0",
    "2.2.1",
    "2.3.0",
    "3.0.0",
    "3.0.1",
    "3.1.0",
    "3.2.0",
    "3.3.0",
    "3.4.0"
  ]
}

References