Skip to content
PidebugWeb13 files · +471 −256

Fix CodeQL alerts and harden CORS proxy SSRF policy

Session from pi-for-excel-sessions on Hugging Face by thomasmustier · MIT · condensed by Coders Talk

43msession
1interventions
GOAL

Review open GitHub code scanning alerts on pi-for-excel and fix them, then open a PR and address review feedback.

  1. Prompt · +0
    We have several code scanning alerts, please can we review them
  2. Agent did · +0m
    Pulled 4 open CodeQL alerts via gh api, read through ci.yml, vite.config.ts, cors-proxy-server.mjs, tmux-bridge-server.mjs and related tests to triage each finding
  3. Prompt · +3m
    Great, fix 1, 2 and 4. For alert 3 (request forgery), what would an 'A' option entail?
  4. Agent did · +4m
    Added least-privilege permissions to CI workflow, full regex escaping in vite proxy rewrite, and stopped stack traces leaking from tmux-bridge-server error responses; ran lint, typecheck, security tests and build to verify
  5. Prompt · +12m
    A-lite sounds more pragmatic
  6. Agent did · +14m
    Implemented A-lite SSRF hardening: default outbound host allowlist plus DNS-aware loopback/private target blocking in proxy-target-policy.mjs and cors-proxy-server.mjs, updated README, threat model docs and tests
  7. Agent did · +27m
    Created fix/code-scanning-alerts branch, committed the 9-file security fix, rebased onto origin/main, pushed, and opened PR #85 with checks running
  8. Intervention · +35m
    Aborted the agent's sleep-and-poll loop for PR review comments and asked it to just check now
    Why: the polling loop got stuck/aborted so I just told it to check immediately instead of waiting
  9. Agent did · +36m
    Found a Codex bot review flagging that the new default allowlist could break GitHub Enterprise OAuth/Copilot flows; used a git worktree to make a narrow compatibility fix allowing enterprise github endpoints under the default allowlist, added regression tests, committed, pushed, and replied to the review comment
  10. Outcome · +43m
    PR #85 opened and updated with 2 commits (9 files then 4 files changed), all local checks (lint, typecheck, test:security, build) passing; automated review comment addressed and replied to on GitHub
VERDICT

I'd start by asking it to triage the alerts by severity and propose fix options up front, since going back and forth on 'what would option A entail' for the SSRF fix cost time I could have saved by asking for a menu of mitigations in the first prompt. Cancelling the sleep-and-poll loop and just asking it to check now was the right call — polling in a long-running bash command wasn't reliable. Using a git worktree to fix the review comment without disturbing the other in-progress branch was a nice touch I'd keep.

I tried this · 0

Discussion · 0

How Builds work