fix(security): prevent Actions script injection in workflows #326

Merged
jmiller merged 1 commits from fix/workflow-actions-injection into main 2026-06-29 16:19:28 +00:00
Owner

Summary

Fixes the canonical source of the Actions script-injection vulnerability tracked in MokoConsulting/Template-Joomla#35. Untrusted ${{ }} expressions were interpolated directly into run: shell bodies, allowing command injection via a crafted issue title, PR head ref, or reusable-workflow input. Each is now passed through an env: 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)

Workflow Untrusted value moved to env:
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 (×2)

*.sha / *.number interpolations 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

  • All 5 files parse as valid YAML.
  • No untrusted ${{ }} remains inside any run: assignment; run bodies now reference $GATE, $DETAILS, $ISSUE_TITLE, $BRANCH, $HEAD/$BASE, $HEAD_REF.

Closes the upstream half of Template-Joomla#35.

## Summary Fixes the canonical source of the Actions **script-injection** vulnerability tracked in `MokoConsulting/Template-Joomla#35`. Untrusted `${{ }}` expressions were interpolated directly into `run:` shell bodies, allowing command injection via a crafted issue title, PR head ref, or reusable-workflow input. Each is now passed through an `env:` 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) | Workflow | Untrusted value moved to `env:` | |---|---| | `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` (×2) | `*.sha` / `*.number` interpolations 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 - All 5 files parse as valid YAML. - No untrusted `${{ }}` remains inside any `run:` assignment; run bodies now reference `$GATE`, `$DETAILS`, `$ISSUE_TITLE`, `$BRANCH`, `$HEAD`/`$BASE`, `$HEAD_REF`. Closes the upstream half of Template-Joomla#35.
jmiller added 1 commit 2026-06-29 16:18:49 +00:00
fix(security): prevent Actions script injection in workflows
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Failing after 7s
Generic: Project CI / Lint & Validate (pull_request) Successful in 23s
Platform: mokocli CI / Gate 1: Code Quality (pull_request) Failing after 1m12s
pr-check.yml / Branch Policy (pull_request) Has been cancelled
Universal: PR Check / Secret Scan (pull_request) Has been cancelled
Universal: PR Check / Validate PR (pull_request) Has been cancelled
Generic: Repo Health / Access control (pull_request) Has been cancelled
Generic: Repo Health / Site Health (pull_request) Has been cancelled
Branch Cleanup / Delete merged branch (pull_request) Has been cancelled
Universal: Workflow Sync Trigger / Sync workflows to live repos (pull_request) Has been cancelled
Generic: Project CI / Tests (pull_request) Has been cancelled
Platform: mokocli CI / Gate 2: Unit Tests (8.1) (pull_request) Has been cancelled
Platform: mokocli CI / Gate 2: Unit Tests (8.2) (pull_request) Has been cancelled
Platform: mokocli CI / Gate 2: Unit Tests (8.3) (pull_request) Has been cancelled
Platform: mokocli CI / Gate 3: Self-Health Check (pull_request) Has been cancelled
Platform: mokocli CI / Gate 4: Governance (pull_request) Has been cancelled
Platform: mokocli CI / Gate 5: Template Integrity (pull_request) Has been cancelled
Platform: mokocli CI / CI Summary (pull_request) Has been cancelled
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Universal: PR Check / Report Issues (pull_request) Has been cancelled
Generic: Repo Health / Scripts governance (pull_request) Has been cancelled
Generic: Repo Health / Repository health (pull_request) Has been cancelled
Generic: Repo Health / Report: Scripts Governance (pull_request) Has been cancelled
Generic: Repo Health / Report: Repository Health (pull_request) Has been cancelled
RC Revert / Rename rc/ back to dev/ (pull_request) Has been cancelled
113af457d9
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
jmiller merged commit 9fdd6c5cf9 into main 2026-06-29 16:19:28 +00:00
jmiller deleted branch fix/workflow-actions-injection 2026-06-29 16:19:29 +00:00
Sign in to join this conversation.
No Reviewers
No labels
Priority -
Type -
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoCLI#326