Skip to content

fix: playground path injection and XSS vulnerabilities (CodeQL) - #3

Merged
radutopala merged 1 commit into
mainfrom
fix/code-scanning-security-issues
Mar 30, 2026
Merged

fix: playground path injection and XSS vulnerabilities (CodeQL)#3
radutopala merged 1 commit into
mainfrom
fix/code-scanning-security-issues

Conversation

@radutopala

Copy link
Copy Markdown
Owner

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.

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
radutopala force-pushed the fix/code-scanning-security-issues branch from dd6e1e9 to de84368 Compare March 30, 2026 11:51
@radutopala
radutopala merged commit de84368 into main Mar 30, 2026
14 checks passed
@radutopala
radutopala deleted the fix/code-scanning-security-issues branch March 30, 2026 12:13
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%.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant