Skip to content

fix(release): avoid shell interpolation of release tag#95

Open
HikaruEgashira wants to merge 1 commit intomainfrom
codex/fix-release-workflow-tag-injection-vulnerability
Open

fix(release): avoid shell interpolation of release tag#95
HikaruEgashira wants to merge 1 commit intomainfrom
codex/fix-release-workflow-tag-injection-vulnerability

Conversation

@HikaruEgashira
Copy link
Copy Markdown
Member

Motivation

  • The consolidated release workflow read the tag into a shell script using the GitHub expression github.ref_name, which can contain shell metacharacters and enable command substitution and arbitrary command execution in CI.

Description

  • Replace TAG="${{ github.ref_name }}" with TAG="$GITHUB_REF_NAME" in .github/workflows/release.yml inside the Get version step so the runner-provided environment variable is used and shell interpolation of untrusted tag contents is avoided.

Testing

  • Ran git diff --check which passed.
  • Executed a Python check that asserts TAG="$GITHUB_REF_NAME" is present and TAG="${{ github.ref_name }}" is not in .github/workflows/release.yml, which succeeded.

Codex Task

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.

1 participant