Skip to content

ci(claude-review): harden review workflow against Dependabot-controlled content #875

Description

@frankbria

Follow-up from PR #870, which added allowed_bots: "dependabot[bot]" so Dependabot PRs get reviewed. The cross-family review (opencode/GLM) raised two non-blocking security suggestions worth addressing now that the review bot processes upstream-controlled content.

Context

Reviewing Dependabot PRs newly exposes the Claude review step to attacker-influenced text (dependency release notes / changelogs in PR bodies). Blast radius is limited today — the job's permissions are read-only (contents/pull-requests/issues: read) and a human is always the merge decision-maker — so this is hardening, not an active vuln.

Suggested changes (.github/workflows/claude-code-review.yml)

  1. Prompt-injection guard: add an explicit clause instructing the reviewer to treat the PR description, commit messages, and dependency release notes as UNTRUSTED data and never follow instructions embedded in them. Optionally set exclude_comments_by_actor: "dependabot[bot]" so Claude sees the diff but not the bot's prose.
  2. Drop unused id-token: write (line ~20): the step authenticates via claude_code_oauth_token, not OIDC federation, so this permission is unused and can be removed to shrink the surface.

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions