fix: Prevent script injection vulnerability in platform-check action#5913
Merged
fix: Prevent script injection vulnerability in platform-check action#5913
Conversation
Fixes ENG-7182 (parent: VULN-1389)
Move input parameters from direct script interpolation to environment
variables to prevent potential code injection attacks. This follows
GitHub Actions security best practices by treating user input as
untrusted and isolating it through environment variables.
Changes:
- Add env block with PLATFORM, SAMPLE_CHANGED, NEEDS_IOS, NEEDS_ANDROID, NEEDS_WEB
- Remove ${{ inputs.* }} interpolations from script body
- Update case statement to use environment variables
References:
- https://linear.app/getsentry/issue/VULN-1389
- https://linear.app/getsentry/issue/ENG-7182
- https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#understanding-the-risk-of-script-injections
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Contributor
Instructions and example for changelogPlease add an entry to Example: ## Unreleased
### Fixes
- Prevent script injection vulnerability in platform-check action ([#5913](https://github.com/getsentry/sentry-react-native/pull/5913))If none of the above apply, you can opt out of this check by adding |
antonis
approved these changes
Mar 30, 2026
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 a high-severity script injection vulnerability in the
platform-checkGitHub Action by moving input parameters from direct script interpolation to environment variables.Security Issue
The action was using
${{ inputs.* }}directly in the bash script, which could allow an attacker to inject malicious code if they can control the input values. This pattern is flagged by Semgrep as a security risk.Changes
env:block to define environment variables for all inputs${{ inputs.* }}interpolations from the script body$NEEDS_IOS,$NEEDS_ANDROID,$NEEDS_WEB)Testing
The fix maintains the exact same logic and behavior. All variables are properly quoted with double quotes to prevent word splitting and maintain security.
References