Skip to content

fix(security): Prevent GitHub script injection in update-tox workflow#6171

Merged
alexander-alderman-webb merged 1 commit intomasterfrom
fix-github-script-injection-vuln-1594
Apr 29, 2026
Merged

fix(security): Prevent GitHub script injection in update-tox workflow#6171
alexander-alderman-webb merged 1 commit intomasterfrom
fix-github-script-injection-vuln-1594

Conversation

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

Summary

This PR fixes a high severity security vulnerability where untrusted user input from GitHub context variables could be injected into the actions/github-script execution, potentially allowing attackers to steal secrets and code.

Changes

  • Added env: block to pass GitHub context variables as environment variables
  • Replaced direct ${{ }} interpolation with process.env variables in the script
  • Affected variables: BRANCH_NAME, COMMIT_TITLE, DATE, and BASE_BRANCH

Security 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

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>
@fix-it-felix-sentry fix-it-felix-sentry Bot requested a review from a team as a code owner April 29, 2026 11:46
@linear-code
Copy link
Copy Markdown

linear-code Bot commented Apr 29, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 29, 2026

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 alexander-alderman-webb merged commit c24419e into master Apr 29, 2026
166 of 168 checks passed
@alexander-alderman-webb alexander-alderman-webb deleted the fix-github-script-injection-vuln-1594 branch April 29, 2026 12:47
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