This repository was archived by the owner on Jun 1, 2026. It is now read-only.
security: CWE-77: Fix expression injection in action inputs — VC-53691#2
Open
torresashjiancyber wants to merge 1 commit into
Open
security: CWE-77: Fix expression injection in action inputs — VC-53691#2torresashjiancyber wants to merge 1 commit into
torresashjiancyber wants to merge 1 commit into
Conversation
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
Fixes CWE-77 expression injection vulnerability by routing action inputs through environment variables instead of direct string interpolation into shell scripts.
Finding
The composite action interpolated
${{ inputs.release }},${{ inputs.install-dir }}, and${{ inputs.use-sudo }}directly intorun:shell script bodies without routing them throughenv:and quoting. This allowed shell metacharacters in those inputs to be executed as code on the consumer's runner.CVSS: 9.2 (CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N)
Three injection sinks were identified:
mkdir -p ${{ inputs.install-dir }}(line 45) - executed before any validationif [[ ${{ inputs.release }} =~ $semver ]](line 111) - command substitution in validatorif [[ "${{ inputs.use-sudo }}" == "true" ]](line 106) - command substitution in comparisonRemediation
env:block to the main bash step declaringRELEASE,INSTALL_DIR, andUSE_SUDO${{ inputs.* }}references in script bodies with quoted shell variablesmkdir/pushdsinks to fail fast on invalid inputenv:blocks to both PATH-export steps (Linux/macOS and Windows)All three PoC attack vectors are now blocked - inputs are passed as environment variable values rather than interpolated into shell source code.
Verification
GitHub Action projects typically have no local build/test suite. The fix has been validated through:
${{ inputs.* }}expressions removed from shell contexts