Skip to content

Fix shell injection vulnerability in console-check workflow#1690

Merged
JoshuaMoelans merged 1 commit into
masterfrom
fix-shell-injection-vulnerability
May 11, 2026
Merged

Fix shell injection vulnerability in console-check workflow#1690
JoshuaMoelans merged 1 commit into
masterfrom
fix-shell-injection-vulnerability

Conversation

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

@fix-it-felix-sentry fix-it-felix-sentry Bot commented Apr 30, 2026

Summary

This PR fixes a high-severity shell injection vulnerability in the GitHub Actions workflow .github/workflows/console-check.yml.

Changes

Moved all GitHub context interpolations from direct shell substitution to environment variables to prevent potential code injection attacks:

  1. Set pending status step (line 49): Added REPOSITORY, SHA, and CONTEXT environment variables
  2. Determine mode step (line 61): Added EVENT_NAME and REF environment variables
  3. Trigger console build step (line 78): Added MATRIX_REPO, NATIVE_REF, CALLBACK_REPO, CALLBACK_SHA, CALLBACK_CONTEXT, MODE, and PR_NUMBER environment variables

All environment variables are properly quoted in the shell commands to prevent injection.

Security Impact

The previous implementation used direct GitHub context interpolation in shell commands (e.g., ${{ github.repository }}), which could allow attackers to inject malicious code through PR titles, branch names, or other user-controlled GitHub context data.

By moving these values to environment variables and properly quoting them, we eliminate the injection vector while maintaining the same functionality.

References

🤖 Generated with fix-it-felix-sentry[bot]

#skip-changelog

Move GitHub context interpolations into environment variables to prevent
potential shell injection attacks. All untrusted GitHub context data is
now passed through environment variables and properly quoted in shell
commands.

Fixes:
- Line 60: Determine mode step now uses ENV vars for event_name and ref
- Line 75: Trigger console build step now uses ENV vars for all GitHub context data

References:
- Parent ticket: https://linear.app/getsentry/issue/VULN-1605
- Child ticket: https://linear.app/getsentry/issue/ENG-7570

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@jpnurmi jpnurmi requested a review from JoshuaMoelans May 11, 2026 11:07
Copy link
Copy Markdown
Member

@JoshuaMoelans JoshuaMoelans left a comment

Choose a reason for hiding this comment

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

LGTM, I thought matrix. and github. weren't vulnerable like inputs.X which we moved to env in the consoles side of this workflow, but doesn't hurt to move these into env too.

@JoshuaMoelans JoshuaMoelans merged commit d41441e into master May 11, 2026
61 checks passed
@JoshuaMoelans JoshuaMoelans deleted the fix-shell-injection-vulnerability branch May 11, 2026 13: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