Skip to content

fix: pass release tag_name via env instead of interpolating it into run - #81

Merged
enriqueavindi merged 4 commits into
mainfrom
fix/shell-injection-release-tag
Oct 2, 2026
Merged

enriqueavindi merged 4 commits into
mainfrom
fix/shell-injection-release-tag

Conversation

@ivanasabi

Copy link
Copy Markdown
Contributor

Summary

Security audit followed up on release.yml: the Check versions job interpolated github.event.release.tag_name directly into a run: block four times. A crafted tag name could reach shell metacharacter evaluation in that job. Exploitation requires prior release/tag creation rights, so risk is low — fixed as hardening.

       - name: 🔎 Check versions
+        env:
+          RELEASE_TAG_NAME: ${{ github.event.release.tag_name }}
         run: |
           ...
-          echo "tag_name: ${{ github.event.release.tag_name }}"
+          echo "tag_name: $RELEASE_TAG_NAME"
-          if [ "${{ github.event.release.tag_name }}" != "... " ]; then
+          if [ "$RELEASE_TAG_NAME" != "..." ]; then

Evidence

$ python3 -c "import yaml; yaml.safe_load(open('.github/workflows/release.yml'))" && echo OK
OK

No behavior change: same four comparisons, same failure messages.

Merge Danger

Door: two-way (revert the commit)

Blast Radius: CI-only

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ivanasabi
ivanasabi requested a review from a team as a code owner October 1, 2026 19:46
@ivanasabi ivanasabi added the skip-release Do not publish a release for this change. label Oct 1, 2026
enriqueavindi
enriqueavindi previously approved these changes Oct 2, 2026
The quality gate introduced by the Go profile adoption (#65) fails on the
pre-existing release.yml: SC2086 (unquoted $GITHUB_OUTPUT redirects) and
SC2129 (individual redirects instead of a grouped one). Group the GITHUB_OUTPUT
writes and quote the variable; the debug echo stays outside the group so it
keeps printing to the job log.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: ivanasabi <ivanasabi@ext.inditex.com>
@sonarqubecloud

sonarqubecloud Bot commented Oct 2, 2026

Copy link
Copy Markdown

@enriqueavindi
enriqueavindi merged commit 0be5fbf into main Oct 2, 2026
@enriqueavindi
enriqueavindi deleted the fix/shell-injection-release-tag branch October 2, 2026 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-release Do not publish a release for this change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants