Skip to content

Fix script injection in draft release workflow - #15

Merged
fukuanru merged 1 commit into
mainfrom
fix/draft-release-script-injection
Oct 29, 2026
Merged

fukuanru merged 1 commit into
mainfrom
fix/draft-release-script-injection

Conversation

@fukuanru

Copy link
Copy Markdown
Collaborator

Generated release notes and the release title were expanded into Bash source before execution, allowing shell syntax in release metadata to be interpreted as commands. Write the modified notes directly with Node's file API and pass the title, version, and repository to gh through quoted environment variables so their contents remain literal data.

Read github-script inputs from environment variables, reject invalid stable version tags or increment types, and remove the unused checkout and title-escaping step. The release job retains contents: write for release creation; input validation remains permissionless.

Validation:

  • actionlint .github/workflows/create-draft-release.yaml
  • git diff --check
  • Six local fixture checks against the workflow's extracted scripts, with GitHub API calls and gh mocked: latest-release fallback, version increments, invalid-input rejection, and normal/special-character notes and titles. Quotes, command substitutions, backticks, Unicode, and newlines remain literal; marker commands do not execute.

Live API note generation and a dispatched draft-release run remain unverified. No live release or tag was created during validation.

Co-authored-by: Codex <noreply@lycorp.co.jp>
@fukuanru
fukuanru merged commit ff48596 into main Oct 29, 2026
1 check passed
@fukuanru
fukuanru deleted the fix/draft-release-script-injection branch October 29, 2026 06:39
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.

2 participants