<#7617 security: mitigate CI workflow vulnerabilit...
# flyte-github
a
#7617 security: mitigate CI workflow vulnerabilities Pull request opened by farhan-uai Tracking issue Security advisory: Unauthenticated code execution in CI workflows Linear: ENG26-835 Why are the changes needed? Security review identified privilege escalation risks in workflows using
pull_request_target
triggers. Changes address execution context isolation and permission boundaries for untrusted PR code. What changes were proposed in this pull request? Security Hardening • Switched affected workflows from
pull_request_target
to
pull_request
(isolates execution) • Added job-level fork detection guards (gates privileged operations) • Applied least-privilege permissions (removed unnecessary write tokens) • Removed explicit fork HEAD checkouts (uses safe merge commit defaults) Specific Changes
check-generate.yml
• Changed to
pull_request
trigger • Moved fork safety logic to setup job • Removed explicit ref checkouts
build-ci-image.yml
• Changed to
pull_request
trigger • Removed
pull-requests: write
permission • Added fork detection to push/comment steps
flyte-binary-v2.yml
• Changed to
pull_request
trigger • Added
v2
branch to push triggers • Added
labeled
trigger type support • Fixed YAML syntax errors • Added explicit fork detection guard to devbox build job
labeler.yml
• Kept as
pull_request_target
(safe exception: no code execution) How was this patch tested? • Verified workflow syntax and job dependencies • Tested with internal PRs from base repository—workflows function normally • Verified fork detection logic blocks privileged operations for external contributors • Confirmed approval gate requirement in repository settings Labels • security: Vulnerability mitigation Check all the applicable boxes • I updated the documentation accordingly. • All new and existing tests passed. • All commits are signed-off. Security Notes Full technical details and threat model documented in private security advisory. These changes implement defense-in-depth: event isolation + job-level guards + permission least-privilege. No functional changes for internal contributors. External contributors still receive CI feedback via safe execution paths. flyteorg/flyte