Root cause
Injection & unsafe execution introduced
The callback reads the supplied array property without first restricting it to a numeric index.
AI-assisted change: Claude
How AI contributed: Direct introductionPublished Jul 22, 2026 in
n8n-io/n8nAll 6 findings in this repository
Provisional finding. Full causal and release verification remains incomplete.
Root cause
The callback reads the supplied array property without first restricting it to a numeric index.
AI-assisted change: Claude
Fix
The repaired callback rejects non-integer and negative indices before reading the array.
AI-assisted fix: n8n-assistant[bot]
Case facts
@@ -0,0 +321,18 @@+ }++ if (!Array.isArray(arr)) {+ return undefined;+ }++ const element = arr[index];++ // If element is object/array, return metadata+ if (element !== null && typeof element === 'object') {+ if (Array.isArray(element)) {+ const smallArrayThreshold = 100;+ return {+ __isArray: true,+ __length: element.length,+ __data: element.length <= smallArrayThreshold ? element : null,+ };+ }@@ -400,5 +400,18 @@ return undefined; } + // Only genuine array indices are reachable; anything else (e.g.+ // 'constructor', '__lookupGetter__') would read off the prototype+ // chain and could leak a host function reference across the boundary.+ if (!Number.isInteger(index) || index < 0) {+ return undefined;+ }+ const element = arr[index]; + // Functions are never reachable through the data surface — mirror the+ // guard in getValueAtPath so a host callable can't cross the boundary.+ if (typeof element === 'function') {+ return undefined;+ }+AI-assisted change a14381ee7fb4cbe9769eff02332795d6638c85d5e64508dc5a49144320df91fc · Fix 9a5cbfd0fa13ab22c2461a8645a27f69cb1b49514dd647c469e8a92de46b89d1