Advisory Database
  • Advisories
  • Dependency Scanning
  1. composer
  2. ›
  3. mtdowling/jmespath.php
  4. ›
  5. CVE-2026-54133

CVE-2026-54133: jmespath.php has CompilerRuntime code injection via unescaped function names

August 18, 2026

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.

References

  • github.com/FriendsOfPHP/security-advisories/blob/master/mtdowling/jmespath.php/CVE-2026-54133.yaml
  • github.com/advisories/GHSA-pcw8-m77r-2528
  • github.com/jmespath/jmespath.php/security/advisories/GHSA-pcw8-m77r-2528
  • nvd.nist.gov/vuln/detail/CVE-2026-54133

Code Behaviors & Features

Detect and mitigate CVE-2026-54133 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 2.9.1

Fixed versions

  • 2.9.1

Solution

Upgrade to version 2.9.1 or above.

Impact 9.8 CRITICAL

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-116: Improper Encoding or Escaping of Output
  • CWE-20: Improper Input Validation
  • CWE-94: Improper Control of Generation of Code ('Code Injection')

Source file

packagist/mtdowling/jmespath.php/CVE-2026-54133.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 06 Sep 2026 12:17:25 +0000.