Aug 21, 2026·7 min read·159 visits
A critical vulnerability in JSONata permits attackers to bypass query sandbox isolation and achieve remote code execution by shadowing local lookup methods and traversing the prototype chain.
CVE-2026-77414 (GHSA-2943-5xfg-gq5f) is a critical sandbox escape and remote code execution vulnerability in the JSONata package. When JSONata processes untrusted expressions, it uses a vulnerable environment lookup check that can be shadowed by user-defined variables. Attackers can leverage this to traverse the prototype chain, reach the global Function constructor, and execute arbitrary system commands on the host machine.
JSONata is a domain-specific query and transformation language widely embedded in Node.js applications to execute structured operations over JSON payloads. The interpreter is designed to execute queries safely without granting direct access to the underlying JavaScript execution environment. To maintain safety, JSONata relies on an internal sandbox that isolates the query execution runtime from the global JavaScript scope.
This security boundary is compromised when users can query, read, or modify administrative properties belonging to the runtime environment. In typical web applications, JSONata is used in back-end microservices, integration platforms, and API gateways where users supply custom query templates to shape application outputs. If an attacker can inject queries that escape the sandbox, they can interact directly with the Node.js runtime process.
CVE-2026-77414 identifies a vulnerability where JSONata's internal scope-tracking implementation fails to protect internal properties of JavaScript objects during variable resolution. By manipulating the variable binding mechanism, an attacker can traverse the JavaScript prototype chain. This prototype chain traversal leads to a complete sandbox escape, enabling arbitrary code execution on the hosting system.
The root cause of this vulnerability lies in how JSONata manages execution frames and resolves variable names inside the src/jsonata.js module. Every variable definition or query execution context is tracked using standard environment frames initialized by the internal createFrame function. This function initializes a local context bindings map using a standard JavaScript object literal (var bindings = {}).
Because bindings is instantiated as a standard object literal, it inherits properties from Object.prototype, including native methods like hasOwnProperty, toString, and constructor. To verify if a variable lookup request is defined within the local frame, the lookup mechanism invokes bindings.hasOwnProperty(name). This implementation assumes that the hasOwnProperty property on the bindings object will always resolve to the native Object.prototype.hasOwnProperty function.
However, JSONata allows dynamic variable assignment within the query expression itself. An attacker can assign a custom value to a variable named hasOwnProperty, which shadows the native method on the bindings object. When the evaluator subsequently invokes bindings.hasOwnProperty(name), it executes the user-defined value instead of the native method, causing the existence check to bypass or fail. This lookup failure allows the evaluator to skip the frame boundary check and fall back to searching the prototype chain for the requested key.
The remediation of CVE-2026-77414 required rewriting how frame scopes are initialized and how property lookups are performed. The primary fix is implemented in commit 59e25144fc3b7125f6befd71b8a6e14e1fa610d2. The vulnerable initialization of the bindings map as a standard object literal was refactored to use Object.create(null). This creates a prototype-free object, completely severing any inheritance from Object.prototype.
// VULNERABLE CODE
function createFrame(enclosingEnvironment) {
var bindings = {}; // Regular object inheriting Object.prototype
const newFrame = {
bind: function (name, value) {
bindings[name] = value;
},
lookup: function (name) {
var value;
if(bindings.hasOwnProperty(name)) { // Vulnerable direct check
value = bindings[name];
} else if (enclosingEnvironment) {
value = enclosingEnvironment.lookup(name);
}
return value;
}
};
return newFrame;
}// PATCHED CODE
function createFrame(enclosingEnvironment) {
var bindings = Object.create(null); // Secure: Prototype-free map
const newFrame = {
bind: function (name, value) {
bindings[name] = value;
},
lookup: function (name) {
var value;
// Secure lookup: explicit call to prototype-safe method
if(Object.prototype.hasOwnProperty.call(bindings, name)) {
value = bindings[name];
} else if (enclosingEnvironment) {
value = enclosingEnvironment.lookup(name);
}
return value;
}
};
return newFrame;
}In addition to secure variable maps, secondary commits protected internal evaluation pathways. Commit 47c0e58542202c705726663166dbee5fcae47d06 blocks wildcard queries from extracting internal structures of function objects. Commit f174348c7fa30f271b63ddedf0767e814004bc4d introduces a check that prevents users from manually passing objects containing internal fields like _jsonata_lambda or _jsonata_function. Together, these patches ensure that attackers cannot spoof internal runtime abstractions.
Exploitation of CVE-2026-77414 requires the attacker to construct a query that pollutes the frame bindings map and redirects variable resolution to the prototype chain. The initial step is to shadow the lookup method by binding a custom variable: $hasOwnProperty := $spread($string). This variable assignment overwrites the identifier hasOwnProperty in the local frame, disrupting the standard evaluation of the bindings.hasOwnProperty(name) condition.
Once the native method is shadowed, subsequent lookups bypass local boundaries. The evaluator allows access to prototype-inherited identifiers, resolving the custom query variable $constructor to the native Object.prototype.constructor function. The attacker can then invoke this constructor dynamically to generate arbitrary JavaScript functions in the host runtime context.
import jsonata from 'jsonata';
// A crafted expression bypassing the environment lookup check
const expression = jsonata(`
(
$hasOwnProperty := $spread($string);
$__proto__ := $constructor;
$constructor("return process.getBuiltinModule('child_process').execSync('id',{stdio:'inherit'})")();
)`);
// Triggering evaluation against an empty context
await expression.evaluate({});The final payload invokes the global Function constructor with a body that accesses Node.js's built-in dynamic module import mechanisms. By executing process.getBuiltinModule('child_process').execSync(...), the payload escapes the JSONata virtual machine wrapper and executes system-level terminal commands. The evaluation succeeds without requiring specialized application conditions or authentication states.
The technical impact of this vulnerability is classified as critical, carrying a CVSS v4.0 base score of 9.3. The attack is executable entirely over the network, requires no specific user interaction, and can be initiated by unauthenticated users. It results in a complete loss of confidentiality, integrity, and availability on the hosting server.
When a server-side Node.js application accepts user-defined JSONata expressions for execution, the exploit permits arbitrary shell execution within the container or host operating system. Threat actors can read sensitive configuration files, capture environment variables, and steal database credentials. They can also use local access to pivot into internal cloud environments or connect to remote command-and-control networks.
In serverless and microservice deployments, an attacker can leverage this access to persist inside the runtime, compromise adjacent database instances, or deploy unauthorized payloads. Because the vulnerability results in direct operating system shell execution, any service utilizing vulnerable versions of JSONata must be treated as completely compromised upon exposure.
Remediation requires upgrading the jsonata NPM package to a secure release. For deployments operating on the 1.x branch, the secure backported version is 1.8.8. Deployments on the 2.x branch must upgrade to version 2.2.1 or higher. Applications should automate dependency checks using audit tools to detect vulnerable instances.
If immediate software upgrade is not possible, developers should deploy virtual machine isolation or low-privilege containerization. Running Node.js instances within gVisor, Firecracker, or strict Linux namespaces limits the blast radius of any system-level execution. Additionally, untrusted user inputs should not be processed directly by the JSONata evaluator if possible.
Security teams must also implement egress filtering on databases and application servers. Restricting outbound network connections prevents escaped web shells from downloading additional malware or communicating with command-and-control servers, disrupting the final stages of a potential exploit attempt.
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N| Product | Affected Versions | Fixed Version |
|---|---|---|
jsonata JSONata | < 1.8.8 | 1.8.8 |
jsonata JSONata | >= 2.0.0 < 2.2.1 | 2.2.1 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-94 |
| Attack Vector | Network |
| CVSS v4.0 | 9.3 (Critical) |
| Impact | Remote Code Execution (RCE) / Sandbox Escape |
| Exploit Status | Proof-of-Concept |
| KEV Status | Not Listed |
The software constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes the input before the code segment is executed.
GeoNode versions prior to 5.0.3 contain an unrestricted file upload vulnerability (CWE-434) within the document and dataset ingestion architecture. Authenticated low-privileged users can bypass upload validation via direct REST API interactions, file extension masquerading, metadata mutation via PATCH requests, or malicious archive submissions. This allows attackers to store and serve dangerous file types, alter on-disk file references, or trigger path traversal and resource exhaustion during archive extraction.
CVE-2026-55649 is a stored Cross-Site Scripting (XSS) vulnerability in GeoNode versions prior to 5.0.3. The flaw exists because document abstract metadata fields are ingested via the metadata management pipeline and stored in the backend database without HTML sanitization or input neutralization. An authenticated attacker with privileges to create or edit document metadata can inject arbitrary HTML and JavaScript payloads into these fields. When another user, such as an administrator, views the affected document page or catalog listing, the unencoded payload is rendered into the Document Object Model (DOM) and executes within the victim's browser session.
CVE-2026-55622 (GHSA-qx75-2p3r-pwm5) is an improper access control vulnerability (CWE-284) in Canonical LXD and LXC Incus (tracked as GHSA-c9f5-j9c3-mhrg). In multi-tenant deployments utilizing project-based isolation, the REST API handler for instance creation via POST /1.0/instances verifies that the authenticated user has authorization in the destination project specified by the query parameter, but fails to verify whether the user holds read or view permissions for the source instance when executing a copy operation across projects. Consequently, an authenticated client restricted to a single project can clone instances or snapshots from unauthorized projects into their own project, resulting in complete disclosure of the target instance filesystem and embedded credentials.
An authorization bypass vulnerability in Canonical LXD (tracked as GHSA-7mr3-28h5-m5vx and CVE-2026-55621, and as GHSA-64f3-v33m-w89f in Linux Containers Incus) allows an authenticated user with restricted project access to copy custom storage volumes and volume snapshots from unauthorized projects. The flaw resides in the storagePoolVolumesPost REST API handler, which verifies permissions on the destination project but fails to check whether the caller holds view entitlements on the source project or volume specified in the request body.
A missing authorization and configuration validation vulnerability in Canonical LXD and LXC Incus allows authenticated users within restricted projects to bypass project security boundaries. By smuggling prohibited low-level configuration directives (such as raw.lxc or raw.qemu) inside instance snapshots or backup archives, an attacker can restore these configurations within a restricted project and execute arbitrary commands with root privileges on the underlying host operating system.
A symbolic link traversal vulnerability (CWE-59) in Canonical LXD and Linux Containers Incus allows an authenticated user with image import permissions to read and write arbitrary files on the host filesystem. During image archive unpacking, the daemon fails to reject top-level symbolic links for the instance `templates` directory. Subsequent requests to the instance template API endpoints follow this symbolic link outside the instance storage directory with root privileges, enabling complete host compromise.