Skip to content

fix: Prevent shell injection vulnerabilities in GitHub Actions workflows#811

Merged
BYK merged 3 commits intomasterfrom
fix/shell-injection-vulnerabilities
May 5, 2026
Merged

fix: Prevent shell injection vulnerabilities in GitHub Actions workflows#811
BYK merged 3 commits intomasterfrom
fix/shell-injection-vulnerabilities

Conversation

@fix-it-felix-sentry
Copy link
Copy Markdown
Contributor

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:

  1. action.yml:74 - inputs.force and inputs.blocker_label used directly in run script
  2. action.yml:104 - inputs.craft_version and github.action_ref used directly in run script
  3. action.yml:157 - inputs.craft_config_from_merge_target, inputs.merge_target, and inputs.version used directly in run script
  4. .github/workflows/changelog-preview.yml:103 - inputs.craft-version used directly in run script
  5. .github/workflows/changelog-preview.yml:149 - github.event.pull_request.number used directly in run script

Changes

All vulnerable expressions have been:

  • Moved to the env: block as environment variables
  • Referenced in shell scripts using proper double-quoting (e.g., "$ENVVAR")
  • This prevents arbitrary code injection through untrusted user input

Related Issues

References

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>
Copy link
Copy Markdown
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.

Fix All in Cursor

❌ 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.

Comment thread action.yml Outdated
Comment thread action.yml Outdated
@BYK BYK merged commit cc72e8f into master May 5, 2026
18 checks passed
@BYK BYK deleted the fix/shell-injection-vulnerabilities branch May 5, 2026 14:08
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