Skip to content

Fix shell injection vulnerability in release workflow (ENG-6554)#229

Open
fix-it-felix-sentry[bot] wants to merge 1 commit intomainfrom
fix/eng-6554-shell-injection-vulnerability
Open

Fix shell injection vulnerability in release workflow (ENG-6554)#229
fix-it-felix-sentry[bot] wants to merge 1 commit intomainfrom
fix/eng-6554-shell-injection-vulnerability

Conversation

@fix-it-felix-sentry
Copy link

Summary

This PR fixes a high-severity shell injection vulnerability in the GitHub Actions release workflow.

Problem

The workflow was using direct interpolation of GitHub context data (${{ github.event_name }} and ${{ github.event.inputs.version }}) in shell scripts, which could allow an attacker to inject malicious code through user-controlled input.

Solution

  • Added an env: section to set environment variables GH_EVENT_NAME and GH_INPUT_VERSION
  • Updated the shell script to reference these environment variables with proper quoting
  • This prevents untrusted user data from being executed as code

Testing

The workflow file syntax is valid and follows GitHub Actions best practices for security hardening.

References

Resolves command injection vulnerability by using environment variables
instead of direct GitHub context interpolation in shell scripts.

This prevents potential malicious code injection through user-controlled
input in github.event_name and github.event.inputs.version.

Changes:
- Added env section with GH_EVENT_NAME and GH_INPUT_VERSION
- Updated shell script to reference environment variables
- Added proper quoting around variables

Fixes: https://linear.app/getsentry/issue/ENG-6554
Parent: https://linear.app/getsentry/issue/VULN-1163

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@linear
Copy link

linear bot commented Feb 18, 2026

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 18, 2026

Open in StackBlitz

npm i https://pkg.pr.new/getsentry/XcodeBuildMCP/xcodebuildmcp@229

commit: d067806

Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
VERSION="${{ github.event.inputs.version }}"
if [ "$GH_EVENT_NAME" = "workflow_dispatch" ]; then
VERSION="$GH_INPUT_VERSION"
Copy link
Contributor

Choose a reason for hiding this comment

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

Shell injection persists through step output propagation

High Severity

The fix safely moves github.event.inputs.version into an env var for the "Get version" step, but the user-controlled value is immediately written to $GITHUB_OUTPUT and then used via ${{ steps.get_version.outputs.VERSION }} and ${{ needs.release.outputs.version }} with direct interpolation in run: blocks of downstream steps that lack if: push guards — including "Resolve npm tag" (line 83), "Summary" (lines 139–140), and the build_and_package_macos/build_universal_and_verify jobs. This re-introduces the same shell injection the PR aims to fix, since ${{ }} expressions are substituted into shell scripts before execution.

Additional Locations (1)

Fix in Cursor Fix in Web

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.

0 participants

Comments