Skip to content

Migrate to patched JSONata - #5933

Merged
knolleary merged 4 commits into
mainfrom
patch-jsonata
Sep 8, 2026
Merged

knolleary merged 4 commits into
mainfrom
patch-jsonata

Conversation

@knolleary

Copy link
Copy Markdown
Member

This migrates Node-RED to a custom fork of JSONata in order to resolve the prototype-property access issues with the current release of JSONata.

JSONata 2.2.2 blocks access to any and all prototype properties in order to block prototype pollution. The approach they have taken is very strict and whilst valid for pure JSON-compatible objects, it breaks a numbers of unrelated uses in the wider JavaScript world.

For example:

  • accessing the hostname property of a url object; this is defined via a getter function, so fails the hasOwnProperty test.
  • calling chained functions such as: $moment().hour() - hour is a class level function of the object returned by $moment, so fails the hasOwnProperty test.

The fork of JSONata is maintained here: https://github.com/node-red/jsonata-nr/

We will keep that in-sync with upstream, whilst maintaining our patch. Hopefully the patch will be accepted upstream, but given the lack of response on the issues reported, we can't predict when that will happen. We can't wait, so moving forward with this patch.

@knolleary
knolleary merged commit 53a5c30 into main Sep 8, 2026
3 checks passed
@knolleary
knolleary deleted the patch-jsonata branch September 8, 2026 10:44
@knolleary knolleary linked an issue Sep 8, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Node-RED 5.0.6 : regression in JSONata $moment

1 participant