Skip to content

Move release and tag version into env vars to prevent template injection#2049

Merged
adamtheturtle merged 4 commits intomainfrom
env-vars-release
Mar 17, 2026
Merged

Move release and tag version into env vars to prevent template injection#2049
adamtheturtle merged 4 commits intomainfrom
env-vars-release

Conversation

@adamtheturtle
Copy link
Member

@adamtheturtle adamtheturtle commented Mar 17, 2026

Moves steps.calver.outputs.release and steps.tag_version.outputs.new_tag into environment variables in run/command blocks to prevent template injection, following GitHub's recommended security pattern.

See: https://docs.github.com/en/actions/concepts/security/script-injections


Note

Medium Risk
Touches the release pipeline commands used for tagging, packaging, and publishing; while changes are mostly quoting/variable plumbing, mistakes could break releases across multiple targets.

Overview
Hardens the release GitHub Actions workflow by moving dynamic values (e.g., computed release and new_tag, plus modifiedFiles counts) into step env vars and then referencing them inside run/retry command blocks with shell quoting to reduce template/script injection risk.

This update is applied across changelog/version updates, tag checkouts, PyPI install checks, Homebrew formula generation, PyInstaller binary builds, Docker image tagging/build args, and release asset uploads.

Removes the template-injection rule override from zizmor.yml (no longer disabled).

Written by Cursor Bugbot for commit 8245c36. This will update automatically on new commits. Configure here.

run: echo "vws-cli==${{ needs.build.outputs.new_tag }}" > requirements.txt
env:
NEW_TAG: ${{ needs.build.outputs.new_tag }}
run: echo "vws-cli==$NEW_TAG" > requirements.txt
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows steps use Bash env syntax

High Severity

In build-windows, run blocks reference NEW_TAG as $NEW_TAG, but default Windows shell is PowerShell. That syntax reads an undefined PowerShell variable, not the env var from env:. This makes requirements.txt version empty and causes gh release upload to run with an empty tag.

Additional Locations (1)
Fix in Cursor Fix in Web

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

@adamtheturtle adamtheturtle merged commit dc8846d into main Mar 17, 2026
16 checks passed
@adamtheturtle adamtheturtle deleted the env-vars-release branch March 17, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant