Hi,
We shipped new maintenance releases of Node-RED earlier this week to update the JSONata dependency that has a critical CVE published against it.
Unfortunately, we have since discovered the fix for the CVE is now blocking behaviour we had relied on.
JSONata can no longer access properties on objects that are in the prototype chain, or defined via getter/setter properties. That's fine if you are dealing purely with JSON data (which is JSONata's focus) - but it is problematic when dealing with more general JavaScript objects.
Here are two examples that no longer work:
const url = new URL("https://example.com")
// Get `url.hostname`
console.log(await jsonata("hostname").evaluate(url))
// Old JSONata -> 'example.com'
// Latest JSONata -> undefined
More specifically, in Node-RED, we extend JSONata with the $moment() function. Previously, the expression $moment().hour() could be used to get the current hour of the day.
That no longer works in Node-RED 5.0.6.
There is an open issue against JSONata regarding this change in behaviour that was introduced - but it has gone unanswered for some time.
As it stands, we are stuck between a rock and a hardplace. With the JSONata CVE flagged as critical, it was blocking Node-RED from being used for some organisations due to security policies. The fix breaks behaviour we rely on.
Normally we'd just do the work to fix these things. But as it stands, I don't have a solution to this problem, so wanted to acknowledge it here.
An issue has been raised against 5.0.6 that covers it. If we're able to find a non-breaking way forward, we'll keep that issue updated.
