From e9f2327e173fc054eab29aedb594642c7020459f Mon Sep 17 00:00:00 2001 From: Ivan Graovac Date: Mon, 6 Jul 2026 14:40:50 -0400 Subject: [PATCH] fix: prevent expression injection via tag name in Release workflow The Prepare workspace snippet step interpolated ${{ env.GITHUB_REF_NAME }} directly into the shell command, allowing a crafted tag name to execute arbitrary commands on the runner and steal GITHUB_TOKEN. Pass the ref name through an environment variable and reference it as a quoted shell variable instead. Co-authored-by: Cursor --- .github/workflows/release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3e58b41..66be7cd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,7 +28,9 @@ jobs: XDG_CACHE_HOME: ~/.cache/bazel-repo run: bazel test //... - name: Prepare workspace snippet - run: .github/workflows/workspace_snippet.sh ${{ env.GITHUB_REF_NAME }} > release_notes.txt + env: + GITHUB_REF_NAME: ${{ github.ref_name }} + run: .github/workflows/workspace_snippet.sh "$GITHUB_REF_NAME" > release_notes.txt - name: Release uses: benchsci/action-gh-release@v1 with: