fix(ci): prevent tag injection in release workflow - #69
Closed
micahkendall wants to merge 1 commit into
Closed
Conversation
Collaborator
|
This is not useful. This release pipeline is generated by cargo dist. The build is failing because the generated code has changed. We can allow drift, but that's a bad idea without a compelling reason (i.e. something we need that dist doesn't do out-of-the-box). Someone else opened a PR to cargo-dist to fix this, yesterday. Meanwhile, this isn't a huge threat, because the only people who can exploit it are people with push access. |
Quantumplation
deleted the
codex/fix-tag-based-command-injection-in-workflow
branch
May 5, 2026 02:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
github.ref_namedirectly into shellrunblocks which created a command-injection vector when tags contain shell metacharacters.Description
tag-flagworkflow output that preformatted--tag=...withgithub.ref_nameto avoid embedding untrusted text into shell fragments.TAGin theplanstep and propagateTAGinto downstream jobenvcontexts.plan, local/globalbuildandhostrun blocks to calldistwith either--tag "$TAG"(quoted) or no--tagwhen empty, and to branch on the event type without building shell snippets from the tag.github.ref_nameintorunscript text.Testing
rg -n "tag-flag|github.ref_name" .github/workflows/release.ymland verified no direct interpolation remains inrunblocks.distinvocations in.github/workflows/release.ymlto confirm they now use theTAGenv var and quoted--tag "$TAG"or omit the flag when empty.yaml.safe_load) but the environment lackedPyYAML, so that automated parse check could not be completed in this environment.Codex Task