Skip to content

fix: Prevent shell injection in GitHub Actions workflow#2110

Open
fix-it-felix-sentry[bot] wants to merge 1 commit into
mainfrom
fix/di-1912-shell-injection-workflow
Open

fix: Prevent shell injection in GitHub Actions workflow#2110
fix-it-felix-sentry[bot] wants to merge 1 commit into
mainfrom
fix/di-1912-shell-injection-workflow

Conversation

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

Summary

This PR fixes a security finding by preventing potential shell injection in the GitHub Actions workflow.

Changes

  • Replaced direct interpolation of GitHub context variables (github.sha, github.ref, github.actor, github.event_name) with environment variables
  • Updated shell commands to use quoted environment variables instead of direct ${{ }} interpolation
  • Applied the same fix to both the login and build steps

This follows GitHub Actions security best practices for preventing script injection attacks by treating all GitHub context data as potentially untrusted and using intermediate environment variables.

References

Use environment variables instead of direct interpolation of GitHub context
variables in run steps to prevent potential shell injection attacks.

This addresses the security finding by:
- Storing github.sha, github.ref, github.actor, matrix.arch, and github.event_name
  in environment variables
- Using quoted environment variables in shell commands instead of direct interpolation
- Following GitHub Actions security best practices for script injection prevention

Fixes: https://linear.app/getsentry/issue/VULN-1618
Fixes: https://linear.app/getsentry/issue/DI-1912

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 1, 2026

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