Skip to content

fix: Prevent potential shell injection in GitHub Actions workflow#3283

Open
fix-it-felix-sentry[bot] wants to merge 1 commit intomasterfrom
fix/eng-7551-github-actions-injection
Open

fix: Prevent potential shell injection in GitHub Actions workflow#3283
fix-it-felix-sentry[bot] wants to merge 1 commit intomasterfrom
fix/eng-7551-github-actions-injection

Conversation

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

Summary

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

Changes

  • Modified .github/workflows/release-ghcr-version-tag.yml to use environment variables instead of directly interpolating github.ref_name and github.sha in the run: script
  • Added env: block to store GitHub context data in intermediate variables
  • Updated the run script to use double-quoted environment variables ("$REF_NAME" and "$SHA")

Security Context

While this workflow only runs on release events (controlled by repository maintainers), following security best practices requires treating all GitHub context data as potentially untrusted input. Using intermediate environment variables prevents potential shell injection attacks.

Related Issues

Testing

The workflow syntax has been updated following GitHub's security hardening guidelines. The functionality remains unchanged - the workflow will continue to tag Docker images on release events.

Use environment variables to store github context data instead of
directly interpolating them in the run script to prevent potential
shell injection attacks.

Fixes: https://linear.app/getsentry/issue/VULN-1586
Fixes: https://linear.app/getsentry/issue/ENG-7551

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@fix-it-felix-sentry fix-it-felix-sentry Bot requested review from a team and szokeasaurusrex as code owners April 29, 2026 03:11
@linear-code
Copy link
Copy Markdown

linear-code Bot commented Apr 29, 2026

@github-actions
Copy link
Copy Markdown
Contributor

Fails
🚫 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

### Fixes

- Prevent potential shell injection in GitHub Actions workflow ([#3283](https://github.com/getsentry/sentry-cli/pull/3283))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against f7a17bd

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