Skip to content

fix(actions): pass action_path through the environment like everything else - #7

Merged
rldyourmnd merged 1 commit into
mainfrom
fix/pass-action-path-through-env
Aug 23, 2026
Merged

fix(actions): pass action_path through the environment like everything else#7
rldyourmnd merged 1 commit into
mainfrom
fix/pass-action-path-through-env

Conversation

@rldyourmnd

Copy link
Copy Markdown
Contributor

Code scanning, enabled yesterday in #6, surfaced two actions/code-injection findings — one per composite action, both the same line:

root="$(cd -- "${{ github.action_path }}/../../.." && pwd)"

Every other value these files use — command, plan, state, target, output, at, operation — already goes through env: and is read as a shell variable. This single expression was interpolated straight into the script.

Not exploitable, still worth fixing

github.action_path is set by the runner, not by a caller, so there is no injection available through it today.

The rule targets the shape, and the shape is what makes the habit hold. A file with one exception teaches its next reader that interpolating into run: is sometimes fine here — and the next value someone adds may not be runner-controlled. The cost of consistency is one line; the cost of the exception is that the rule stops being a rule.

Verification

  • scripts/validate_module.sh → OK (10 contract tests, plus the pin check)
  • actionlint 1.7.12 → clean across the whole repository
  • zizmor 1.26.1 --persona=pedanticNo findings to report on both files

Not in scope here

The seven actions/untrusted-checkout findings in the workflow files are a separate question about the contract_sha model — they are being written up on their own rather than folded in, because the answer is a design decision about deployment authority, not a mechanical edit.

…g else

Enabling code scanning surfaced two `actions/code-injection` findings, one in
each composite action, both on the same line:

    root="$(cd -- "${{ github.action_path }}/../../.." && pwd)"

Every other value these two files use — command, plan, state, target, output,
at, operation — is already passed through `env:` and read as a shell variable.
This one expression was interpolated straight into the script.

`github.action_path` is set by the runner, so this is not exploitable today.
The rule is about the shape rather than this particular value, and the shape is
what makes the habit reliable: a file with one exception teaches a reader that
interpolation is sometimes acceptable here, and the next value added may not be
runner-controlled. Both sites now go through `ACTION_PATH`.

Verified: `scripts/validate_module.sh` OK (10 contract tests, pin check),
actionlint 1.7.12 clean across the repository, and zizmor 1.26.1
`--persona=pedantic` reports no findings on either file.
@rldyourmnd
rldyourmnd merged commit ce0f4df into main Aug 23, 2026
4 checks passed
@rldyourmnd
rldyourmnd deleted the fix/pass-action-path-through-env branch August 23, 2026 22:26
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