Skip to content

CI: fix template injection in workflow_dispatch run: blocks#6447

Open
brtnfld wants to merge 3 commits into
HDFGroup:developfrom
brtnfld:fix/workflow-dispatch-injection
Open

CI: fix template injection in workflow_dispatch run: blocks#6447
brtnfld wants to merge 3 commits into
HDFGroup:developfrom
brtnfld:fix/workflow-dispatch-injection

Conversation

@brtnfld

@brtnfld brtnfld commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

Move workflow_dispatch inputs that appeared directly inside run: shell scripts into step-level env: 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_dispatch inputs are changed. workflow_call inputs 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.ymllocal_dir, target_dir used directly in aws s3 sync
  • java-implementation-test.ymljava_versions, platforms, test_mode
  • maven-staging.ymltest_maven_deployment, java_implementation, platforms, use_snapshot_version
  • maven-build-test.ymltest_deployment, java_implementation, platforms, test_examples
  • test-maven-packages.ymlversion, repository_url throughout JNI and FFM test jobs
  • test-binary-installation.ymlmaven_repository, maven_version, install_method

Replaces #6445, which over-scoped the fix to reusable workflow files that did not need changes.

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
Comment thread .github/workflows/maven-staging.yml Fixed
Comment thread .github/workflows/publish-branch.yml Fixed
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Review Checklist

This PR touches the following areas. Each needs at least one
sign-off from its listed owners before merging — an approval
covering only one area does not satisfy the others.

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.
@brtnfld brtnfld requested review from jhendersonHDF and removed request for lrknox June 12, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To be triaged

Development

Successfully merging this pull request may close these issues.

2 participants