fix(ci): revert gate-check-v3 to base.ref checkout (internal#116 footgun) #555

Closed
infra-runtime-be wants to merge 1 commits from fix/gate-check-v3-pr-HEAD-security into main

1 Commits

Author SHA1 Message Date
8ad70fb6a3 fix(ci): revert gate-check-v3 to base.ref checkout (internal#116 footgun)
All checks were successful
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 26s
CI / Detect changes (pull_request) Successful in 1m15s
E2E API Smoke Test / detect-changes (pull_request) Successful in 1m14s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 51s
Lint curl status-code capture / Scan workflows for curl status-capture pollution (pull_request) Successful in 15s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 19s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 55s
qa-review / approved (pull_request) Successful in 26s
gate-check-v3 / gate-check (pull_request) Successful in 37s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 1m0s
security-review / approved (pull_request) Successful in 14s
sop-tier-check / tier-check (pull_request) Successful in 15s
CI / Platform (Go) (pull_request) Successful in 9s
CI / Canvas (Next.js) (pull_request) Successful in 9s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 8s
audit-force-merge / audit (pull_request) Has been skipped
CI / Python Lint & Test (pull_request) Successful in 10s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 13s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 13s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 12s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 11s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
pull_request_target runs under the repo's secrets context. Checking out
an untrusted PR HEAD under that context is a known footgun: a malicious
PR author could inject arbitrary code into the checked-out tree and the
workflow would execute it with elevated token access.

Reverts the checkout from head.sha back to base.ref. The base branch is
a trusted commit — an external actor cannot modify it.

Trade-off: script changes in the PR branch (e.g. self-loop exclusion in
signal_6_ci) won't take effect until they land on main. That is an
acceptable false-positive window vs. the attack surface of running
untrusted code under a privileged token.

Fixes: internal#116 (security footgun reported by hongming-pc2)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 19:34:31 +00:00