fix(ci): harden PR-review workflows (adversarial audit) + polish - #4
Conversation
…rency, drop unused lint grant The automated review of this PR flagged: (1) the gh pr comment target relied on implicit gh auto-detection — now interpolate github.event.pull_request.number and github.repository explicitly; (2) no concurrency guard let rapid pushes stack review runs — add cancel-in-progress; (3) Bash(npm run lint) was allowlisted but never used. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A multi-agent audit confirmed the 'restricted' allowlist wasn't: - Bash(find:*) is arbitrary code execution (find -exec sh -c '...' is one command, no shell operator to split on) — removed from BOTH workflows. On the secret-bearing mention path (untrusted fork content) this was a real token-exfiltration vector. - Mention path Bash surface minimized to gh pr view/diff/checks/comment + read-only git; dropped cat/grep/jq/ls (could read /proc or .git/config via prefix match). - persist-credentials: false on the mention checkout so GITHUB_TOKEN isn't written into .git/config where a read primitive could recover it. - Documented the residual risk + the COLLABORATOR-gate nit in the spec. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Automated reviewScope note: this PR touches only CI workflow config ( 1. ChecksRan locally against the merged PR head (
None of these exercise the changed files directly (they're GitHub Actions YAML), but they confirm the PR doesn't regress the engine/board pipeline. 2–4. Board rules / safety labeling / src invariantsN/A — no board JSON or Review of the actual change (workflow hardening)The stated fixes all check out against the diff:
One inconsistency worth a follow-up (not a blocker): Residual/open question, not necessarily a bug: the audit's Overall: the hardening is well-reasoned, matches its own description, and the fixes are precise (not overbroad — read-only git and |
…cher semantics (#6) Follow-ups from PR #4's own automated review: - Add persist-credentials:false to claude-review.yml's checkout for consistency with the mention path (low risk on the trusted in-repo path, but keeps the invariant). - Document in the spec why find -exec is a bypass (single command word-list) while command substitution / chaining is NOT (the matcher parses those and requires each segment to be allowlisted). Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Hardens the two Claude review workflows after a multi-agent adversarial security audit, plus polish from the self-review on PR #2.
Security (HIGH):
Bash(find:*)from both workflows —find -exec sh -c '...'is a single command (no shell operator to split on), so it was a full arbitrary-code-execution escape. On the secret-bearing mention path (untrusted fork content) that was a real token-exfiltration vector.gh pr view/diff/checks/comment+ read-onlygit; dropcat/grep/jq/ls(could read/procor.git/config).persist-credentials: falseon the mention checkout so GITHUB_TOKEN isn't written into.git/config.Polish (from PR #2's self-review):
github.event.pull_request.number/github.repositoryinto the post command.concurrencyguard (cancel stacked runs).Bash(npm run lint)grant.Spec's security section updated with the audit findings + residual-risk note.