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
Click a segment to jump to that moment
43msession
1interventions
GOAL
Review open GitHub code scanning alerts on pi-for-excel and fix them, then open a PR and address review feedback.
- +0Prompt · +0We have several code scanning alerts, please can we review them
- +0mAgent did · +0mPulled 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
- +3mPrompt · +3mGreat, fix 1, 2 and 4. For alert 3 (request forgery), what would an 'A' option entail?
- +4mAgent did · +4mAdded 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
- +12mPrompt · +12mA-lite sounds more pragmatic
- +14mAgent did · +14mImplemented 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
- +27mAgent did · +27mCreated fix/code-scanning-alerts branch, committed the 9-file security fix, rebased onto origin/main, pushed, and opened PR #85 with checks running
- +35mIntervention · +35mAborted the agent's sleep-and-poll loop for PR review comments and asked it to just check nowWhy: the polling loop got stuck/aborted so I just told it to check immediately instead of waiting
- +36mAgent did · +36mFound 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
- +43mOutcome · +43mPR #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.