fix(ci): limit credential exposure in fix-drift#212
Merged
Conversation
…: false fix-drift.yml runs Claude Code with API keys and write-scoped GITHUB_TOKEN persisted in git config for ~30 minutes. Prompt injection via crafted repo content could exfiltrate the git credentials. Changes: - Add persist-credentials: false to checkout step - Inject url.insteadOf credentials only before push (scoped to the "Create PR" phase, not the entire 30-minute Claude Code run) - Remove fix-drift.yml from zizmor artipacked suppression list
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fix-drift.yml runs Claude Code AI auto-fix with API keys and write-scoped
GITHUB_TOKEN persisted in git config for ~30 minutes. Prompt injection via
crafted repo content could exfiltrate the git credentials.
persist-credentials: falseto the checkout step so GITHUB_TOKEN is notstored in
.git/configfor the duration of the runurl.insteadOfcredentials only in the "Configure git for push" step,scoped to the PR creation phase (not the 30-minute Claude Code execution)
fix-drift.ymlfrom zizmorartipackedsuppression list since theunderlying issue is now fixed
The
fix-drift.ts --create-prpath usesgit pushdirectly (viaexecFileSafe), so theurl.insteadOfpattern is required. Thegh pr createand
gh pr mergecommands useGH_TOKENenv var which is already set.