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

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

## At a glance

CVE-2026-77415 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.9%: the estimated chance it is exploited in the next 30 days, as of 24 Nov 2026. The upatch `cve-2026-77415-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-77415 (GHSA-66mm-25pp-rfff), published on 21 August 2026, is an arbitrary code execution vulnerability in JSONata prior to versions 1.8.8 and 2.2.1. Crafted JSONata expressions can chain several object-integrity weaknesses: overwriting `$clone` to mutate objects through `evaluateTransformExpression`, exposing and deconstructing JSONata functions or lambdas through `$merge.*` and wildcard operators (`*` and `**`), setting reserved internal evaluator properties (`_jsonata_function` and `_jsonata_lambda`) in object constructors, replacing `proc.arguments.forEach` used by `applyProcedure`, and forging internal lambda state. Chaining these primitives allows an expression to reach prototype getters, prototype and constructor access, and `process.getBuiltinModule` with `child_process`, executing arbitrary 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.1, crafted JSONata expressions could chain several object-integrity weaknesses to execute arbitrary code. The chain could overwrite $clone to mutate objects through evaluateTransformExpression, expose and deconstruct JSONata functions or lambdas through $merge.\*, replace proc.arguments.forEach used by applyProcedure, and forge internal lambda state. These primitives allowed an attacker to reach prototype getters, prototype and constructor access, and process.getBuiltinModule with child_process, executing code with the privileges of the host process. This issue is fixed in versions 1.8.8 and 2.2.1.

## What the upatch does

The program attaches to `lsm/bprm_check_security` and returns `-EPERM` when the calling task's executable (`current->mm->exe_file->f_path.dentry`) is named `node`. When an expression exploits CVE-2026-77415 to load `child_process` via `process.getBuiltinModule` and spawn a command, the kernel invokes `bprm_check_security` for the child process while its executable is still `node` (before the new binary replaces `mm->exe_file`). Returning `-EPERM` aborts the `execve` system call. Any refusal from an earlier BPF LSM program on the same hook is preserved.

The `refused` per-CPU array map counts refused execution attempts at key 0.

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

## Side effects

- Any process whose executable is named `node` cannot execute child programs (`execve` fails with `EPERM`). JSONata query and transformation evaluation itself runs entirely in JavaScript within the Node.js process and never spawns external programs.
- Other Node.js workloads on the same machine that legitimately spawn subprocesses through `child_process` will also have their `execve` calls refused while the upatch is loaded.
- Non-command post-exploitation actions inside the Node.js process (such as reading or writing files directly through `fs`) are not blocked by this hook.

## Preemption model and cost

The program keeps no state beyond a single per-CPU counter updated with an atomic fetch-and-add (`__sync_fetch_and_add`), making it safe under every kernel preemption model, including `PREEMPT_LAZY`, preemptible RCU, and `PREEMPT_RT`. It runs only on `execve` calls (`bprm_check_security`), where it reads the length of `current->mm->exe_file->f_path.dentry->d_name` first and returns immediately whenever the executable name is not 4 bytes long.

## Affected versions

JSONata:

| Branch | Affected          | Fixed in |
| ------ | ----------------- | -------- |
| 2.x    | >= 2.0.0, < 2.2.1 | 2.2.1    |
| 1.x    | < 1.8.8           | 1.8.8    |

Kernels: any Linux kernel with BPF LSM and BTF support that provides the `bprm_check_security` LSM hook.

## How it was tested

On a Node.js service running vulnerable JSONata 2.2.0, the loaded upatch refused child_process execution of /bin/true with EPERM while normal JSONata query evaluation continued to return the expected result.

- **Tested:** 25 Nov 2026
- **Target:** JSONata 2.2.0 on Node.js listening on 127.0.0.1:18080
- **Kernel:** 7.4-shirudo-ci-20261123
- **Architecture:** x86_64
- **Distribution:** Ubuntu 26.04

### Results

| State           | Unwrapped lambda probe ($merge.\*) and child_process exec (/bin/true) | Normal JSONata query ($sum(\[1, 2, 3])) |
| --------------- | --------------------------------------------------------------------- | --------------------------------------- |
| Before loading  | reached                                                               | 6 (HTTP 200)                            |
| Upatch loaded   | blocked (EPERM)                                                       | 6 (HTTP 200)                            |
| After unloading | reached                                                               | 6 (HTTP 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-77415
```

Publish and roll out:

```sh
shirudo bpm push build/packages/cve-2026-77415-1.0.0.bee oci://<registry>/<namespace>/cve-2026-77415 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-77415-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-77415 record (CVE API)](https://cveawg.mitre.org/api/cve/CVE-2026-77415)
- [GitHub Security Advisory GHSA-66mm-25pp-rfff](https://github.com/jsonata-js/jsonata/security/advisories/GHSA-66mm-25pp-rfff)
- [Pull Request #799: Prevent object prototype pollution](https://github.com/jsonata-js/jsonata/pull/799) ([commit 59e2514](https://github.com/jsonata-js/jsonata/commit/59e25144fc3b7125f6befd71b8a6e14e1fa610d2), [commit f09df84](https://github.com/jsonata-js/jsonata/commit/f09df8416eab8ff44926fc6527c80fb8701de159))
- [Pull Request #800: Wildcards should not unwrap function objects](https://github.com/jsonata-js/jsonata/pull/800) ([commit 47c0e58](https://github.com/jsonata-js/jsonata/commit/47c0e58542202c705726663166dbee5fcae47d06))
- [Pull Request #802: Prevent object contructor setting internal flags](https://github.com/jsonata-js/jsonata/pull/802) ([commit f174348](https://github.com/jsonata-js/jsonata/commit/f174348c7fa30f271b63ddedf0767e814004bc4d))
- [Backport commit 4b217d5 for v1](https://github.com/jsonata-js/jsonata/commit/4b217d514376e30cba278941298d7ba97c4a6c6e)
- [Release v2.2.1](https://github.com/jsonata-js/jsonata/releases/tag/v2.2.1) and [Release v1.8.8](https://github.com/jsonata-js/jsonata/releases/tag/v1.8.8)

### Links

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

### More references from NVD (11)

- [github.com](https://github.com/jsonata-js/jsonata/commit/47c0e58542202c705726663166dbee5fcae47d06)
- [github.com](https://github.com/jsonata-js/jsonata/commit/4b217d514376e30cba278941298d7ba97c4a6c6e)
- [github.com](https://github.com/jsonata-js/jsonata/commit/59e25144fc3b7125f6befd71b8a6e14e1fa610d2)
- [github.com](https://github.com/jsonata-js/jsonata/commit/f09df8416eab8ff44926fc6527c80fb8701de159)
- [github.com](https://github.com/jsonata-js/jsonata/commit/f174348c7fa30f271b63ddedf0767e814004bc4d)
- [github.com](https://github.com/jsonata-js/jsonata/pull/799)
- [github.com](https://github.com/jsonata-js/jsonata/pull/800)
- [github.com](https://github.com/jsonata-js/jsonata/pull/802)
- [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.1)
- [github.com](https://github.com/jsonata-js/jsonata/security/advisories/GHSA-66mm-25pp-rfff)
