fix: playground path injection and XSS vulnerabilities (CodeQL) - #3
Merged
Conversation
Prevent path traversal in playground file handlers by adding validatePlaygroundDir (name containment) and validatePlaygroundPath (file path validation). Encode activeItem in iframe src URL to prevent DOM-based XSS. Consolidates duplicate regex+containment checks into a single validatePlaygroundDir call per handler.
radutopala
force-pushed
the
fix/code-scanning-security-issues
branch
from
March 30, 2026 11:51
dd6e1e9 to
de84368
Compare
radutopala
added a commit
that referenced
this pull request
May 27, 2026
Ten issue-level conversation comments on PR #60: #1 review_handler.go — runReviewAsync now takes a cancellable ctx so session-delete and server-Stop detach the long-running agent run instead of leaking the container for 5–20 min after teardown. #2/#6 dag.go — executeWithRetry's retry-attempt UpsertNodeRun now sets Iteration so a body-child retry on iter>0 no longer clobbers the iteration-0 row. #3 engine.go — recoverPausedRun/RunningRun pick the highest-iteration Success row's Output deterministically for completedOutputs, so templated body children see the correct prior-iteration value on resume instead of whatever ListNodeRuns happened to return last. #4 engine.go — both recovery paths now re-validate the pinned definition before executeDAGFromCheckpoint, so a stored def that pre-dates a validator rule fails early instead of half-executing a loop body. #5 engine.go — explicit empty-string skip on opts.Inputs so external callers sending {"max_iterations":""} no longer wipe the default. #7 WorkflowGraph.tsx — auto-center useEffect is now actually one-shot (reads hasCentered.current); new iterations no longer reset the viewport mid-investigation. #8 workflows.ts — error throws use a new describeError() helper that reads the daemon's JSON body so HTTP/2 callers stop seeing "Failed to ___: " messages with empty suffix. #9 review_handler.go — pushOneComment skips MarkPushed when ghID==0 so the 422-fallback's unparseable-response branch doesn't strand a comment as permanently undeletable. #10 ContextMenu.tsx — WAI-ARIA menu pattern: role=menu/menuitem, focus-on-mount, focus-return-on-close, roving tabindex, ArrowUp/Down/Home/End nav skipping separators. Tests: 9 new (4 review handler, 5 engine recovery/start). make lint clean, make coverage-check 100.0%.
radutopala
added a commit
that referenced
this pull request
May 27, 2026
Ten issue-level conversation comments on PR #60: #1 review_handler.go — runReviewAsync now takes a cancellable ctx so session-delete and server-Stop detach the long-running agent run instead of leaking the container for 5–20 min after teardown. #2/#6 dag.go — executeWithRetry's retry-attempt UpsertNodeRun now sets Iteration so a body-child retry on iter>0 no longer clobbers the iteration-0 row. #3 engine.go — recoverPausedRun/RunningRun pick the highest-iteration Success row's Output deterministically for completedOutputs, so templated body children see the correct prior-iteration value on resume instead of whatever ListNodeRuns happened to return last. #4 engine.go — both recovery paths now re-validate the pinned definition before executeDAGFromCheckpoint, so a stored def that pre-dates a validator rule fails early instead of half-executing a loop body. #5 engine.go — explicit empty-string skip on opts.Inputs so external callers sending {"max_iterations":""} no longer wipe the default. #7 WorkflowGraph.tsx — auto-center useEffect is now actually one-shot (reads hasCentered.current); new iterations no longer reset the viewport mid-investigation. #8 workflows.ts — error throws use a new describeError() helper that reads the daemon's JSON body so HTTP/2 callers stop seeing "Failed to ___: " messages with empty suffix. #9 review_handler.go — pushOneComment skips MarkPushed when ghID==0 so the 422-fallback's unparseable-response branch doesn't strand a comment as permanently undeletable. #10 ContextMenu.tsx — WAI-ARIA menu pattern: role=menu/menuitem, focus-on-mount, focus-return-on-close, roving tabindex, ArrowUp/Down/Home/End nav skipping separators. Tests: 9 new (4 review handler, 5 engine recovery/start). make lint clean, make coverage-check 100.0%.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prevent path traversal in playground file handlers by adding validatePlaygroundDir (name containment) and validatePlaygroundPath (file path validation). Encode activeItem in iframe src URL to prevent DOM-based XSS. Consolidates duplicate regex+containment checks into a single validatePlaygroundDir call per handler.