Skip to content

fix: Prevent script injection in rust-toolchain-update workflow#3284

Open
fix-it-felix-sentry[bot] wants to merge 1 commit intomasterfrom
fix/eng-7552-github-script-injection
Open

fix: Prevent script injection in rust-toolchain-update workflow#3284
fix-it-felix-sentry[bot] wants to merge 1 commit intomasterfrom
fix/eng-7552-github-script-injection

Conversation

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

Summary

This PR fixes a high-severity security vulnerability where untrusted GitHub context data could be injected into the github-script action in the rust-toolchain-update workflow.

Changes

  • Moved all GitHub context data (github.ref_name) and workflow outputs from inline string interpolation to environment variables
  • Updated the script to access data via process.env instead of direct interpolation
  • This prevents potential script injection attacks where malicious actors could inject code through branch names or other GitHub context data

Security Impact

The previous implementation used ${{ github.ref_name }} directly in the script block, which could allow an attacker to inject arbitrary code if they could control the ref name. The fix follows GitHub's security best practices by using intermediate environment variables.

Testing

The workflow logic remains functionally identical - it simply accesses the same data through environment variables instead of direct interpolation. The workflow will be tested on the next scheduled run or manual trigger.

References

Move GitHub context data from inline interpolation to environment
variables to prevent potential script injection attacks. This addresses
a high-severity security finding where untrusted data from github.ref_name
and workflow outputs could be injected into the github-script action.

All GitHub context and workflow output data is now passed through the
env: block and accessed via process.env in the script, following GitHub's
security best practices.

Fixes: https://linear.app/getsentry/issue/VULN-1587
Fixes: https://linear.app/getsentry/issue/ENG-7552

Co-Authored-By: fix-it-felix-sentry[bot] <260785270+fix-it-felix-sentry[bot]@users.noreply.github.com>
@fix-it-felix-sentry fix-it-felix-sentry Bot requested review from a team and szokeasaurusrex as code owners April 29, 2026 03:11
@linear-code
Copy link
Copy Markdown

linear-code Bot commented Apr 29, 2026

@github-actions
Copy link
Copy Markdown
Contributor

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

- Prevent script injection in rust-toolchain-update workflow ([#3284](https://github.com/getsentry/sentry-cli/pull/3284))

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 d61c477

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