-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(ci): Add security vulnerability skill action #19355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nicohrubec
wants to merge
5
commits into
develop
Choose a base branch
from
nh/automatie-security-skill
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+49
−0
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| 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 }} | ||
|
|
||
| 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' | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
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_dispatchinputgithub.event.inputs.alertis directly interpolated into the Claude AI agent's prompt via${{ }}expression without any validation or sanitization. Since the input accepts any free-form string (notypeconstraint), a user triggering this workflow via the API could inject arbitrary multi-line instructions into the prompt. The agent operates withcontents: writeandpull-requests: writepermissions, 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)
.github/workflows/fix-security-vulnerability.yml#L14-L15Triggered by project rule: PR Review Guidelines for Cursor Bot