Prevent script injection in GitHub Actions workflows#939
Merged
ShubhamChaturvedi7 merged 1 commit intoJul 16, 2026
Conversation
Bind untrusted GitHub context values to intermediate environment variables instead of interpolating them directly into inline run scripts. User-controlled inputs (workflow_dispatch inputs and pull_request event fields) spliced into shell scripts allow command injection on the runner. - go-release.yml: move github.event.inputs.project-name/version into env vars in the release-dir, run-release, and print-diff steps; quote all shell references - smithy-diff.yml: move github.event.pull_request.user.login, github.actor, and github.repository into env vars in the comment step Addresses AWS AppSec ACAT finding (Script Injection in GitHub Actions workflows). sim: https://t.corp.amazon.com/V2263272257
kessplas
approved these changes
Jul 15, 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
Fixes a script injection in GitHub Actions workflows finding. Untrusted, user-controlled GitHub context values were interpolated directly into inline
run:shell scripts, allowing command injection on the runner. Each such value is now bound to an intermediateenv:variable and referenced as a properly quoted shell variable (data, not script text) — the mitigation recommended by GitHub's hardening guide.Changes
.github/workflows/go-release.yml— movegithub.event.inputs.project-name/versionintoenv:in theGet release directory name,Run Go release automation script, andprint diffsteps; quote all shell references..github/workflows/smithy-diff.yml— movegithub.event.pull_request.user.login,github.actor, andgithub.repositoryintoenv:in the comment step.Testing
github.event.*/github.actorinterpolation remains inside anyrun:block (all remaining references are withinenv:blocks).sim: https://t.corp.amazon.com/V2263272257