fix: prevent GitHub Actions script injection via untrusted context data#1232
Open
lloyd-c137 wants to merge 1 commit into
Open
fix: prevent GitHub Actions script injection via untrusted context data#1232lloyd-c137 wants to merge 1 commit into
lloyd-c137 wants to merge 1 commit into
Conversation
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.
Security Fix: GitHub Actions Script Injection
Vulnerability
GitHub Actions workflows interpolate
${{ }}expressions before shell execution. When user-controllable context data (github.event.*,github.sha,inputs.*) is used directly inrun:shell blocks, an attacker can inject arbitrary commands by crafting malicious input (e.g., PR title, branch name).Impact
Fix
Moved all untrusted GitHub context expressions from
run:blocks intoenv:blocks, where they are safely handled by the Actions runner:.github/workflows/deploy.yml${{ github.sha }}moved to env var.github/workflows/escrow-cleanup.yml${{ github.event.pull_request.* }}and${{ github.repository }}moved to env vars.github/workflows/pr-review.yml${{ inputs.pr_number }}and${{ github.event.* }}moved to env vars and shell conditionalsReference: GitHub Security Lab - Keeping your GitHub Actions and workflows secure
Wallet: DcUbHKteCFNpnntJxCfixXvBcB5SGTQxbTz2eeXSr2nn
Wallet: DcUbHKteCFNpnntJxCfixXvBcB5SGTQxbTz2eeXSr2nn
This is a proactive security fix for GitHub Actions script injection vulnerabilities discovered during automated security auditing. Not associated with a specific bounty issue — submitted under the project's security reporting guidelines.