Skip to content

ci: prevent script injection in Prerelease workflow - #192

Draft
laileni-aws wants to merge 1 commit into
mainfrom
fix/acat-script-injection-release-yml
Draft

ci: prevent script injection in Prerelease workflow#192
laileni-aws wants to merge 1 commit into
mainfrom
fix/acat-script-injection-release-yml

Conversation

@laileni-aws

@laileni-aws laileni-aws commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes an ACAT/AppSec script injection finding in .github/workflows/release.yml (the Prerelease workflow). Three user-controlled GitHub context values were interpolated directly via ${{ }} into inline run: scripts. An attacker who controls a workflow_dispatch input or pushes a branch with a crafted name could inject arbitrary shell commands into a job that runs with contents: write.

Untrusted value Where Trigger
github.event.inputs.tag_name run: echo "TAG_NAME=..." workflow_dispatch
github.ref_name feature/* handling push
github.ref_name release/* handling push

Fix

Per GitHub Actions security-hardening guidance, each untrusted value is now bound to a step-level env: variable and referenced as a quoted shell variable ($TAG_NAME_INPUT, "$REF_NAME"). Environment values are passed to the shell as data rather than expanded into script text, which removes the injection vector. No behavior change for legitimate inputs.

Testing

  • python3 -c "import yaml; yaml.safe_load(open('.github/workflows/release.yml'))" -> parses OK
  • Verified no ${{ github.* }} interpolation remains inside any run: block; the remaining references are all inside env: blocks (the safe pattern).

Bind user-controlled GitHub context values to step-level env vars instead
of interpolating them directly into inline run: scripts:

- github.event.inputs.tag_name (workflow_dispatch input)
- github.ref_name (feature/* and release/* branch handling)

Following GitHub Actions security-hardening guidance, the values are now
passed via env: and referenced as quoted shell variables, so a crafted
branch name or dispatch input can no longer be interpreted as script.

Resolves ACAT/GithubWorkflowIdentifier finding (script injection in GitHub
Actions workflows).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant