Skip to content

fix: Prevent shell injection in build workflow#319

Merged
andreiborza merged 2 commits into
masterfrom
fix/eng-7567-shell-injection-vulnerability
Apr 30, 2026
Merged

fix: Prevent shell injection in build workflow#319
andreiborza merged 2 commits into
masterfrom
fix/eng-7567-shell-injection-vulnerability

Conversation

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

Summary

This PR fixes a security vulnerability where github context data was being directly interpolated in a run: step, which could allow an attacker to inject their own code into the runner.

Changes

  • Modified the "Get docker tag" step in .github/workflows/build.yml to use intermediate environment variables (GITHUB_REF and GITHUB_EVENT_NAME) instead of direct interpolation of github.ref and github.event_name
  • The environment variables are properly quoted in the shell script to prevent injection attacks

Security Impact

This change mitigates a potential shell injection vulnerability by ensuring that github context data is treated as untrusted input and properly sanitized through environment variables.

References

Use environment variables to safely handle github context data
in run steps to prevent potential code injection attacks.

Fixes https://linear.app/getsentry/issue/VULN-1601
Fixes https://linear.app/getsentry/issue/ENG-7567

Co-Authored-By: fix-it-felix-sentry[bot] <260785270+fix-it-felix-sentry[bot]@users.noreply.github.com>
@linear-code
Copy link
Copy Markdown

linear-code Bot commented Apr 30, 2026

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c01ef49. Configure here.

Comment thread .github/workflows/build.yml Outdated
@andreiborza andreiborza merged commit b5f4d3a into master Apr 30, 2026
37 checks passed
@andreiborza andreiborza deleted the fix/eng-7567-shell-injection-vulnerability branch April 30, 2026 06:01
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.

1 participant