Arbitrary Code Execution in JSONata
The JSONata library contains a critical vulnerability (CVE-2026-77415) allowing unauthenticated attackers to achieve arbitrary code execution via maliciously crafted JSONata expressions.
CVE search metadata
CVE search record: CVE-2026-77415. KEV: no. Product: jsonata (>= 2.0.0, < 2.2.1), jsonata (< 1.8.8), jsonata (2.0.0 to 2.2.0). Brief: Arbitrary Code Execution in JSONata. Brief link: https://feed.craftedsignal.io/briefs/2026-08-jsonata-rce/
What's new
- 1. added coverage for jsonata (2.0.0 to 2.2.0) +1 products Aug 22, 01:16 via ghsa
JSONata versions prior to 2.2.1 and 1.8.8 are vulnerable to arbitrary code execution due to flaws in how the library processes and executes transformation expressions. An attacker can chain three specific vulnerabilities to escape the sandboxed environment: the ability to overwrite the internal $clone function, the ability to destruct internal JSONata lambdas, and an unsafe implementation of forEach within the applyProcedure function. By manipulating these primitives, an attacker can prototype-pollute the execution context and access Node.js built-in modules, such as child_process. This allows the execution of arbitrary system commands on the host running the JSONata engine. This vulnerability, tracked as CVE-2026-77415, poses a significant risk to applications that process untrusted user-supplied JSONata expressions.
Attack Chain
- Attacker identifies an application endpoint that accepts and evaluates user-provided JSONata expressions.
- Attacker submits a crafted JSONata payload that overwrites the
$clonefunction to permit object mutation. - Attacker uses
$mergeto destruct internal JSONata functions or lambdas, enabling access to the execution context. - Attacker performs prototype pollution using the manipulated objects to access
__lookupGetter__. - Attacker exploits the unsafe
forEachimplementation inapplyProcedureto further refine the execution environment. - Attacker leverages the modified environment to bridge into the Node.js runtime and access the
child_processbuilt-in module. - Attacker executes system-level commands, such as
execSync('sh'), to achieve full remote code execution.
Impact
Successful exploitation of CVE-2026-77415 allows for complete system compromise on any server running vulnerable versions of the JSONata library. The vulnerability affects all applications that allow users to submit dynamic JSONata queries, including data processing platforms, API transformation layers, and automation engines. Organizations using vulnerable versions should prioritize patching to 2.2.1 or 1.8.8 immediately to mitigate the risk of arbitrary command execution.
Recommendation
- Update the jsonata package to version 2.2.1 or 1.8.8 across all affected applications immediately.
- Implement strict input validation or sandboxing for any interface that evaluates user-supplied JSONata expressions.
- Scan dependencies to identify all instances of the vulnerable jsonata package within the software supply chain.
Immediate actions
Upgrade jsonata dependency to v2.2.1 or v1.8.8
Mitigations
Identify applications evaluating user-supplied JSONata expressions
CVE-2026-77415