fix: Prevent script injection vulnerability in get-compose-action#4179
Merged
fix: Prevent script injection vulnerability in get-compose-action#4179
Conversation
Use environment variable to pass inputs.version instead of direct interpolation in run script to prevent potential script injection. Refs: DI-967, VULN-761
Changelog Preview📋 Changelog PreviewThis is how your changes will appear in the changelog. Bug Fixes 🐛
🤖 This preview updates automatically when you update the PR. |
aminvakil
approved these changes
Feb 19, 2026
Collaborator
@aminvakil I wanna see what the bot is capable of. I just found out about it today. |
Collaborator
|
Yes, this PR should've been merged anyway regardless of whether #4184 gets merged or not. |
1 task
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 script injection vulnerability in the get-compose-action by using an environment variable to pass
inputs.versioninstead of direct interpolation in the run script.Changes
env:block to storeinputs.versioninCOMPOSE_VERSIONenvironment variable"$COMPOSE_VERSION"instead of${{ inputs.version }}Security Impact
The original code used direct variable interpolation which could potentially allow an attacker to inject malicious code. By using an intermediate environment variable with proper quoting, the value is treated as data and cannot be executed as code.
References