Open-Source Security Intelligence

Know every vulnerability
before it knows you.

DevGuard continuously monitors your dependencies and alerts you when CVEs like this one affect your stack — with real-time threat intelligence built for developers.

Search

GHSA-pcw8-m77r-2528

CriticalCVSS 9.8 / 10
Published Aug 18, 2026·Last modified Aug 18, 2026
Affected Components(1)
Packagist logomtdowling/jmespath.php
< 2.9.1
Description

Impact

mtdowling/jmespath.php can generate and execute attacker-controlled PHP code when JmesPath\CompilerRuntime is used with an attacker-controlled JMESPath expression. The compiler emits parsed JMESPath function names into generated PHP source without sufficient escaping. A crafted expression can cause the generated cache file to contain executable attacker-controlled PHP, which is then loaded by the compiler runtime.

A vulnerable flow is:

  1. An application accepts or constructs a JMESPath expression using attacker-controlled input.
  2. The expression is evaluated with JmesPath\CompilerRuntime, or with JmesPath\search() while JP_PHP_COMPILE is enabled.
  3. The crafted expression uses a non-identifier value where the parser accepts a function callee.
  4. The compiler writes that value into generated PHP source without safely escaping it as a PHP string literal.
  5. The generated source is written to the compiled-expression cache directory.
  6. CompilerRuntime loads the generated cache file.
  7. The injected PHP executes in the context of the affected application.

In that flow, an attacker can execute arbitrary PHP code with the privileges of the PHP process. The searched data document is not sufficient to exploit this issue by itself; the attacker must be able to influence the JMESPath expression string.

The default runtime used by JmesPath\search() is AstRuntime, which interprets the parsed expression tree and is not affected unless JP_PHP_COMPILE is enabled. Applications are most likely to be affected when they explicitly instantiate JmesPath\CompilerRuntime, enable JP_PHP_COMPILE as a performance optimization, and allow users to provide JMESPath expressions for filtering, querying, or transforming data.

Patches

The issue is patched in 2.9.1 and later.

Workarounds

If you cannot upgrade immediately, disable JP_PHP_COMPILE and do not use JmesPath\CompilerRuntime with attacker-controlled expressions. Use the default AstRuntime for untrusted expressions. Applications that must continue accepting untrusted JMESPath expressions before upgrading should ensure those expressions are never evaluated by the compiler runtime.

Risk Scores
Base Score
9.8

The vulnerability can be exploited over the network without needing physical access. It is easy for an attacker to exploit this vulnerability. An attacker does not need any special privileges or access rights. No user interaction is needed for the attacker to exploit this vulnerability. The impact is confined to the system where the vulnerability exists. There is a high impact on the confidentiality of the information. There is a high impact on the integrity of the data. There is a high impact on the availability of the system.

Threat Intelligence
9.0

Active exploitation in the wild has been confirmed. Immediate patching or mitigation is required.

EPSS
0.32%

The exploit probability is very low. The vulnerability is unlikely to be exploited in the next 30 days.

Exploit
Not available

We did not find any exploit available. Neither in GitHub repositories nor in the Exploit-Database.

Scan your project

Continuously monitor your dependencies and get alerted when vulnerabilities like this one affect your stack.

Checkout DevGuard