{"id":"CVE-2024-27307","aliases":["EUVD-2024-0922","GHSA-fqg8-vfv7-8fj8"],"status":"published","title":"JSONata expression can pollute the \"Object\" prototype","description":"JSONata is a JSON query and transformation language. Starting in version 1.4.0 and prior to version 1.8.7 and 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. This issue has been fixed in JSONata versions 1.8.7 and 2.0.4. Applications that evaluate user-provided expressions should update ASAP to prevent exploitation. As a workaround, one may apply the patch manually.","severity":{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-10","score":0.01422,"percentile":0.73091,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-1321"],"published":"2024-03-04T20:43:12Z","modified":"2026-10-28T02:30:22Z","fixes":[{"ecosystem":"npm","package":"jsonata","fixed_in":["1.8.7","2.0.4"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"jsonata","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"1.4.0"},{"fixed":"1.8.7"}]}]},{"source":"ghsa","ecosystem":"npm","package":"jsonata","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.0.0"},{"fixed":"2.0.4"}]}]},{"source":"osv","ecosystem":"npm","package":"jsonata","ranges":[{"type":"SEMVER","events":[{"introduced":"1.4.0"},{"fixed":"1.8.7"}]}]},{"source":"osv","ecosystem":"npm","package":"jsonata","ranges":[{"type":"SEMVER","events":[{"introduced":"2.0.0"},{"fixed":"2.0.4"}]}]}],"products":[{"vendor":"jsonata","product":"jsonata"},{"vendor":"jsonata-js","product":"jsonata"},{"vendor":"jsonatajs","product":"jsonata"}],"references":[{"url":"https://github.com/jsonata-js/jsonata/security/advisories/GHSA-fqg8-vfv7-8fj8","tags":["x_refsource_CONFIRM","x_transferred","Technical Description","Vendor Advisory","advisory","web"]},{"url":"https://github.com/jsonata-js/jsonata/commit/1d579dbe99c19fbe509f5ba2c6db7959b0d456d1","tags":["x_refsource_MISC","x_transferred","Patch","fix","web"]},{"url":"https://github.com/jsonata-js/jsonata/commit/335d38f6278e96c908b24183f1c9c90afc8ae00c","tags":["x_refsource_MISC","x_transferred","Patch","fix","web"]},{"url":"https://github.com/jsonata-js/jsonata/commit/c907b5e517bb718015fcbd993d742ba6202f2be2","tags":["x_refsource_MISC","x_transferred","Patch","fix","web"]},{"url":"https://github.com/jsonata-js/jsonata/releases/tag/v2.0.4","tags":["x_refsource_MISC","x_transferred","Product","Release Notes","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-27307","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-fqg8-vfv7-8fj8"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/27xxx/CVE-2024-27307.json","tags":["advisory"]},{"url":"https://github.com/jsonata-js/jsonata","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2024-27307","title":"JSONata expression can pollute the \"Object\" prototype","description":"JSONata is a JSON query and transformation language. Starting in version 1.4.0 and prior to version 1.8.7 and 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. This issue has been fixed in JSONata versions 1.8.7 and 2.0.4. Applications that evaluate user-provided expressions should update ASAP to prevent exploitation. As a workaround, one may apply the patch manually.","status":"published","published":"2024-03-06T19:24:16.876Z","modified":"2024-08-13T17:23:40.132Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"cna"}],"cwes":["CWE-1321"],"updated_at":"2026-11-02T14:34:12.635756Z"}],"euvd":[{"id":"EUVD-2024-0922","description":"JSONata is a JSON query and transformation language. Starting in version 1.4.0 and prior to version 1.8.7 and 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. This issue has been fixed in JSONata versions 1.8.7 and 2.0.4. Applications that evaluate user-provided expressions should update ASAP to prevent exploitation. As a workaround, one may apply the patch manually.","status":"published","published":"2024-03-06T19:24:16Z","modified":"2024-08-13T17:23:40Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-03T00:56:19.192984Z"}],"ghsa":[{"id":"GHSA-fqg8-vfv7-8fj8","title":"JSONata expression can pollute the \"Object\" prototype","description":"### Impact\n\nIn JSONata versions `\u003e= 1.4.0, \u003c 1.8.7` and `\u003e= 2.0.0, \u003c 2.0.4`, a malicious expression can use the [transform operator](https://docs.jsonata.org/other-operators#-------transform) 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.\n\n### Patch\n\nThis issue has been fixed in JSONata versions `\u003e= 1.8.7` and `\u003e= 2.0.4`. Applications that evaluate user-provided expressions should update ASAP to prevent exploitation. The following patch can be applied if updating is not possible.\n\n```patch\n--- a/src/jsonata.js\n+++ b/src/jsonata.js\n@@ -1293,6 +1293,13 @@ var jsonata = (function() {\n                 }\n                 for(var ii = 0; ii \u003c matches.length; ii++) {\n                     var match = matches[ii];\n+                    if (match \u0026\u0026 (match.isPrototypeOf(result) || match instanceof Object.constructor)) {\n+                        throw {\n+                            code: \"D1010\",\n+                            stack: (new Error()).stack,\n+                            position: expr.position\n+                        };\n+                    }\n                     // evaluate the update value for each match\n                     var update = await evaluate(expr.update, match, environment);\n                     // update must be an object\n@@ -1539,7 +1546,7 @@ var jsonata = (function() {\n                 if (typeof err.token == 'undefined' \u0026\u0026 typeof proc.token !== 'undefined') {\n                     err.token = proc.token;\n                 }\n-                err.position = proc.position;\n+                err.position = proc.position || err.position;\n             }\n             throw err;\n         }\n@@ -1972,6 +1979,7 @@ var jsonata = (function() {\n         \"T1007\": \"Attempted to partially apply a non-function. Did you mean ${{{token}}}?\",\n         \"T1008\": \"Attempted to partially apply a non-function\",\n         \"D1009\": \"Multiple key definitions evaluate to same key: {{value}}\",\n+        \"D1010\": \"Attempted to access the Javascript object prototype\", // Javascript specific \n         \"T1010\": \"The matcher function argument passed to function {{token}} does not return the correct object structure\",\n         \"T2001\": \"The left side of the {{token}} operator must evaluate to a number\",\n         \"T2002\": \"The right side of the {{token}} operator must evaluate to a number\",\n```\n\n### References\n\nhttps://github.com/jsonata-js/jsonata/releases/tag/v2.0.4\n\n### Credit\n\nThank you to Albert Pedersen of Cloudflare for disclosing this issue.\n","status":"published","published":"2024-03-04T20:43:12Z","modified":"2024-03-06T21:36:55Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-1321"],"updated_at":"2026-11-02T14:37:39.730152Z"}],"nvd":[{"id":"CVE-2024-27307","description":"JSONata is a JSON query and transformation language. Starting in version 1.4.0 and prior to version 1.8.7 and 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. This issue has been fixed in JSONata versions 1.8.7 and 2.0.4. Applications that evaluate user-provided expressions should update ASAP to prevent exploitation. As a workaround, one may apply the patch manually.","status":"published","published":"2024-03-06T20:15:47.537Z","modified":"2026-06-17T07:19:37.06Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"secondary"}],"cwes":["CWE-1321"],"updated_at":"2026-11-02T14:09:39.488031Z"}],"osv":[{"id":"CVE-2024-27307","title":"JSONata expression can pollute the \"Object\" prototype","description":"JSONata is a JSON query and transformation language. Starting in version 1.4.0 and prior to version 1.8.7 and 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. This issue has been fixed in JSONata versions 1.8.7 and 2.0.4. Applications that evaluate user-provided expressions should update ASAP to prevent exploitation. As a workaround, one may apply the patch manually.","status":"published","published":"2024-03-06T19:24:16.876Z","modified":"2026-10-28T02:30:22.343570626Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-1321"],"updated_at":"2026-11-02T15:44:39.569658Z"},{"id":"GHSA-fqg8-vfv7-8fj8","title":"JSONata expression can pollute the \"Object\" prototype","description":"### Impact\n\nIn JSONata versions `\u003e= 1.4.0, \u003c 1.8.7` and `\u003e= 2.0.0, \u003c 2.0.4`, a malicious expression can use the [transform operator](https://docs.jsonata.org/other-operators#-------transform) 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.\n\n### Patch\n\nThis issue has been fixed in JSONata versions `\u003e= 1.8.7` and `\u003e= 2.0.4`. Applications that evaluate user-provided expressions should update ASAP to prevent exploitation. The following patch can be applied if updating is not possible.\n\n```patch\n--- a/src/jsonata.js\n+++ b/src/jsonata.js\n@@ -1293,6 +1293,13 @@ var jsonata = (function() {\n                 }\n                 for(var ii = 0; ii \u003c matches.length; ii++) {\n                     var match = matches[ii];\n+                    if (match \u0026\u0026 (match.isPrototypeOf(result) || match instanceof Object.constructor)) {\n+                        throw {\n+                            code: \"D1010\",\n+                            stack: (new Error()).stack,\n+                            position: expr.position\n+                        };\n+                    }\n                     // evaluate the update value for each match\n                     var update = await evaluate(expr.update, match, environment);\n                     // update must be an object\n@@ -1539,7 +1546,7 @@ var jsonata = (function() {\n                 if (typeof err.token == 'undefined' \u0026\u0026 typeof proc.token !== 'undefined') {\n                     err.token = proc.token;\n                 }\n-                err.position = proc.position;\n+                err.position = proc.position || err.position;\n             }\n             throw err;\n         }\n@@ -1972,6 +1979,7 @@ var jsonata = (function() {\n         \"T1007\": \"Attempted to partially apply a non-function. Did you mean ${{{token}}}?\",\n         \"T1008\": \"Attempted to partially apply a non-function\",\n         \"D1009\": \"Multiple key definitions evaluate to same key: {{value}}\",\n+        \"D1010\": \"Attempted to access the Javascript object prototype\", // Javascript specific \n         \"T1010\": \"The matcher function argument passed to function {{token}} does not return the correct object structure\",\n         \"T2001\": \"The left side of the {{token}} operator must evaluate to a number\",\n         \"T2002\": \"The right side of the {{token}} operator must evaluate to a number\",\n```\n\n### References\n\nhttps://github.com/jsonata-js/jsonata/releases/tag/v2.0.4\n\n### Credit\n\nThank you to Albert Pedersen of Cloudflare for disclosing this issue.\n","status":"published","published":"2024-03-04T20:43:12Z","modified":"2026-09-10T03:50:10.42936945Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-1321"],"updated_at":"2026-11-02T15:46:46.760785Z"}]}}
