Skip to content

Harden input interpolation and pin binfmt image#2

Merged
otavio merged 1 commit into
mainfrom
harden-input-interpolation
Jun 14, 2026
Merged

Harden input interpolation and pin binfmt image#2
otavio merged 1 commit into
mainfrom
harden-input-interpolation

Conversation

@otavio

@otavio otavio commented Jun 14, 2026

Copy link
Copy Markdown
Member

What

Hardens both composite actions against shell script injection and removes a couple of supply-chain / ergonomics gaps surfaced in a review.

Changes

  • Script-injection hardening (action.yml) — every ${{ inputs.* }} that was expanded directly into a run: shell body now flows through an env: block and is referenced as a quoted shell variable (TRUST_FLAKE, EMULATE_SYSTEMS, FLAKE_CHECK_ARGS, BUILD_HOSTS, BUILD_DEVSHELLS, BUILD_ATTRS, BUILD_ARGS, MATRIX_NAME, CHECKS, HEAD_SHA, DEVSHELL). Follows GitHub's hardening guidance: composite-action inputs can carry untrusted data, so they should never be interpolated into run steps. Word-splitting behavior for the args inputs is preserved.
  • Token no longer baked into a script — the App token moves to an APP_TOKEN env var instead of being interpolated into the NIX_CONFIG script text.
  • Pinned tonistiigi/binfmt — was implicit :latest, now tonistiigi/binfmt:qemu-v9.2.2.
  • update-flake checkout opt-out — added a checkout input (default "true") gating the checkout step, matching the CI action; documented in the README.

Verification

  • Confirmed no ${{ ... }} remains inside any run: body (survivors are all in with:/env:/value:/action fields).
  • Both action files parse as valid YAML.

No behavior change for existing callers. Third-party actions were all already on current major versions, so no version bumps were needed.

Pass action inputs through env vars instead of interpolating
${{ inputs.* }} directly into run: shell bodies, closing the
script-injection path flagged by GitHub's hardening guidance.
The App token likewise moves to an env var so it is no longer
baked into the NIX_CONFIG script text.

Also pin the tonistiigi/binfmt image (was implicit :latest) and
add a checkout opt-out to update-flake, matching the CI action.
@otavio
otavio merged commit 4fa3b67 into main Jun 14, 2026
9 checks passed
@otavio
otavio deleted the harden-input-interpolation branch June 14, 2026 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant