You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Script injection: github.ref_name / github.ref interpolated into shell run: on push path #26
action.yml interpolates ${{ github.ref_name }} and ${{ github.ref }} directly into the composite action's run: (shell) block on the non-PR (push / workflow_dispatch) path:
COMMIT_OID="${{ github.sha }}"REF="${{ github.ref }}"PR_NUMBER=$(gh pr list \--repo "$GITHUB_REPOSITORY" \--head "${{ github.ref_name }}" \--state open --json number --jq '.[0].number // empty' 2>/dev/null || true)
Because these branch-derived values are interpolated into a shell context, a branch named e.g. foo-$(command) — or one using backticks or a " to break out of the double quotes — results in command execution when a consuming workflow runs on push or workflow_dispatch for that ref.
Impact
Reachable by anyone who can push a branch (or workflow_dispatch) to a repo that uses this action — i.e. it requires write access, so the marginal privilege is limited (such a user can generally already run code in CI). Even so, it's a script-injection footgun in a first-party action: it defeats the usual expectation that uses: of a trusted action is safe, and the injected code runs with whatever token the caller grants (commonly code-quality: write).
Thanks for reporting this and for including such a clear analysis and suggested fix. We agree that interpolating these values directly into the shell is an unnecessary footgun, even though exploitation generally requires existing write access and therefore offers limited additional privilege.
We’ll track a fix to pass the values through environment variables and audit the other expressions used in the shell block while we’re there. We expect to tackle this soon.
Follow-up regression tests cover branch names containing shell metacharacters and reject GitHub expressions embedded in run: blocks to prevent this class of vulnerability from returning.
Thanks again for reporting this. ❤️ Closing as resolved.
Activity
ci: drop ref_name metachar guard; track upstream injection instead
ci: add GitHub Code Quality coverage (Python + Go) alongside Codecov (#…
joshhale commentedon Sep 23, 2026
Thanks for reporting this and for including such a clear analysis and suggested fix. We agree that interpolating these values directly into the shell is an unnecessary footgun, even though exploitation generally requires existing write access and therefore offers limited additional privilege.
We’ll track a fix to pass the values through environment variables and audit the other expressions used in the shell block while we’re there. We expect to tackle this soon.
joshhale commentedon Oct 16, 2026
Fixed in the event-routing refactor, released in v1.4.3. The affected values are no longer interpolated into shell source.
Follow-up regression tests cover branch names containing shell metacharacters and reject GitHub expressions embedded in
run:blocks to prevent this class of vulnerability from returning.Thanks again for reporting this. ❤️ Closing as resolved.