upatch.dev

CVE-2026-77415

JSONata: Arbitrary Code Execution via crafted JSONata expressions

Refuses program execution by Node.js processes to mitigate CVE-2026-77415 in JSONata.

Critical 9.3Vetted

EPSS 0.9%: the estimated chance this CVE is exploited in the next 30 days, as of 24 Nov 2026.

At a glance

CVE-2026-77415 is a critical (CVSS 9.3) vulnerability in JSONata, published 21 August 2026. A vetted upatch, cve-2026-77415-exec-block, blocks it on running Linux machines with shirudo until JSONata is upgraded.

Severity
Critical 9.3 CVSS 4.0
Chance of exploitation
0.9% in the next 30 days (EPSS, 24 Nov 2026)
Known exploited
No, not on CISA’s KEV list
Weakness
CWE-94
Affected software
JSONata (jsonata-js)
Upatch status
Vetted, merged into the registry
How to apply
Build, sign and roll out with shirudo

Overview

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.

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.

Sources

More references from NVD (11)

Mitigation

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.

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.

The policy

64 lines of BPF C, attached at lsm/bprm_check_security.

// SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause

#include "vmlinux.h"
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_tracing.h>
#include <bpf/bpf_core_read.h>

#define EPERM 1

char _license[] SEC("license") = "Dual BSD/GPL";

struct {
	__uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
	__uint(max_entries, 1);
	__type(key, __u32);
	__type(value, __u64);
} refused SEC(".maps");

static __always_inline void count_refused(void)
{
	__u32 key = 0;
	__u64 *value = bpf_map_lookup_elem(&refused, &key);

	if (value)
		__sync_fetch_and_add(value, 1);
}

static __always_inline bool dentry_is_node(const struct dentry *dentry)
{
	const unsigned char *name = BPF_CORE_READ(dentry, d_name.name);
	char buf[8] = {};

	if (!dentry || BPF_CORE_READ(dentry, d_name.len) != 4)
		return false;
	if (bpf_probe_read_kernel_str(buf, sizeof(buf), name) < 0)
		return false;
	return buf[0] == 'n' && buf[1] == 'o' && buf[2] == 'd' &&
	       buf[3] == 'e' && buf[4] == '\0';
}

static __always_inline bool current_is_node(void)
{
	struct task_struct *task = bpf_get_current_task_btf();
	const struct dentry *exe = BPF_CORE_READ(task, mm, exe_file, f_path.dentry);

	return dentry_is_node(exe);
}

static __always_inline int earlier_verdict(int ret)
{
	return ret >= -4095 && ret < 0 ? ret : -EPERM;
}

SEC("lsm/bprm_check_security")
int BPF_PROG(cve_2026_77415_exec, struct linux_binprm *bprm, int ret)
{
	if (ret)
		return earlier_verdict(ret);
	if (!current_is_node())
		return 0;
	count_refused();
	return -EPERM;
}

Process

How this upatch was written, checked and reviewed, from the registry’s history.

  1. 21 Aug 2026CVECVE published
  2. 25 Nov 2026Pull requestPull request #33 openedAdd CVE-2026-77415: Refuses program execution by Node.js processes to mitigate CVE-2026-77415 inromanlab
  3. 25 Nov 2026MergeMerged #33romanlab
  4. 25 Nov 2026ReviewReviewedqodo-code-review[bot] (automated)

No human review is recorded on GitHub for this upatch yet.

Evidence

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
StateUnwrapped lambda probe ($merge.*) and child_process exec (/bin/true)Normal JSONata query ($sum([1, 2, 3]))
Before loadingreached6 (HTTP 200)
Upatch loadedblocked (EPERM)6 (HTTP 200)
After unloadingreached6 (HTTP 200)
tools-test.log Output of tools/test --setup on the shirudo test VM showing before, loaded and after results.
tools/test --setup, 2026-11-25T11:38:17Z
Target: shirudo test VM, Linux 7.4-shirudo-ci-20261123, x86_64, swtpm
cve-2026-77415
  setup   done         JSONATA_URL=http://127.0.0.1:18080
  before  reached      JSONata exposed function internals on $merge.* and node executed /bin/true
  loaded  blocked      node child_process execution of /bin/true refused with EPERM while normal query returned 6
  after   reached      JSONata exposed function internals on $merge.* and node executed /bin/true
  PASS: reached before, blocked while loaded, reached again after

Use it

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
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
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>