GHSA-pcw8-m77r-2528
CRITICALGHSA-pcw8-m77r-2528 is a critical-severity (CVSS 9.8) Improper Input Validation vulnerability in mtdowling/jmespath.php. O3 Security confirms whether GHSA-pcw8-m77r-2528 is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.
jmespath.php has CompilerRuntime code injection via unescaped function names
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- A successful exploit gives an attacker total control of the affected component, not partial access.
Exploitation and automatability from CISA’s SSVC triage for GHSA-pcw8-m77r-2528.
Real-World Exposure
mtdowling/jmespath.phpReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Packagist packages — download data is not available via public APIs for these ecosystems.
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:
- 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 Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐘Packagist | mtdowling/jmespath.php | all versions | 2.9.1 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for mtdowling/jmespath.php. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update mtdowling/jmespath.php to 2.9.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-pcw8-m77r-2528 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether GHSA-pcw8-m77r-2528 is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-pcw8-m77r-2528. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-pcw8-m77r-2528 in your dependencies?
O3 detects GHSA-pcw8-m77r-2528 across Packagist dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.