You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JavascriptFunctionDefinition` "looks-like-JSON" heuristic enables JS injection in the polyglot engine #4326
Affected version: 26.4.2 (confirmed still present in 26.5.1) Component:com.arcadedb.function.polyglot.JavascriptFunctionDefinition
Summary
The function string-concatenates user-controlled arguments into JavaScript source, then calls polyglotEngine.eval(...). A heuristic skips escaping when the value "looks like JSON" — i.e., opens with {/[ and closes with }/]. Any caller able to influence such a string argument can inject arbitrary JavaScript.
Arbitrary JavaScript execution inside the polyglot engine, e.g. {a:require('child_process').execSync('id'),b:1}. Defeats every sandbox
boundary the engine attempts.
Suggested fix
Always JSON-encode (or JS-string-escape) the value. If structured data must pass through, marshal as ProxyObject / ProxyArray and bind it as a Value parameter — never via source concatenation.
Activity
fix(#4326): replace JS source concatenation with Value.execute() in J…
fix(ArcadeData#4326): replace JS source concatenation with Value.exec…