GHSA-PCW8-M77R-2528
Vulnerability from github – Published: 2026-08-18 20:16 – Updated: 2026-08-18 20:16Impact
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:
- An application accepts or constructs a JMESPath expression using attacker-controlled input.
- The expression is evaluated with
JmesPath\CompilerRuntime, or withJmesPath\search()whileJP_PHP_COMPILEis enabled. - The crafted expression uses a non-identifier value where the parser accepts a function callee.
- The compiler writes that value into generated PHP source without safely escaping it as a PHP string literal.
- The generated source is written to the compiled-expression cache directory.
CompilerRuntimeloads the generated cache file.- 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.
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "mtdowling/jmespath.php"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2.9.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-54133"
],
"database_specific": {
"cwe_ids": [
"CWE-116",
"CWE-20",
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2026-08-18T20:16:38Z",
"nvd_published_at": "2026-06-12T15:16:31Z",
"severity": "CRITICAL"
},
"details": "## Impact\n\n`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.\n\nA vulnerable flow is:\n\n1. An application accepts or constructs a JMESPath expression using attacker-controlled input.\n2. The expression is evaluated with `JmesPath\\CompilerRuntime`, or with `JmesPath\\search()` while `JP_PHP_COMPILE` is enabled.\n3. The crafted expression uses a non-identifier value where the parser accepts a function callee.\n4. The compiler writes that value into generated PHP source without safely escaping it as a PHP string literal.\n5. The generated source is written to the compiled-expression cache directory.\n6. `CompilerRuntime` loads the generated cache file.\n7. The injected PHP executes in the context of the affected application.\n\nIn 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.\n\nThe 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.\n\n## Patches\n\nThe issue is patched in `2.9.1` and later.\n\n## Workarounds\n\nIf 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.",
"id": "GHSA-pcw8-m77r-2528",
"modified": "2026-08-18T20:16:38Z",
"published": "2026-08-18T20:16:38Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/jmespath/jmespath.php/security/advisories/GHSA-pcw8-m77r-2528"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-54133"
},
{
"type": "WEB",
"url": "https://github.com/FriendsOfPHP/security-advisories/blob/master/mtdowling/jmespath.php/CVE-2026-54133.yaml"
},
{
"type": "PACKAGE",
"url": "https://github.com/jmespath/jmespath.php"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "jmespath.php has CompilerRuntime code injection via unescaped function names"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.