fix: Prevent shell injection vulnerabilities in GitHub Actions workflows#811
Merged
fix: Prevent shell injection vulnerabilities in GitHub Actions workflows#811
Conversation
Move GitHub context variables from inline script interpolation to environment variables to prevent potential shell injection attacks. Fixes the following security findings: - action.yml:74 - inputs.force and inputs.blocker_label - action.yml:104 - inputs.craft_version and github.action_ref - action.yml:157 - inputs.craft_config_from_merge_target, inputs.merge_target, inputs.version - .github/workflows/changelog-preview.yml:103 - inputs.craft-version - .github/workflows/changelog-preview.yml:149 - github.event.pull_request.number All vulnerable expressions now use environment variables with proper quoting to prevent arbitrary code injection. References: - Linear Parent: https://linear.app/getsentry/issue/VULN-1589 - Linear Child: https://linear.app/getsentry/issue/DI-1899 - Semgrep rule: https://semgrep.dev/r/yaml.github-actions.security.run-shell-injection.run-shell-injection Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit e4649b2. Configure here.
…-vulnerabilities # Conflicts: # AGENTS.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
This PR fixes shell injection vulnerabilities in GitHub Actions workflows by moving GitHub context variables from inline script interpolation to environment variables.
Security Issues Fixed
The following locations were vulnerable to shell injection attacks:
inputs.forceandinputs.blocker_labelused directly in run scriptinputs.craft_versionandgithub.action_refused directly in run scriptinputs.craft_config_from_merge_target,inputs.merge_target, andinputs.versionused directly in run scriptinputs.craft-versionused directly in run scriptgithub.event.pull_request.numberused directly in run scriptChanges
All vulnerable expressions have been:
env:block as environment variables"$ENVVAR")Related Issues
References