Validate VERSION before writing to GITHUB_OUTPUT in monorepo-release workflow#85
Open
Validate VERSION before writing to GITHUB_OUTPUT in monorepo-release workflow#85
Conversation
…elease workflow Co-authored-by: pmalarme <686568+pmalarme@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Validate VERSION before writing to GITHUB_OUTPUT
Validate VERSION before writing to GITHUB_OUTPUT in monorepo-release workflow
Feb 19, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request addresses a security vulnerability in the monorepo-release workflow by adding validation for the VERSION value extracted from pyproject.toml before it is written to GITHUB_OUTPUT. Without validation, a malicious version string containing newlines could inject arbitrary key-value pairs into the workflow output, potentially poisoning subsequent steps. The fix mirrors the existing security pattern already implemented in python-release.yml.
Changes:
- Added regex validation (
^[0-9a-zA-Z._-]+$) for VERSION immediately after extraction and before writing to GITHUB_OUTPUT - Added error handling that exits with status 1 if the VERSION format is unexpected
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.
Summary
VERSIONextracted frompyproject.tomlinmonorepo-release.ymlwas written directly to$GITHUB_OUTPUTwithout validation. A newline-containing version string (e.g.,1.0.0\nGH_TOKEN=leaked) could inject arbitrary key-value pairs intoGITHUB_OUTPUT, poisoning subsequent steps. This also silently produced a tag namedvif thegrep/sedpattern failed to match.Adds the same validation guard already present in
python-release.yml, applied immediately after extraction and before any output is written:Testing
uv run poe checkChecklist
Additional context
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.