Fix script injection risk by passing inputs via env vars#37
Merged
webknjaz merged 1 commit intore-actors:unstable/v1from Feb 8, 2026
Merged
Conversation
Move action input interpolation from the shell script body into the env block. This prevents potential script injection via crafted input values, since environment variables are assigned before the shell interprets the script — values can never break out of their string context. This also eliminates the heredoc complexity, improving readability.
Contributor
Author
|
The pre-commit action fails for something unrelated to my PR |
webknjaz
approved these changes
Feb 7, 2026
Contributor
Author
|
The CI is failing. Can you fix that please? |
Member
|
Alright.. I'm merging this as is but will have to do some maintenance before I can tag it as a stable release. |
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
${{ inputs.* }}interpolation from therun:script body into theenv:block, referencing values as shell variables instead.Problem
The current
action.ymlinterpolates inputs directly into the bash script body using${{ inputs.* }}inside heredocs. If an attacker controls any input value (e.g. through a dynamically constructedallowed-failuressourced from untrusted data), they could inject arbitrary shell commands by crafting a value that breaks out of the heredoc delimiter.Solution
Pass inputs through the
env:block instead:This is the recommended pattern per GitHub's security hardening docs.