Skip to content

Prevent output injection in publish-release workflow - #18

Merged
alessandrobologna merged 1 commit into
mainfrom
codex/fix-release-workflow-output-injection
May 27, 2026
Merged

Prevent output injection in publish-release workflow#18
alessandrobologna merged 1 commit into
mainfrom
codex/fix-release-workflow-output-injection

Conversation

@alessandrobologna

Copy link
Copy Markdown
Member

Motivation

  • The publish-release workflow wrote a user-controlled release_tag input directly to $GITHUB_OUTPUT, allowing newline-based output injection to override checkout_ref and version and cause releases to be built from unintended refs.
  • This could let an actor with workflow_dispatch rights cause the workflow to check out and publish code from an attacker-controlled ref while using the workflow's AWS publishing credentials.

Description

  • Add an explicit validation to reject release_tag values containing newline characters (\n or \r) in the Resolve release ref step of .github/workflows/publish-release.yml to block output injection.
  • Replace echo-based writes to $GITHUB_OUTPUT with printf-based writes for tag, version, and checkout_ref to ensure literal, single-line output assignments.

Testing

  • Inspected the workflow file with sed -n '1,140p' .github/workflows/publish-release.yml to verify the new newline validation and that the printf writes are present.
  • Examined the relevant lines with nl -ba .github/workflows/publish-release.yml | sed -n '48,86p' to confirm the Resolve release ref logic now rejects \n/\r and writes outputs with printf.
  • Confirmed the change is limited to release-ref output handling and no other workflow behavior was modified; all inspections succeeded.

Codex Task

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens the release publishing workflow against $GITHUB_OUTPUT injection from manually supplied release tags.

Changes:

  • Rejects release_tag values containing newline or carriage-return characters.
  • Replaces echo output writes for release ref outputs with printf single-line assignments.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@alessandrobologna
alessandrobologna merged commit 9675f02 into main May 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants