Fix shell injection vulnerability in console-check workflow#1690
Open
fix-it-felix-sentry[bot] wants to merge 1 commit intomasterfrom
Open
Fix shell injection vulnerability in console-check workflow#1690fix-it-felix-sentry[bot] wants to merge 1 commit intomasterfrom
fix-it-felix-sentry[bot] wants to merge 1 commit intomasterfrom
Conversation
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>
Instructions and example for changelogPlease add an entry to Example: ## Unreleased
### Fixes
- Fix shell injection vulnerability in console-check workflow ([#1690](https://github.com/getsentry/sentry-native/pull/1690))If none of the above apply, you can opt out of this check by adding |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
REPOSITORY,SHA, andCONTEXTenvironment variablesEVENT_NAMEandREFenvironment variablesMATRIX_REPO,NATIVE_REF,CALLBACK_REPO,CALLBACK_SHA,CALLBACK_CONTEXT,MODE, andPR_NUMBERenvironment variablesAll 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]