Advisories for Npm/Jsonata package

2026

JSONata: Arbitrary Code Execution via crafted JSONata expressions

Before JSONata 2.2.0 and 1.8.8 it was possible to execute arbitrary code with crafted expressions, due to a missing hasOwnProperty check in the lookup function: https://github.com/jsonata-js/jsonata/blob/f9632e01e6e67d4f9f00593f9795420cb4b57f48/src/functions.js#L1686-L1705 This was fixed with https://github.com/jsonata-js/jsonata/pull/794, which is included in the 2.2.0 release, and ported in the 1.8.8 release.

JSONata vulnerable to Arbitrary Code Execution via crafted JSONata expressions

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) it being possible to destruct jsonata functions/lambdas (e.g. $merge.*) applyProcedure 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 …

jsonata: Function Binding Prototype Pollution via hasOwnProperty Override

A weakness has been identified in jsonata-js jsonata up to 2.2.0. The affected element is the function createFrame of the file src/jsonata.js of the component Function Binding Frame System. This manipulation causes improperly controlled modification of object prototype attributes. It is possible to initiate the attack remotely. The exploit has been made available to the public and could be used for attacks. The vendor was contacted early about this disclosure …

2024

JSONata expression can pollute the "Object" prototype

Impact In JSONata versions >= 1.4.0, < 1.8.7 and >= 2.0.0, < 2.0.4, a malicious expression can use the transform operator to override properties on the Object constructor and prototype. This may lead to denial of service, remote code execution or other unexpected behavior in applications that evaluate user-provided JSONata expressions. Patch This issue has been fixed in JSONata versions >= 1.8.7 and >= 2.0.4. Applications that evaluate user-provided expressions …