Skip to content

fix: Prevent shell injection in GitHub Actions workflows#495

Open
fix-it-felix-sentry[bot] wants to merge 2 commits intomainfrom
fix/github-actions-injection-vulnerability
Open

fix: Prevent shell injection in GitHub Actions workflows#495
fix-it-felix-sentry[bot] wants to merge 2 commits intomainfrom
fix/github-actions-injection-vulnerability

Conversation

@fix-it-felix-sentry
Copy link
Copy Markdown

Summary

This PR fixes a security vulnerability where GitHub context variables were used directly in run: steps, which could allow attackers to inject malicious code into the workflow runner.

Changes

  • .github/workflows/release-ghcr-version-tag.yml: Added environment variables for github.repository, github.ref_name, and github.sha to prevent injection in the docker buildx command
  • .github/workflows/fast-revert.yml: Added environment variables for steps.token.outputs.token, github.repository, github.run_id, github.event.repository.id, and github.event.number to prevent injection in the curl command

All GitHub context data is now stored in intermediate environment variables and properly quoted when used in shell scripts, following security best practices.

Security Impact

Severity: High

The vulnerability could allow an attacker to:

  • Inject arbitrary code into the GitHub Actions runner
  • Steal secrets and access tokens
  • Compromise the CI/CD pipeline

References

Fix security vulnerability where github context variables were used
directly in run steps, which could allow code injection attacks.
Changed to use intermediate environment variables with proper quoting.

References:
- Parent ticket: https://linear.app/getsentry/issue/VULN-1599
- Child ticket: https://linear.app/getsentry/issue/NEW-784

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@fix-it-felix-sentry fix-it-felix-sentry Bot requested a review from a team as a code owner April 29, 2026 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants