Template
Security: Actions script injection in workflows (untrusted ${{ }} interpolated into run:) #35
Reference in New Issue
Block a user
Delete Branch "%!s()"
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
Several
.mokogitea/workflows/*.ymlinterpolate untrusted${{ ... }}expressions directly intorun:shell bodies, which allows shell command injection (a crafted branch name, issue title, orworkflow_callinput can break out of the quotes). Because these workflows are template-sourced and synced downstream (e.g. into MokoSuiteCommunity), the fix belongs here (and ultimately in MokoCLI, the canonical source per the file headers) so it propagates and isn't reverted on the next sync.Affected (verified in MokoSuiteCommunity's synced copy)
ci-issue-reporter.ymlinputs.details,inputs.gate,inputs.severity,inputs.workflow(flagged by automated review)issue-branch.ymlgithub.event.issue.titlebranch-cleanup.ymlgithub.event.pull_request.head.refpr-check.ymlgithub.head_refauto-release.ymlgithub.event.pull_request.head.ref*.sha/*.numberinterpolations are not exploitable (hex/integer). Noterc-revert.ymlandci-joomla.ymlalready use the safeenv:pattern — apply it consistently.Fix
Pass each untrusted value via an
env:block and reference the environment variable inside the script (env vars are not subject to${{ }}expansion):Notes
cli//workflow source) so all template consumers inherit the fix.Raised from automated security review during MokoSuiteCommunity work.
Fixed at the canonical source in MokoCLI — PR MokoConsulting/MokoCLI#326 (merged to
main). All five workflows (ci-issue-reporter,issue-branch,branch-cleanup,pr-check,auto-release) now pass untrusted${{ }}values throughenv:blocks instead of interpolating them intorun:shell bodies.Since MokoCLI distributes
.mokogitea/workflows/*to this repo via the workflow sync, the hardened versions will land here automatically on the next sync (no manual change needed in Template-Joomla). Closing as resolved upstream.