fix(security): Prevent GitHub script injection in update-tox workflow#6171
Merged
alexander-alderman-webb merged 1 commit intomasterfrom Apr 29, 2026
Merged
Conversation
Replace direct GitHub context variable interpolation with environment variables to prevent code injection attacks. This addresses a high severity security finding where untrusted user input from GitHub context could be injected into the actions/github-script execution. Changes: - Add env block with BRANCH_NAME, COMMIT_TITLE, DATE, and BASE_BRANCH - Replace direct interpolation with process.env variables - Prevents script injection vulnerability (VULN-1594) Refs: https://linear.app/getsentry/issue/VULN-1594 Refs: https://linear.app/getsentry/issue/PY-2395 Co-Authored-By: fix-it-felix-sentry[bot] <260785270+fix-it-felix-sentry[bot]@users.noreply.github.com>
Contributor
Codecov Results 📊✅ 1854 passed | ⏭️ 334 skipped | Total: 2188 | Pass Rate: 84.73% | Execution Time: 2m 55s All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 12870 uncovered lines. Generated by Codecov Action |
alexander-alderman-webb
approved these changes
Apr 29, 2026
6 tasks
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
This PR fixes a high severity security vulnerability where untrusted user input from GitHub context variables could be injected into the
actions/github-scriptexecution, potentially allowing attackers to steal secrets and code.Changes
env:block to pass GitHub context variables as environment variables${{ }}interpolation withprocess.envvariables in the scriptBRANCH_NAME,COMMIT_TITLE,DATE, andBASE_BRANCHSecurity Impact
The previous implementation directly interpolated GitHub context data into the JavaScript code executed by
actions/github-script. This created a code injection vulnerability where malicious input could execute arbitrary code in the workflow runner.The fix uses environment variables as an intermediate layer, which prevents code injection by treating the data as strings rather than executable code.
References