upatch.dev

CVE-2026-77414

JSONata: Arbitrary Code Execution via crafted JSONata expressions

Refuses subprocess execution from Node.js processes to mitigate JSONata arbitrary code execution CVE-2026-77414.

Critical 9.3Vetted

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

At a glance

CVE-2026-77414 is a critical (CVSS 9.3) vulnerability in JSONata, published 21 August 2026. A vetted upatch, cve-2026-77414-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.6% 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-77414, "Arbitrary Code Execution via crafted JSONata expressions" (GHSA-2943-5xfg-gq5f), was published on 21 August 2026. Prior to JSONata 1.8.8 and 2.2.1, the src/jsonata.js environment.lookup function used a bypassable hasOwnProperty check (bindings.hasOwnProperty(name)). Crafted JSONata expressions could use $hasOwnProperty, $spread, $string, prototype access, and $constructor to reach the JavaScript Function constructor and invoke process.getBuiltinModule('child_process') to execute arbitrary OS 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, the src/jsonata.js environment.lookup function used a bypassable hasOwnProperty check. Crafted expressions could use $hasOwnProperty, $spread, $string, prototype access, and $constructor to reach the object prototype and invoke process.getBuiltinModule with child_process, executing arbitrary 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 to 2.2.0 2.2.1
1.x prior to 1.8.8 1.8.8

Kernels: any Linux kernel supported by shirudo with BPF LSM and BTF enabled (lsm/bprm_check_security takes struct linux_binprm *bprm).

Sources

More references from NVD (5)

Mitigation

One BPF LSM 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:

Hook Refused
lsm/bprm_check_security Executing a new program (execve / execveat) when the calling process executable is node

JSONata is an in-process JSON query and transformation library that never spawns child processes during normal expression evaluation. When a crafted expression reaches Function and calls child_process to spawn a shell or external binary, the kernel calls security_bprm_check() in the forked child before replacing its mm->exe_file (node). The upatch refuses that transition with -EPERM, while leaving every other process on the machine (such as sshd, bash, and system services) untouched. A refusal from an earlier BPF LSM program on the same hook is preserved.

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

Side effects

  • Any node process on the machine cannot spawn external child processes via execve (for example through Node's child_process.execSync, child_process.execFileSync, or child_process.spawn).
  • Pure JavaScript evaluation, JSONata queries and transformations, network I/O, and file system operations inside Node.js continue to work normally.
  • Not covered: in-process actions that do not call execve (such as reading or writing files directly through Node's fs module), or a Node.js runtime binary renamed to something other than node.

Preemption model and cost

The program keeps no shared state beyond the per-CPU refusal counter, which it updates with __sync_fetch_and_add, so it is safe under every preemption model including preemptible RCU (PREEMPT_LAZY, PREEMPT_DYNAMIC) and PREEMPT_RT. The hook runs only on execve, not on file opens or syscalls at large, and checks d_name.len == 4 on the current task's executable dentry before reading the 4-byte name.

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 name_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 name_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_77414_exec_block, 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 2026CommitCommitted directlyAdd CVE-2026-77414romanlab

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

Evidence

On a vulnerable JSONata 2.2.0 service running on Node.js, the loaded upatch refused child process execution triggered through the environment.lookup prototype bypass while normal JSONata evaluation continued to work.

Tested
25 Nov 2026
Target
JSONata 2.2.0 on Node.js, evaluating expressions over HTTP on 127.0.0.1:18080
Kernel
7.4-shirudo-ci-20261123
Architecture
x86_64
Distribution
Ubuntu 26.04
Results
StateCrafted expression spawns /bin/trueNormal JSONata expression evaluation
Before loadingyes (reached)yes
Upatch loadedno (blocked with EPERM)yes
After unloadingyes (reached)yes
tools-test.log Output of tools/test --setup showing the probe reached before loading, blocked while the upatch was loaded, and reached again after unloading.
tools/test --setup, 2026-11-25T13:53:21Z
Target: shirudo test VM, Linux 7.4-shirudo-ci-20261123, x86_64, swtpm
cve-2026-77414
  setup   done         JSONATA_URL=http://127.0.0.1:18080
  before  reached      JSONata expression reached Function constructor and spawned /bin/true
  loaded  blocked      child process execution from node was refused with EPERM while normal evaluation succeeded
  after   reached      JSONata expression reached Function constructor and spawned /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-77414
Publish and roll out
shirudo bpm push build/packages/cve-2026-77414-1.0.0.bee oci://<registry>/<namespace>/cve-2026-77414 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-77414-1.0.0.bee oci://<registry>/<namespace>/<tree> --tree-id <tree-id> --keys-dir <keys-dir>