From 14c2349b97f272e2853447ac8b82096dd1dc620e Mon Sep 17 00:00:00 2001 From: Sudeep Date: Mon, 6 Jul 2026 12:36:26 -0400 Subject: [PATCH] fix: prevent expression injection via tag name in Release workflow The Prepare Release 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 2967a48..f88cbed 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,7 +25,9 @@ jobs: - name: bazel test //... run: bazel test //... - name: Prepare Release - 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: