fix: prevent command injection in create-unity-matrix workflow (GDX-417)#2552
Merged
bitsandfoxes merged 1 commit intomainfrom Feb 19, 2026
Merged
Conversation
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>
Contributor
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. Bug Fixes 🐛
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
Contributor
Instructions and example for changelogPlease add an entry to 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 |
bitsandfoxes
approved these changes
Feb 19, 2026
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 a high-severity security vulnerability (command injection) in the
create-unity-matrix.ymlGitHub Actions workflow.Problem
The workflow was using direct variable interpolation
${{...}}withgithubcontext data in arun: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_VALUEThis 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