Skip to content

ci: fix zizmor template-injection in 5 QA RPC integration workflows (#21132) - #22363

Merged
lystopad merged 3 commits into
mainfrom
feature/lystopad/zizmor-ti-rpc-integration-21132
Jul 10, 2026
Merged

lystopad merged 3 commits into
mainfrom
feature/lystopad/zizmor-ti-rpc-integration-21132

Conversation

@lystopad

@lystopad lystopad commented Jul 9, 2026

Copy link
Copy Markdown
Member

Part of #21132 — template-injection cleanup, batch 3 (5 files).

Removes the following from the template-injection ignore list in .github/zizmor.yml after fixing every finding in each:

  • qa-rpc-integration-tests.yml
  • qa-rpc-integration-tests-gnosis.yml
  • qa-rpc-integration-tests-latest.yml
  • qa-rpc-integration-tests-polygon.yml
  • qa-rpc-integration-tests-clients.yml

What changed

${{ … }} expansions inside run: blocks are substituted into the script text before the shell parses it, so an attacker-influenced value could inject shell code. Each flagged expansion is now routed so its value arrives as data, not code:

  • Built-ins where they exist: github.base_ref/github.ref$GITHUB_BASE_REF/$GITHUB_REF; github.ref_name$GITHUB_REF_NAME; runner.name$RUNNER_NAME; github.workspace$GITHUB_WORKSPACE.
  • Step-level env: for contexts with no built-in: runner.workspaceRUNNER_WS; matrix.*INSTALL_DIR/CLIENT/TEST_SCRIPT; steps.*.outputs.* and steps.*.outcomeTEST_RESULT/TEST_EXECUTED/SAVE_CHAINDATA_OUTCOME; github.workflowWORKFLOW.
  • Already-env contexts (env.TEST_RESULT_DIR, env.CHAIN) referenced directly as $TEST_RESULT_DIR/$CHAIN.

The Generate Summary steps that built the report via a quoted heredoc are rewritten as an { echo …; } > file block (a quoted heredoc can't expand the routed $VARs, and unquoting it would run the ``` fence as command substitution). Output is byte-identical.

Command substitutions like $(git rev-parse HEAD) are fixed commands over trusted data and are left as-is.

Verification

  • zizmor 1.24.1 with the repo config: 0 template-injection findings across all five files; full-repo exit code unchanged at 12 (< 14, passes the CI gate).
  • actionlint: no errors; SC2086 (info-level shellcheck) counts are ≤ the previous versions for every file — no new findings introduced.

…21132)

Route untrusted/dynamic contexts (runner.*, env.*, steps.*, github.*,
matrix.*) through env vars or GitHub built-ins so their values are
treated as data rather than substituted into shell text. Drop the five
files from the template-injection ignore list in .github/zizmor.yml.

Part of #21132.
@lystopad lystopad self-assigned this Jul 9, 2026
@lystopad lystopad added the QA label Jul 9, 2026
@lystopad
lystopad enabled auto-merge July 9, 2026 20:46
@lystopad
lystopad added this pull request to the merge queue Jul 10, 2026
Merged via the queue into main with commit 90d8756 Jul 10, 2026
92 of 94 checks passed
@lystopad
lystopad deleted the feature/lystopad/zizmor-ti-rpc-integration-21132 branch July 10, 2026 07:21
taratorio added a commit that referenced this pull request Jul 10, 2026
Review follow-up: interpolate matrix.shard through a step env var
instead of directly into the run block, matching the cache-warming
step's TARGET pattern and the template-injection hardening direction
of #22363. matrix.shard is repo-controlled, so hygiene rather than a
vulnerability fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants