CI: fix template injection in workflow_dispatch run: blocks#6447
Open
brtnfld wants to merge 3 commits into
Open
CI: fix template injection in workflow_dispatch run: blocks#6447brtnfld wants to merge 3 commits into
brtnfld wants to merge 3 commits into
Conversation
Move workflow_dispatch inputs that appeared directly in run: scripts into step-level env: blocks, then reference them as plain shell variables. This is the pattern zizmor recommends and eliminates the injection vector. Only workflow_dispatch inputs are fixed here — workflow_call inputs in reusable files are not attacker-controlled (they come from the calling workflow) so no changes are needed there. Files changed: - publish-branch.yml: local_dir, target_dir in aws s3 sync - java-implementation-test.yml: java_versions, platforms, test_mode - maven-staging.yml: test_maven_deployment, java_implementation, platforms, use_snapshot_version - maven-build-test.yml: test_deployment, java_implementation, platforms, test_examples - test-maven-packages.yml: version, repository_url throughout - test-binary-installation.yml: maven_repository, maven_version, install_method
Contributor
Review ChecklistThis PR touches the following areas. Each needs at least one
|
Pure reusable workflows (workflow_call only, no workflow_dispatch/pull_request/ push/schedule/release triggers) can never be triggered directly by external users. Template-injection findings against inputs.* in those files are false positives — inputs arrive from the trusted calling workflow, not from attackers. Scanning only files with user-facing triggers keeps Security tab alerts meaningful and prevents developers from dismissing real findings.
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
Move
workflow_dispatchinputs that appeared directly insiderun:shell scripts into step-levelenv:blocks, then reference them as plain shell variables ($VAR). This is the pattern zizmor recommends: the GHA expression is evaluated safely before the shell starts, eliminating the injection vector.Scope: only
workflow_dispatchinputs are changed.workflow_callinputs in reusable files are not attacker-controlled (they come from the calling workflow, not from external user input), so no changes are needed there.Files changed:
publish-branch.yml—local_dir,target_dirused directly inaws s3 syncjava-implementation-test.yml—java_versions,platforms,test_modemaven-staging.yml—test_maven_deployment,java_implementation,platforms,use_snapshot_versionmaven-build-test.yml—test_deployment,java_implementation,platforms,test_examplestest-maven-packages.yml—version,repository_urlthroughout JNI and FFM test jobstest-binary-installation.yml—maven_repository,maven_version,install_methodReplaces #6445, which over-scoped the fix to reusable workflow files that did not need changes.