Skip to content

Fix shell injection vulnerability in console-check workflow#1690

Open
fix-it-felix-sentry[bot] wants to merge 1 commit intomasterfrom
fix-shell-injection-vulnerability
Open

Fix shell injection vulnerability in console-check workflow#1690
fix-it-felix-sentry[bot] wants to merge 1 commit intomasterfrom
fix-shell-injection-vulnerability

Conversation

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

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]

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>
@github-actions
Copy link
Copy Markdown

Fails
🚫 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

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

Generated by 🚫 dangerJS against 3ae45dc

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.

0 participants