feat(claude): let AI sort out security issues#203
Conversation
Code Review — PR #203: feat(claude): let AI sort out security issuesSummary: This PR adds a new weekly GitHub Actions workflow ( Issues🔴 Critical1. Prompt injection via The Dependabot alert data (package names, advisory descriptions, CVE summaries) is interpolated directly into the Claude prompt. Advisory text is controlled by external parties (NVD, GitHub Advisory Database, or even malicious package publishers). A crafted description containing something like Recommendation: Write the alerts JSON to a file during the fetch step, then pass the file path to Claude ( 2. Unpinned action versions Three actions are referenced by mutable tags: uses: actions/checkout@v4
uses: actions/github-script@v7
uses: anthropics/claude-code-action@v1If any tag is moved (accidentally or maliciously), the workflow silently executes different code with Recommendation: Pin all third-party actions to a full commit SHA, e.g.: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2🟡 Warning3. permissions:
contents: write
pull-requests: write
security-events: read
id-token: write # ← not used
Recommendation: Remove 4. No Rust toolchain setup step The workflow runs Recommendation: Add before the Claude step: - name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable5. No If the workflow is triggered manually ( Recommendation: concurrency:
group: security-dependabot-fix
cancel-in-progress: false6. Misleading step name vs. actual window The step is named "Count security fix PRs already opened today" but the code looks back 7 days ( Recommendation: Rename the step to "Count security fix PRs opened this week". 7. The prompt instructs Claude to stage all changes with 🔵 Suggestion8. Full git history fetch is not needed for dependency version bumps. 9. A workspace-level build failure can produce many lines of errors; truncating to 20 may hide the root cause from Claude. Consider removing the 10. For a workflow that primarily runs Positives
Verdict: Request ChangesThe prompt engineering and rate-limiting logic are well thought out. However, the prompt injection risk (externally-sourced advisory text inlined into an agentic AI prompt with write permissions) and unpinned action versions are must-fix items before merging a workflow that is specifically designed to modify production dependencies. |
Write alerts to /tmp/alerts.json at fetch time instead of passing the raw JSON through a step output that gets interpolated into the Claude prompt. Advisory descriptions are controlled by external parties (NVD, package publishers) and must not be inlined into an agentic prompt that has contents:write permissions.
* main: fix(ci): switch from dependabot API to cargo audit fix(ci): use gh CLI to fetch dependabot alerts feat(claude): let AI sort out security issues (#203)
No description provided.