ci(claude-review): harden against Dependabot-controlled content (#875)#878
Merged
Merged
Conversation
- Add an untrusted-content clause to the review prompt so PR title/body/commit messages/release notes are treated as data, not instructions (primary mitigation for the prompt-injection vector opencode flagged on #870). - Add exclude_comments_by_actor: "dependabot[bot]" as defense-in-depth so the bot's own comment prose isn't fed to the reviewer as instructions. - Drop unused id-token: write permission (only needed for OIDC federation auth, which this workflow doesn't use — it authenticates via claude_code_oauth_token). Closes #875
Owner
Author
Cross-family review — opencode (zai/glm-5.2)Independent review from a different model family (Phase 7c-1 / 10-pre). Verified against pinned action Findings (none Critical/Major)
VerdictAPPROVE — all acceptance criteria met and independently verified. |
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.
Follow-up to #870 (which allowed Dependabot PRs to be reviewed). Now that the review bot processes upstream-controlled content, this hardens the workflow per the two suggestions from the cross-family review on #870.
Changes (
.github/workflows/claude-code-review.yml)exclude_comments_by_actor: "dependabot[bot]"(defense-in-depth): stops Dependabot's own comment prose from being fed to the reviewer as instructions. (Distinct from the prompt clause, which covers the PR body —exclude_comments_by_actoronly filters comments.)id-token: write: only needed for OIDC federation auth (anthropic_federation_rule_id); this workflow authenticates viaclaude_code_oauth_token, so the permission was unused. Remaining perms are read-only (contents/pull-requests/issues).Validation
action.yml(SHA558b1d6):exclude_comments_by_actoris a real input;id-token: writeis federation-only.actionlintclean.Known limitations
CLAUDE_CODE_SUBPROCESS_ENV_SCRUB) only activates whenallowed_non_write_usersis set, so Dependabot PRs don't get the bubblewrap isolation layer — a stronger defense against token exfiltration via injection.allowed_non_write_usersis documented for human usernames, so its applicability todependabot[bot]is uncertain and would need investigation; left as a potential follow-up rather than a speculative change here.Closes #875