Skip to content

fix: Prevent script injection vulnerability in platform-check action#5913

Merged
antonis merged 1 commit intomainfrom
fix/eng-7182-script-injection-vulnerability
Mar 30, 2026
Merged

fix: Prevent script injection vulnerability in platform-check action#5913
antonis merged 1 commit intomainfrom
fix/eng-7182-script-injection-vulnerability

Conversation

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

Summary

Fixes a high-severity script injection vulnerability in the platform-check GitHub 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

  • Added env: block to define environment variables for all inputs
  • Removed direct ${{ inputs.* }} interpolations from the script body
  • Updated the case statement to use environment variables ($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

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>
@linear-code
Copy link
Copy Markdown

linear-code bot commented Mar 29, 2026

@github-actions
Copy link
Copy Markdown
Contributor

Fails
🚫 Pull request is not ready for merge, please add the "ready-to-merge" label to the pull request
🚫 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

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 #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against 1ccaf4b

@antonis antonis merged commit bf1cc8c into main Mar 30, 2026
45 of 51 checks passed
@antonis antonis deleted the fix/eng-7182-script-injection-vulnerability branch March 30, 2026 06:44
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