Repository navigation
security(ci): pass the resolved package version to apicompat through env - #365
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The change is narrowly scoped and has no unresolved review issues.
Review effort: Lite
Findings: None
What changed in this PR
This PR hardens the API compatibility workflow against template injection by passing the resolved package version through an environment variable.
Changes:
- Adds
PREV_VERSIONto the download step. - Uses quoted shell expansion for the package version.
| File | Description |
|---|---|
.github/workflows/api-compat.yaml |
Safely passes the resolved package version to the Bash download script. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Chris-Wolfgang
added this pull request to stack #369
September 26, 2026 16:57
Chris-Wolfgang
force-pushed
the
security/apicompat-template-injection
branch
from
September 26, 2026 17:45
57d1a5e to
3368ad6
Compare
zizmor's second template-injection finding in this repository: api-compat.yaml
spliced ${{ steps.nuget.outputs.version }} straight into the bash script that
downloads the previous package, so a step output was parsed as shell rather than
read as data. The value is produced by the preceding step from NuGet's own
version list, but "a step output reaches a run: body by expansion" is the shape
the rule exists to catch, and the fix costs nothing.
The version now arrives as PREV_VERSION and the script reads it with normal
quoting. Behaviour is unchanged.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Chris-Wolfgang
force-pushed
the
security/apicompat-template-injection
branch
from
September 26, 2026 19:19
3368ad6 to
513d9e2
Compare
8 tasks
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.
Second of Try-Pattern's two
zizmor/template-injectionalerts —.github/workflows/api-compat.yaml:95.${{ steps.nuget.outputs.version }}was spliced straight into the bash script that downloads the previous package:v='${{ steps.nuget.outputs.version }}'The value is produced by the preceding step from NuGet's own version list, so it is not attacker-controlled today — but "a step output reaches a
run:body by expansion" is exactly the shape the rule exists to catch, and closing it costs nothing. It now arrives asPREV_VERSIONand the script reads it with normal quoting. Behaviour unchanged.Stacked on #364 (the
codeql.yamlfix). Merge that one first — this PR's base is that branch, so merging this from its own page before #364 lands would merge it into that branch rather thanmain.🤖 Generated with Claude Code
Closes #347