Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/fix-security-vulnerability.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Fix Security Vulnerability

on:
dependabot_alert:
types: [created]
workflow_dispatch:
inputs:
alert:
description:
'Dependabot alert number or URL (e.g. 1046 or
https://github.com/getsentry/sentry-javascript/security/dependabot/1046)'
required: true

concurrency:
group: fix-security-vuln-${{ github.event.alert.number || github.event.inputs.alert }}
cancel-in-progress: false

jobs:
fix-vulnerability:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
security-events: read
issues: write
steps:
- uses: actions/checkout@v4
with:
ref: develop

- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
prompt: |
/fix-security-vulnerability ${{ github.event.alert.number || github.event.inputs.alert }}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsanitized input interpolated directly into AI prompt

Medium Severity

The workflow_dispatch input github.event.inputs.alert is directly interpolated into the Claude AI agent's prompt via ${{ }} expression without any validation or sanitization. Since the input accepts any free-form string (no type constraint), a user triggering this workflow via the API could inject arbitrary multi-line instructions into the prompt. The agent operates with contents: write and pull-requests: write permissions, so a successful prompt injection could cause it to create PRs with unintended code changes that appear to be legitimate automated security fixes. This rule was flagged because it was mentioned in the rules file under Security Vulnerabilities.

Additional Locations (1)

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot


IMPORTANT: Do NOT dismiss any alerts. Do NOT wait for approval.

If you can fix the vulnerability:
Create a branch, apply the fix, and open a PR with your analysis
in the PR description. Target the develop branch.

If you determine the alert should NOT be fixed:
Do NOT dismiss the alert. Instead, open a GitHub issue with:
- Title: "Security: Dismiss Dependabot alert #<number> - <package-name>"
- Label: "Security"
- Body: Include the full vulnerability details, your analysis,
the recommended dismissal reason, and why the alert cannot/should not be fixed.
claude_args: '--max-turns 20'
Loading