Public Access
fix(security): prevent Actions script injection in workflows #326
Reference in New Issue
Block a user
Delete Branch "fix/workflow-actions-injection"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes the canonical source of the Actions script-injection vulnerability tracked in
MokoConsulting/Template-Joomla#35. Untrusted${{ }}expressions were interpolated directly intorun:shell bodies, allowing command injection via a crafted issue title, PR head ref, or reusable-workflow input. Each is now passed through anenv:block and referenced as a shell variable (env vars are not subject to${{ }}expansion).Because MokoCLI is the upstream that distributes
.mokogitea/workflows/*to Template-Joomla and all consumer repos via the workflow sync, fixing it here propagates the fix everywhere (and won't be reverted on the next sync).Changes (5 files, +20/−10)
env:ci-issue-reporter.ymlinputs.gate/details/severity/workflowissue-branch.ymlgithub.event.issue.titlebranch-cleanup.ymlgithub.event.pull_request.head.refpr-check.ymlgithub.head_ref/github.base_refauto-release.ymlgithub.event.pull_request.head.ref(×2)*.sha/*.numberinterpolations were left as-is (hex/integer — not exploitable).if:expression contexts (e.g. branch-cleanup's guards) are not shell and were not changed.Verification
${{ }}remains inside anyrun:assignment; run bodies now reference$GATE,$DETAILS,$ISSUE_TITLE,$BRANCH,$HEAD/$BASE,$HEAD_REF.Closes the upstream half of Template-Joomla#35.
Untrusted ${{ }} expressions (issue titles, PR head refs, reusable-workflow inputs) were interpolated directly into run: shell bodies, allowing command injection. Each is now passed through an env: block and referenced as a shell variable in the script (env vars are not subject to ${{ }} expansion). Files: - ci-issue-reporter.yml inputs.gate/details/severity/workflow - issue-branch.yml github.event.issue.title - branch-cleanup.yml github.event.pull_request.head.ref - pr-check.yml github.head_ref / github.base_ref - auto-release.yml github.event.pull_request.head.ref (x2) Propagates to all template consumers via the workflow sync. Refs MokoConsulting/Template-Joomla#35. Authored-by: Moko Consulting