CVE-2026-77413
JSONata: Arbitrary Code Execution via crafted JSONata expressions
Refuses execve from Node.js processes to mitigate JSONata arbitrary command execution in CVE-2026-77413.
Critical 9.3Vetted
EPSS 0.7%: the estimated chance this CVE is exploited in the next 30 days, as of 24 Nov 2026.
At a glance
CVE-2026-77413 is a critical (CVSS 9.3) vulnerability in JSONata, published 21 August 2026. A vetted upatch, cve-2026-77413-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.7% 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-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.
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.
Sources
More references from NVD (6)
Mitigation
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.
Side effects
- Any
nodeprocess on the machine cannot execute external binaries viaexecveorexecveat(for example throughchild_process.execSync,child_process.execFileSync,child_process.spawn, orchild_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.
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_77413_exec_block, struct linux_binprm *bprm, int ret)
{
if (ret)
return earlier_verdict(ret);
if (!current_is_node())
return 0;
count_refused();
return -EPERM;
}
The package: name, license, the program and the CVE it fixes.
[package]
name = "cve-2026-77413"
description = "Refuses execve from Node.js processes to mitigate JSONata arbitrary command execution in CVE-2026-77413"
license = "GPL-2.0 OR BSD-2-Clause"
[[upatches]]
source = "cve-2026-77413-exec-block.bpf.c"
[upatches.tree]
id = "cve-2026-77413-exec-block"
fixes = ["CVE-2026-77413"]
Process
How this upatch was written, checked and reviewed, from the registry’s history.
- 21 Aug 2026CVECVE published
- 25 Nov 2026Pull requestPull request #47 openedAdd CVE-2026-77413: Refuses execve from Node.js processes to mitigate JSONata arbitrary commandromanlab
- 25 Nov 2026MergeMerged #47romanlab
- 25 Nov 2026ReviewReviewedqodo-code-review[bot] (automated)
No human review is recorded on GitHub for this upatch yet.
Evidence
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
| 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 |
tools-test.log Output of tools/test --setup showing the payload reaching before and after, and blocked with EPERM while the upatch was loaded.
tools/test --setup, 2026-11-25T12:19:19Z Target: shirudo test VM, Linux 7.4-shirudo-ci-20261123, x86_64, swtpm cve-2026-77413 setup done JSONATA_URL=http://127.0.0.1:18080 before reached lookup accessed inherited Object.prototype member and node executed /bin/true (execFileSync(/bin/true) succeeded) loaded blocked node child process execution was refused (EPERM) after reached lookup accessed inherited Object.prototype member and node executed /bin/true (execFileSync(/bin/true) succeeded) 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.
git clone https://github.com/copper-helm/upatch-registry
cd upatch-registry
tools/build <shirudo-checkout> <keys-dir> 1.0.0 upatches/cve-2026-77413shirudo 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>