# CVE-2026-77413: JSONata: Arbitrary Code Execution via crafted JSONata expressions

The Markdown version of <https://upatch.dev/cve/CVE-2026-77413>. Last updated 25 Nov 2026.

## At a glance

CVE-2026-77413 is rated Critical 9.3 (CVSS 4.0, 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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X). It affects JSONata (jsonata-js) and was published on 21 Aug 2026. It is not in CISA's Known Exploited Vulnerabilities catalog. Its EPSS score is 0.7%: the estimated chance it is exploited in the next 30 days, as of 24 Nov 2026. The upatch `cve-2026-77413-exec-block` mitigates it, and is vetted (merged into the registry).

A upatch is a signed BPF program that shirudo loads into a running Linux kernel to block the code path this CVE's exploit takes. It holds the line until the fix ships; it does not replace patching.

## The vulnerability

CVE-2026-77413 (GHSA-8gq3-vp5j-2grp), published on 21 August 2026, is a code injection vulnerability in JSONata prior to versions 1.8.8 and 2.2.0. The `lookup` function in `src/functions.js` lacked an `Object.prototype.hasOwnProperty` check when reading object properties, allowing crafted JSONata expressions to access inherited `Object.prototype` members such as `__lookupSetter__`, `__defineGetter__`, `constructor`, and `valueOf`. An attacker supplying a JSONata expression to a Node.js service can traverse the prototype chain to the `Function` constructor, call `process.getBuiltinModule('child_process')`, and spawn arbitrary operating system commands with the privileges of the host Node.js process.

### Official description

JSONata is a JSON query and transformation language. Prior to 1.8.8 and 2.2.0, the src/functions.js lookup function lacked an Object.prototype.hasOwnProperty check and allowed crafted expressions to access inherited prototype members. An attacker able to supply an expression could use inherited prototype setters and getters, constructor access, valueOf, and process.getBuiltinModule to reach the child_process module and execute arbitrary code with the privileges of the host process. This issue is fixed in versions 1.8.8 and 2.2.0.

## What the upatch does

The BPF LSM program attaches to `lsm/bprm_check_security` and checks whether the current task's executable (`task->mm->exe_file->f_path.dentry`) is named `node`. When a `node` process attempts to execute a new program (such as a child process spawned via Node.js `child_process`), the hook increments the per-CPU `refused` counter map at key 0 and returns `-EPERM`. Any non-zero refusal returned by an earlier BPF LSM program on the same hook is preserved.

The policy: [`cve-2026-77413-exec-block.bpf.c`](https://github.com/copper-helm/upatch-registry/tree/main/upatches/cve-2026-77413), 64 lines of BPF C attached at `lsm/bprm_check_security`, licensed GPL-2.0 OR BSD-2-Clause.

## Side effects

- Any `node` process on the machine cannot execute external binaries via `execve` or `execveat` (for example through `child_process.execSync`, `child_process.execFileSync`, `child_process.spawn`, or `child_process.exec`).
- In-process JavaScript execution and JSONata expression evaluation inside Node.js continue to work normally without restarting the service.
- Other processes on the machine, including shells, package managers, and system daemons, are unaffected.

## Preemption model and cost

The program keeps no shared state beyond a single-entry per-CPU counter map (`refused`), updated with `__sync_fetch_and_add`, making it safe under all preemption models including preemptible RCU, `PREEMPT_LAZY`, and `PREEMPT_RT`. It runs only on `execve` / `execveat` calls (`bprm_check_security`), checks the 4-byte length of the current executable's dentry name first, and returns immediately for all non-`node` processes.

## Affected versions

The vulnerability is in the JSONata JavaScript library:

| Branch | Affected       | Fixed in |
| ------ | -------------- | -------- |
| 1.x    | <= 1.8.7       | 1.8.8    |
| 2.x    | 2.0.0 to 2.1.0 | 2.2.0    |

The upatch runs on any Linux kernel supported by shirudo with BPF LSM and BTF enabled.

## How it was tested

On a vulnerable JSONata 2.1.0 service on Node.js, the loaded upatch refused child process execution with EPERM while normal JSONata expression evaluation continued to work.

- **Tested:** 25 Nov 2026
- **Target:** JSONata 2.1.0 on Node.js, HTTP expression evaluation service on 127.0.0.1:18080
- **Kernel:** 7.4-shirudo-ci-20261123
- **Architecture:** x86_64
- **Machine:** shirudo test VM
- **Distribution:** Ubuntu 26.04

### Results

| State           | Child process execution via JSONata prototype access | Normal JSONata expression evaluation |
| --------------- | ---------------------------------------------------- | ------------------------------------ |
| Before loading  | reached                                              | 200                                  |
| Upatch loaded   | blocked (EPERM)                                      | 200                                  |
| After unloading | reached                                              | 200                                  |

## How to apply

Build the upatch from source, sign it with your own shirudo key, and publish it to your own OCI registry. Machines that follow your upatch tree load it within about a minute.

Build and sign:

```sh
git clone https://github.com/copper-helm/upatch-registry
cd upatch-registry
tools/build <shirudo-checkout> <keys-dir> 1.0.0 upatches/cve-2026-77413
```

Publish and roll out:

```sh
shirudo bpm push build/packages/cve-2026-77413-1.0.0.bee oci://<registry>/<namespace>/cve-2026-77413 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-77413-1.0.0.bee oci://<registry>/<namespace>/<tree> --tree-id <tree-id> --keys-dir <keys-dir>
```

## Review

- Contributors: romanlab.
- Reviewers: none recorded yet.

## Sources and links

- [CVE-2026-77413 record (CVE API)](https://cveawg.mitre.org/api/cve/CVE-2026-77413)
- [GitHub Security Advisory GHSA-8gq3-vp5j-2grp](https://github.com/jsonata-js/jsonata/security/advisories/GHSA-8gq3-vp5j-2grp)
- [Pull request #794: prevent $lookup from accessing object prototype members](https://github.com/jsonata-js/jsonata/pull/794)
- [Fix commits 4c5f4adfb90a (v2.2.0)](https://github.com/jsonata-js/jsonata/commit/4c5f4adfb90a9b500889d50f90050ca68888b50d) and [4b217d514376 (v1.8.8)](https://github.com/jsonata-js/jsonata/commit/4b217d514376e30cba278941298d7ba97c4a6c6e)
- [Release v2.2.0](https://github.com/jsonata-js/jsonata/releases/tag/v2.2.0) and [Release v1.8.8](https://github.com/jsonata-js/jsonata/releases/tag/v1.8.8)

### Links

- [CVE-2026-77413 on upatch.dev](https://upatch.dev/cve/CVE-2026-77413) (this page, as HTML)
- [NVD](https://nvd.nist.gov/vuln/detail/CVE-2026-77413)
- [CVE.org](https://www.cve.org/CVERecord?id=CVE-2026-77413)
- [CWE-94](https://cwe.mitre.org/data/definitions/94.html)
- Upatch source: [upatches/cve-2026-77413](https://github.com/copper-helm/upatch-registry/tree/main/upatches/cve-2026-77413)

### More references from NVD (6)

- [github.com](https://github.com/jsonata-js/jsonata/commit/4b217d514376e30cba278941298d7ba97c4a6c6e)
- [github.com](https://github.com/jsonata-js/jsonata/commit/4c5f4adfb90a9b500889d50f90050ca68888b50d)
- [github.com](https://github.com/jsonata-js/jsonata/pull/794)
- [github.com](https://github.com/jsonata-js/jsonata/releases/tag/v1.8.8)
- [github.com](https://github.com/jsonata-js/jsonata/releases/tag/v2.2.0)
- [github.com](https://github.com/jsonata-js/jsonata/security/advisories/GHSA-8gq3-vp5j-2grp)
