fix(executor): escape resolved references in while/doWhile loop conditions - #6181
fix(executor): escape resolved references in while/doWhile loop conditions#6181waleedlatif1 wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryHigh Risk Overview Operands are now built via Tests cover injection payloads, backslashes/newlines/line separators, and the coercion table for common resolved types. Reviewed by Cursor Bugbot for commit fc4f4c7. Configure here. |
Greptile SummaryThis PR prevents resolved loop-condition references from escaping their generated JavaScript literals.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/sim/executor/orchestrators/loop.ts | Safely serializes resolved loop-condition operands before compiling the generated expression in the execution isolate. |
| apps/sim/executor/orchestrators/loop.test.ts | Adds focused coverage for expression injection, source-character escaping, and preserved operand coercion. |
Reviews (2): Last reviewed commit: "fix(executor): escape resolved reference..." | Re-trigger Greptile
…tions Loop conditions inlined each resolved reference as a bare double-quoted literal before compiling the expression in the execution isolate, so a quote anywhere in the referenced value broke out of the literal and ran as code. Serialize operands as proper JS literals instead, matching the escaping the condition block already does via stringifyForCondition.
d3d686b to
fc4f4c7
Compare
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit fc4f4c7. Configure here.
Summary
<reference>as a bare double-quoted literal, then compiled the result in the execution isolate — a quote anywhere in the referenced value terminated the literal and ran the rest as JavaScript. Reachable by an external caller on any deployed workflow with a data-driven while condition; no workflow authorship needed.JSON.stringifyplus U+2028/U+2029 escaping) instead of hand-quoting, matching the escaping the condition block already does viastringifyForCondition."true"/"false"/ object /nullbranches are untouched, so output is byte-identical for every value that didn't already produce broken code.Type of Change
Testing
falseand the operand is a proper literal), backslash/newline/line-separator escaping, and the full coercion table.trueagainst the old code.NaN,Infinity,-0,1e21, nested objects): 0 differences.loop.test.ts20/20; fullexecutor/suite passing apart from failures unrelated to these files.Checklist