fix(sandbox): INS-2464 additional checks #9924
Conversation
✅ Circular References ReportGenerated at: 2026-05-14T21:13:34.312Z Summary
Click to view all circular references in PR (19)Click to view all circular references in base branch (19)Analysis✅ No Change: This PR does not introduce or remove any circular references. This report was generated automatically by comparing against the |
ihexxa
left a comment
There was a problem hiding this comment.
I was occupied by some other stuff.. but will accelerate to review this.. 🏃
| ({ names: maskNames, values: maskValues } = alwaysOnPolicy.buildMaskScope(checkSandboxViolations)); | ||
| } | ||
|
|
||
| // Wrap eval so user-supplied source is checked and then evaluated in a scope that inherits the same masked bindings as the outer sandbox. |
There was a problem hiding this comment.
Will we also cover expressions like const sum = new Function('a', 'b', 'return a + b');, or composition of them?
ihexxa
left a comment
There was a problem hiding this comment.
Just several comments and questions.
| @@ -106,36 +151,22 @@ | |||
| }; | |||
|
|
|||
| walk.simple(tree, { | |||
There was a problem hiding this comment.
Will it also collect names that blocked ones which alias are assigned after? e.g:
const b = a; // ← a not yet in blocked → b is missed
const a = globalThis; // ← a added here
b.require('...'); // ← NOT blocked
| } | ||
| // We should evenutally drop non-valid JavaScript. | ||
| if (!tree) { | ||
| // throw new Error(); |
There was a problem hiding this comment.
Could the script be higher version (e,g., ecmaVersion 2025) which works but can't be parsed, then it is returned here.
This PR adds a resolution for INS-2464, increases the existing unit test count and optimizes existing sandbox smoke test.