From 8ba03a605138c677b7efe6060a81f02470ba694e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Pi=C4=85tkowski?= Date: Wed, 24 Jun 2026 10:09:19 +0200 Subject: [PATCH] fix: remove GitHub Actions script injection in debug_info step (CWE-94) The `debug_info` "Print github context JSON" step interpolated `${{ toJson(github) }}` directly into a `run:` shell heredoc in four reusable workflows. GitHub Actions substitutes `${{ }}` into the script before the shell runs, so attacker-controllable event fields (e.g. a commit message containing an `EOF` line plus shell commands) could break out of the heredoc and execute arbitrary commands on the runner. Pass the context through an `env:` variable and print it with `echo "$GITHUB_CONTEXT"` so it is treated as data, mirroring the existing safe `COMMIT_MESSAGE` pattern in create-release.yaml. Also add a report-only zizmor self-scan to validate-workflows.yaml so this class of issue is surfaced in the Security tab going forward (CodeQL did not catch it). It is non-blocking (continue-on-error) and does not gate on the repo's pre-existing findings. Reported via giantswarm/giantswarm#36940. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/create-release-pr.yaml | 7 +++--- .github/workflows/create-release.yaml | 7 +++--- .../workflows/ensure-major-version-tags.yaml | 7 +++--- .github/workflows/update-chart.yaml | 7 +++--- .github/workflows/validate-workflows.yaml | 23 +++++++++++++++++++ CHANGELOG.md | 10 ++++++++ 6 files changed, 45 insertions(+), 16 deletions(-) diff --git a/.github/workflows/create-release-pr.yaml b/.github/workflows/create-release-pr.yaml index 194f29f..fe12f2d 100644 --- a/.github/workflows/create-release-pr.yaml +++ b/.github/workflows/create-release-pr.yaml @@ -20,10 +20,9 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Print github context JSON - run: | - cat <