Skip to content

Comments

fix: prevent command injection in create-unity-matrix workflow (GDX-417)#2552

Merged
bitsandfoxes merged 1 commit intomainfrom
fix/gdx-417-command-injection-workflow
Feb 19, 2026
Merged

fix: prevent command injection in create-unity-matrix workflow (GDX-417)#2552
bitsandfoxes merged 1 commit intomainfrom
fix/gdx-417-command-injection-workflow

Conversation

@fix-it-felix-sentry
Copy link
Contributor

Summary

This PR fixes a high-severity security vulnerability (command injection) in the create-unity-matrix.yml GitHub Actions workflow.

Problem

The workflow was using direct variable interpolation ${{...}} with github context data in a run: step, which could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code.

Solution

Moved all workflow expressions to environment variables using the env: section and updated the run script to reference these environment variables with proper double-quoting:

  • ${{ inputs.event-name }}$EVENT_NAME
  • ${{ env.PR_UNITY_VERSIONS }}$PR_UNITY_VERSIONS_VALUE
  • ${{ env.FULL_UNITY_VERSIONS }}$FULL_UNITY_VERSIONS_VALUE

This prevents untrusted input interpolation inside the run: script and avoids command injection risks, since the shell will only interpolate the environment variable (not the workflow expression) at runtime.

References

Testing

  • ✅ YAML syntax validation passed
  • ✅ No functional changes to the workflow logic
  • ✅ The workflow will continue to produce the same output

Move workflow expressions from run script to environment variables to prevent
potential command injection attacks. GitHub context data can contain arbitrary
user input and should not be directly interpolated in shell scripts.

Changes:
- Move inputs.event-name to EVENT_NAME environment variable
- Move env.PR_UNITY_VERSIONS to PR_UNITY_VERSIONS_VALUE environment variable
- Move env.FULL_UNITY_VERSIONS to FULL_UNITY_VERSIONS_VALUE environment variable
- Update run script to reference environment variables with proper quoting

Fixes GDX-417
Fixes VULN-1097

Co-Authored-By: fix-it-felix-sentry[bot] <260785270+fix-it-felix-sentry[bot]@users.noreply.github.com>
@linear
Copy link

linear bot commented Feb 18, 2026

@github-actions
Copy link
Contributor

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


Bug Fixes 🐛

  • Prevent command injection in create-unity-matrix workflow (GDX-417) by fix-it-felix-sentry[bot] in #2552

Internal Changes 🔧

  • (deps) Update Native SDK to v0.12.8 by github-actions in #2550

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Contributor

Fails
🚫 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

### Fixes

- prevent command injection in create-unity-matrix workflow (GDX-417) ([#2552](https://github.com/getsentry/sentry-unity/pull/2552))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against 4615cf6

@bitsandfoxes bitsandfoxes merged commit d1a1428 into main Feb 19, 2026
77 of 78 checks passed
@bitsandfoxes bitsandfoxes deleted the fix/gdx-417-command-injection-workflow branch February 19, 2026 11:26
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