fix(workflows): Prevent script injection in sentry_dogfood workflow#607
Closed
fix-it-felix-sentry[bot] wants to merge 1 commit intomainfrom
Closed
fix(workflows): Prevent script injection in sentry_dogfood workflow#607fix-it-felix-sentry[bot] wants to merge 1 commit intomainfrom
fix-it-felix-sentry[bot] wants to merge 1 commit intomainfrom
Conversation
Fixes script injection vulnerability by moving GitHub context variables to environment variables instead of direct interpolation in run scripts. This prevents potential code injection attacks where untrusted input from GitHub context (e.g., PR titles, branch names) could be used to inject malicious code into the workflow runner. Changes: - Move all GitHub context variables to env: block - Reference environment variables with double quotes in scripts - Apply fix to both iOS and Android upload steps Fixes: https://linear.app/getsentry/issue/VULN-1590 Fixes: https://linear.app/getsentry/issue/EME-1088 Co-Authored-By: fix-it-felix-sentry[bot] <260785270+fix-it-felix-sentry[bot]@users.noreply.github.com>
Contributor
📲 Install BuildsAndroid
|
Contributor
|
closing in favor of #608 |
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
Fixes script injection vulnerability in the Sentry Dogfood workflow by moving GitHub context variables to environment variables instead of direct interpolation in run scripts.
Details
This PR addresses a High severity security finding where GitHub context data was being directly interpolated in
run:steps, which could allow attackers to inject malicious code through untrusted input (e.g., PR titles, branch names, etc.).Changes Made:
env:block for both iOS and Android upload stepsSecurity Impact:
The vulnerability allowed potential code injection through:
github.event.pull_request.head.shagithub.event.pull_request.base.shagithub.repositorygithub.head_refgithub.base_refgithub.event.numbergithub.shagithub.ref_namegithub.event_nameBy moving these to environment variables, GitHub Actions evaluates them only once during the env block processing, preventing injection attacks.
Related Issues
References