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
fix: route workflow_dispatch inputs through env vars to prevent template injection (template-injection) #1532
Tracked from #331 (zizmor CI gate). PR #1530 introduced zizmor enforcement and found that dispatch-to-contribs.yml uses ${{ github.event.inputs.version }} directly inside run: blocks, which is a template injection vector.
The workflow is workflow_dispatch and release-triggered only — no external attacker can trigger it without maintainer write access. The practical risk is low (requires insider intent or a compromised maintainer account), but the fix is mechanical and eliminates the issue entirely.
Affected locations
File
Lines
Expression
dispatch-to-contribs.yml
33–34
${{ github.event.inputs.version }} in version-resolve run: block
dispatch-to-contribs.yml
60
${{ steps.version.outputs.version }} in dispatch run: block (low confidence)
Fix
Route template expressions through environment variables per the AGENTS.md convention:
# Before (vulnerable)run: | if [ -n "${{ github.event.inputs.version }}" ]; then VERSION="${{ github.event.inputs.version }}"# After (safe)env:
INPUT_VERSION: ${{ github.event.inputs.version }}run: | if [ -n "${INPUT_VERSION}" ]; then VERSION="${INPUT_VERSION}"
zizmor --fix can generate the corrected form automatically.
Definition of done
Route all template expressions in run: blocks through env: vars
Remove the template-injection entries from .github/zizmor.yml
zizmor reports no template-injection findings in dispatch-to-contribs.yml
Corrected a line-number error in the affected-locations table: the low-confidence steps.version.outputs.version finding is on line 60 (--field 'client_payload[version]=...'), not 59 — 59 is the preceding --field event_type=... line. Verified against a live zizmor run against this file: lines 33 and 34 are High confidence, line 60 is Low confidence, all matching the fix pattern described above.
Activity
simoncraf commentedon Sep 27, 2026
I would like to work on this.
planetf1 commentedon Sep 30, 2026
Corrected a line-number error in the affected-locations table: the low-confidence
steps.version.outputs.versionfinding is on line 60 (--field 'client_payload[version]=...'), not 59 — 59 is the preceding--field event_type=...line. Verified against a livezizmorrun against this file: lines 33 and 34 are High confidence, line 60 is Low confidence, all matching the fix pattern described above.planetf1 commentedon Sep 30, 2026
Assigned to @simoncraf — go ahead!
fix(ci): route template expressions through env in dispatch-to-contribs
fix(ci): route template expressions through env in dispatch-to-contri…