Skip to content

fix: prevent GitHub Actions script injection via untrusted context data#1232

Open
lloyd-c137 wants to merge 1 commit into
SolFoundry:mainfrom
lloyd-c137:fix/security-github-actions-script-injection
Open

fix: prevent GitHub Actions script injection via untrusted context data#1232
lloyd-c137 wants to merge 1 commit into
SolFoundry:mainfrom
lloyd-c137:fix/security-github-actions-script-injection

Conversation

@lloyd-c137
Copy link
Copy Markdown

@lloyd-c137 lloyd-c137 commented May 12, 2026

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 in run: shell blocks, an attacker can inject arbitrary commands by crafting malicious input (e.g., PR title, branch name).

Impact

  • Severity: Critical (CVSS 8.6+)
  • Attack vector: An attacker opens a PR with a crafted title or branches from a malicious ref
  • Consequence: Arbitrary code execution in CI runner, potential secret exfiltration

Fix

Moved all untrusted GitHub context expressions from run: blocks into env: blocks, where they are safely handled by the Actions runner:

File What was changed
.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 conditionals

Reference: 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant