{"id":"CVE-2024-27307","aliases":["GHSA-fqg8-vfv7-8fj8"],"summary":"JSONata expression can pollute the \"Object\" prototype","published_at":"2024-03-04T20:43:12Z","modified_at":"2026-09-10T03:50:10.429369Z","products":[],"rating":{"severity":"critical","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","attack_path":"internet_unauthenticated","user_interaction":false,"malicious":false,"red_hat":"Important","vendor_ratings":[{"source":"Red Hat","rating":"Important"}]},"fix_available":false,"kev":{"listed":false,"ransomware":false},"public_exploit":false,"exploits":[],"epss":{"score":0.014220000244677067,"percentile":0.7344200015068054,"date":"2026-11-19T00:00:00Z"},"priority":11.8,"details":"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.","affected_stack":[],"affected_other":[{"ecosystem":"CVE","package":"jsonata-js/jsonata","versions":[">= 1.4.0, < 1.8.7",">= 2.0.0, < 2.0.4"],"provider":"cvelistv5","source":"CVE-2024-27307","relation":"self"},{"ecosystem":"NVD","package":"jsonata:jsonata","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"1.4.0"},{"fixed":"1.8.7"}]},{"type":"ECOSYSTEM","events":[{"introduced":"2.0.0"},{"fixed":"2.0.4"}]}],"fixed":["1.8.7","2.0.4"],"provider":"nvd","source":"CVE-2024-27307","relation":"self"},{"ecosystem":"npm","package":"jsonata","purl":"pkg:npm/jsonata","ranges":[{"type":"SEMVER","events":[{"introduced":"1.4.0"},{"fixed":"1.8.7"}]}],"fixed":["1.8.7"],"provider":"osv","source":"GHSA-fqg8-vfv7-8fj8","relation":"self"},{"ecosystem":"npm","package":"jsonata","purl":"pkg:npm/jsonata","ranges":[{"type":"SEMVER","events":[{"introduced":"2.0.0"},{"fixed":"2.0.4"}]}],"fixed":["2.0.4"],"provider":"osv","source":"GHSA-fqg8-vfv7-8fj8","relation":"self"}],"product_status":[{"vendor":"Red Hat","product":"OpenShift Serverless","cpe":"cpe:/a:redhat:serverless:1","status":"not_affected","packages":["jsonata"],"package_count":1,"fixed":[],"advisories":[],"note":"vulnerable_code_not_present","provider":"redhat-vex","source":"CVE-2024-27307"},{"vendor":"Red Hat","product":"Red Hat Developer Hub 1.2 for RHEL 9","cpe":"cpe:/a:redhat:rhdh:1.2::el9","status":"fixed","packages":["rhdh/rhdh-hub-rhel9"],"package_count":1,"fixed":[],"advisories":["RHEA-2024:4071"],"provider":"redhat-vex","source":"CVE-2024-27307"},{"vendor":"Red Hat","product":"Red Hat Developer Hub 1.2 for RHEL 9","cpe":"cpe:/a:redhat:rhdh:1.2::el9","status":"not_affected","packages":["rhdh/rhdh-operator-bundle","rhdh/rhdh-rhel9-operator"],"package_count":2,"fixed":[],"advisories":[],"note":"vulnerable_code_not_present","provider":"redhat-vex","source":"CVE-2024-27307"}],"records":[{"provider":"csaf-bsi","source_id":"WID-SEC-W-2024-0767","relation":"upstream","url":"https://wid.cert-bund.de/portal/wid/securityadvisory?name=WID-SEC-2024-0767","license":"TLP:CLEAR, mirroring permitted","published_at":"2024-04-02T22:00:00Z","modified_at":"2024-11-27T23:00:00Z","summary":"IBM App Connect Enterprise: Mehrere Schwachstellen","details":"Ein entfernter, anonymer Angreifer kann mehrere Schwachstellen in IBM App Connect Enterprise ausnutzen, um beliebigen Programmcode auszuführen oder einen Denial-of-Service-Zustand zu verursachen.\n\nIBM App Connect Enterprise kombiniert die branchenbewährten Technologien des IBM Integration Bus mit Cloud-nativen Technologien.","severity":[{"type":"BSI","score":"hoch","source":"WID-SEC-W-2024-0767"}],"affected":[],"product_status":[],"references":[{"type":"WEB","url":"https://wid.cert-bund.de/.well-known/csaf/white/2024/wid-sec-w-2024-0767.json"},{"type":"WEB","url":"https://wid.cert-bund.de/portal/wid/securityadvisory?name=WID-SEC-2024-0767"},{"type":"WEB","url":"https://www.ibm.com/support/pages/node/7145701"},{"type":"WEB","url":"https://www.ibm.com/support/pages/node/7145686"}]},{"provider":"cvelistv5","source_id":"CVE-2024-27307","relation":"self","url":"https://www.cve.org/CVERecord?id=CVE-2024-27307","license":"CC-BY-4.0","published_at":"2024-03-06T19:24:16.876Z","modified_at":"2024-08-13T17:23:40.132Z","summary":"JSONata expression can pollute the \"Object\" prototype","details":"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":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","source":"CVE-2024-27307"}],"affected":[{"ecosystem":"CVE","package":"jsonata-js/jsonata","versions":[">= 1.4.0, < 1.8.7",">= 2.0.0, < 2.0.4"],"provider":"cvelistv5","source":"CVE-2024-27307","relation":"self"}],"product_status":[],"references":[{"type":"WEB","url":"https://github.com/jsonata-js/jsonata/security/advisories/GHSA-fqg8-vfv7-8fj8"},{"type":"WEB","url":"https://github.com/jsonata-js/jsonata/commit/1d579dbe99c19fbe509f5ba2c6db7959b0d456d1"},{"type":"WEB","url":"https://github.com/jsonata-js/jsonata/commit/335d38f6278e96c908b24183f1c9c90afc8ae00c"},{"type":"WEB","url":"https://github.com/jsonata-js/jsonata/commit/c907b5e517bb718015fcbd993d742ba6202f2be2"},{"type":"WEB","url":"https://github.com/jsonata-js/jsonata/releases/tag/v2.0.4"}]},{"provider":"nvd","source_id":"CVE-2024-27307","relation":"self","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-27307","severity":[],"affected":[{"ecosystem":"NVD","package":"jsonata:jsonata","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"1.4.0"},{"fixed":"1.8.7"}]},{"type":"ECOSYSTEM","events":[{"introduced":"2.0.0"},{"fixed":"2.0.4"}]}],"fixed":["1.8.7","2.0.4"],"provider":"nvd","source":"CVE-2024-27307","relation":"self"}],"product_status":[],"references":[]},{"provider":"osv","source_id":"GHSA-fqg8-vfv7-8fj8","relation":"self","url":"https://osv.dev/vulnerability/GHSA-fqg8-vfv7-8fj8","license":"CC-BY-4.0","published_at":"2024-03-04T20:43:12Z","modified_at":"2026-09-10T03:50:10.429369Z","summary":"JSONata expression can pollute the \"Object\" prototype","details":"### Impact\n\nIn JSONata versions `>= 1.4.0, < 1.8.7` and `>= 2.0.0, < 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 `>= 1.8.7` and `>= 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 < matches.length; ii++) {\n                     var match = matches[ii];\n+                    if (match && (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' && 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.","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","source":"GHSA-fqg8-vfv7-8fj8"}],"affected":[{"ecosystem":"npm","package":"jsonata","purl":"pkg:npm/jsonata","ranges":[{"type":"SEMVER","events":[{"introduced":"1.4.0"},{"fixed":"1.8.7"}]}],"fixed":["1.8.7"],"provider":"osv","source":"GHSA-fqg8-vfv7-8fj8","relation":"self"},{"ecosystem":"npm","package":"jsonata","purl":"pkg:npm/jsonata","ranges":[{"type":"SEMVER","events":[{"introduced":"2.0.0"},{"fixed":"2.0.4"}]}],"fixed":["2.0.4"],"provider":"osv","source":"GHSA-fqg8-vfv7-8fj8","relation":"self"}],"product_status":[],"references":[{"type":"WEB","url":"https://github.com/jsonata-js/jsonata/security/advisories/GHSA-fqg8-vfv7-8fj8"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-27307"},{"type":"WEB","url":"https://github.com/jsonata-js/jsonata/commit/1d579dbe99c19fbe509f5ba2c6db7959b0d456d1"},{"type":"WEB","url":"https://github.com/jsonata-js/jsonata/commit/335d38f6278e96c908b24183f1c9c90afc8ae00c"},{"type":"WEB","url":"https://github.com/jsonata-js/jsonata/commit/c907b5e517bb718015fcbd993d742ba6202f2be2"},{"type":"PACKAGE","url":"https://github.com/jsonata-js/jsonata"},{"type":"WEB","url":"https://github.com/jsonata-js/jsonata/releases/tag/v2.0.4"}]},{"provider":"redhat-vex","source_id":"CVE-2024-27307","relation":"self","url":"https://access.redhat.com/security/cve/CVE-2024-27307","license":"CC-BY-4.0","published_at":"2024-03-06T00:00:00Z","modified_at":"2026-08-04T09:28:48Z","summary":"jsonata: malicious expression can pollute the \"Object\" prototype","details":"A vulnerability was found in JSONata. A malicious expression can exploit the transform operator to override properties on the Object constructor and prototype. This issue can result in denial of service, remote code execution, or other unforeseen behavior in applications that assess user-provided JSONata expressions.","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:L","source":"CVE-2024-27307"},{"type":"Red Hat","score":"Important","source":"CVE-2024-27307"}],"affected":[],"product_status":[{"vendor":"Red Hat","product":"OpenShift Serverless","cpe":"cpe:/a:redhat:serverless:1","status":"not_affected","packages":["jsonata"],"package_count":1,"fixed":[],"advisories":[],"note":"vulnerable_code_not_present","provider":"redhat-vex","source":"CVE-2024-27307"},{"vendor":"Red Hat","product":"Red Hat Developer Hub 1.2 for RHEL 9","cpe":"cpe:/a:redhat:rhdh:1.2::el9","status":"fixed","packages":["rhdh/rhdh-hub-rhel9"],"package_count":1,"fixed":[],"advisories":["RHEA-2024:4071"],"provider":"redhat-vex","source":"CVE-2024-27307"},{"vendor":"Red Hat","product":"Red Hat Developer Hub 1.2 for RHEL 9","cpe":"cpe:/a:redhat:rhdh:1.2::el9","status":"not_affected","packages":["rhdh/rhdh-operator-bundle","rhdh/rhdh-rhel9-operator"],"package_count":2,"fixed":[],"advisories":[],"note":"vulnerable_code_not_present","provider":"redhat-vex","source":"CVE-2024-27307"}],"references":[{"type":"WEB","url":"https://security.access.redhat.com/data/csaf/v2/vex/2024/cve-2024-27307.json"},{"type":"WEB","url":"https://access.redhat.com/security/cve/CVE-2024-27307"},{"type":"WEB","url":"https://bugzilla.redhat.com/show_bug.cgi?id=2268370"},{"type":"WEB","url":"https://www.cve.org/CVERecord?id=CVE-2024-27307"},{"type":"WEB","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-27307"},{"type":"WEB","url":"https://github.com/jsonata-js/jsonata/security/advisories/GHSA-fqg8-vfv7-8fj8"}]}],"references":[{"type":"WEB","url":"https://github.com/jsonata-js/jsonata/security/advisories/GHSA-fqg8-vfv7-8fj8"},{"type":"WEB","url":"https://github.com/jsonata-js/jsonata/commit/1d579dbe99c19fbe509f5ba2c6db7959b0d456d1"},{"type":"WEB","url":"https://github.com/jsonata-js/jsonata/commit/335d38f6278e96c908b24183f1c9c90afc8ae00c"},{"type":"WEB","url":"https://github.com/jsonata-js/jsonata/commit/c907b5e517bb718015fcbd993d742ba6202f2be2"},{"type":"WEB","url":"https://github.com/jsonata-js/jsonata/releases/tag/v2.0.4"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-27307"},{"type":"PACKAGE","url":"https://github.com/jsonata-js/jsonata"},{"type":"WEB","url":"https://security.access.redhat.com/data/csaf/v2/vex/2024/cve-2024-27307.json"},{"type":"WEB","url":"https://access.redhat.com/security/cve/CVE-2024-27307"},{"type":"WEB","url":"https://bugzilla.redhat.com/show_bug.cgi?id=2268370"},{"type":"WEB","url":"https://www.cve.org/CVERecord?id=CVE-2024-27307"}],"sources":[{"provider":"csaf-bsi","source_id":"WID-SEC-W-2024-0767","url":"https://wid.cert-bund.de/portal/wid/securityadvisory?name=WID-SEC-2024-0767","license":"TLP:CLEAR, mirroring permitted","modified_at":"2024-11-27T23:00:00Z","relation":"upstream"},{"provider":"cvelistv5","source_id":"CVE-2024-27307","url":"https://www.cve.org/CVERecord?id=CVE-2024-27307","license":"CC-BY-4.0","modified_at":"2024-08-13T17:23:40.132Z","relation":"self"},{"provider":"nvd","source_id":"CVE-2024-27307","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-27307","relation":"self"},{"provider":"osv","source_id":"GHSA-fqg8-vfv7-8fj8","url":"https://osv.dev/vulnerability/GHSA-fqg8-vfv7-8fj8","license":"CC-BY-4.0","modified_at":"2026-09-10T03:50:10.429369Z","relation":"self"},{"provider":"redhat-vex","source_id":"CVE-2024-27307","url":"https://access.redhat.com/security/cve/CVE-2024-27307","license":"CC-BY-4.0","modified_at":"2026-08-04T09:28:48Z","relation":"self"}]}
