Repository navigation
Conversation
|
/gemini review |
There was a problem hiding this comment.
📋 Review Summary
This PR hardens .github/actions/test-arguments-action/action.yml against template injection by moving ${{ inputs.* }}, ${{ steps.* }}, and ${{ github.job }} interpolations into step env variables and validating JOB_ID. However, moving inputs.arguments from inline double-quoted shell interpolation to an environment variable stops bash from evaluating command substitutions like $(date '+%m%d%H%M%S' --utc) that several existing performance and load test workflows still pass via with: arguments:.
🔍 General Feedback
- Passing action inputs via
env:and validatingJOB_IDbefore writing to$GITHUB_ENVare solid security improvements. - Caller workflows that still embed
$(date '+%m%d%H%M%S' --utc)insideinputs.arguments(and subsequently pass the generated<job>_test_arguments_<index>env var inside single quotes togradle-command-self-hosted-action) will now receive literal unexpanded$(date ...)tokens split across whitespace unless those workflows are updated.
💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.
There was a problem hiding this comment.
📋 Review Summary
This PR hardens .github/actions/test-arguments-action/action.yml against template injection and $GITHUB_ENV injection by routing composite action inputs, step outputs, and github.job through step-level env: blocks.
🔍 General Feedback
- Passing
inputs.argumentsviaINPUT_ARGUMENTSinstead of direct${{ inputs.arguments }}interpolation insiderun:prevents bash command substitution (such as$(date '+%m%d%H%M%S' --utc)) from being evaluated, which will break callers that still pass$(date ...)inwith: arguments:. - Overall, the environment variable bindings,
JOB_IDvalidation, and newline sanitization cleanly address thezizmorfindings.
💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.
There was a problem hiding this comment.
📋 Review Summary
This PR effectively resolves the zizmor template-injection and GITHUB_ENV security findings in .github/actions/test-arguments-action/action.yml by passing composite action inputs, step outputs, and github.job via environment variables rather than inline shell interpolation. It also preserves full backward compatibility for existing caller workflows that rely on literal $(date '+%m%d%H%M%S' --utc) timestamps and backslash-escaped quotes (\" and \\\") in inputs.arguments.
🔍 General Feedback
- All 62 caller workflows across Java, Python, and Go load/performance suites are properly accounted for, including the distinction between
inputs.argumentsunescaping andCONFIGfile preservation. - Validating
JOB_IDand stripping CR/LF characters before writing to$GITHUB_ENVcleanly mitigates environment variable injection risks.
💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.
|
Assigning reviewers: R: @Abacn added as fallback since no labels match configuration Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
Note: this PR was auto-generated by tooling. Before moving it out of draft, the author has done a full review of the PR, specifically evaluating it on the following criteria:
CodeQL/zizmor) onmasterwithout altering intended public API or workflow semanticsworkflow_dispatchruns (for workflow/action changes) have been verifiedInitiative Progress (as of
2026-11-24 20:27 UTC):8PRs merged so far, with~40more PRs needed to be merged to close out all actionable Code Scanning findings (with#41637disablingNote-levelzizmor/self-repositorywarnings).Code Scanning Remediation Context (End Goal, Scope & Impact)
apache/beam's actionableHighandMediumCode Scanning backlog (CodeQL+zizmor) down to zero.Note-levelzizmor/self-repositorywarnings (~89% of all open alerts) are handled via.github/zizmor.ymlconfig (Disable zizmor self-repository rule in .github/zizmor.yml #41637) rather than churning ~300 workflow files.ZipSlip) fixes in JavaZipFiles.unzipFile(Enforce canonical path prefix check in ZipFiles.unzipFile #41497) and Go xlangexpansionx(Enforce IsLocal and prefix check in expansionx validatePath #41589)High) fixes in shared CI composite actions (Pass inputs via env in build-push-docker-action #41515, Pass inputs and outputs via env in test-arguments-action #41592, Pass inputs and outputs via env in setup-k8s-access #41605) andpr-bot(Pass git argument arrays to @actions/exec in pr-bot updateReviewers #41524)GITHUB_TOKENscoping across CI and release workflows (Harden permissions and setup-node caching in typescript_tests.yml #41499, Scope write permissions to job in update_python_dependencies.yml #41516, Scope write permissions to jobs in cut_release_branch.yml #41522, Add read-only permissions and self-repo actions in python_tests.yml #41526, Add read-only permissions and self-repo actions in java_tests.yml #41626, Add read-only permissions and self-repo actions in local_env_tests.yml #41631) and dead-code removal (Remove unused dind-up-action composite action #41585)If you have concerns with the PR or with the underlying methodology used to generate this, please comment below - they will be addressed by the author not the tooling :)
Summary
Resolves all 12 open
zizmorCode Scanning findings (High / error, alerts#175–#186:zizmor/template-injectionandzizmor/github-env) in.github/actions/test-arguments-action/action.yml:inputs.*,steps.*.outputs.*, andgithub.jobvalues through step-levelenv:blocks instead of interpolating${{ ... }}expressions directly insidebashrun:scripts.$(date '+%m%d%H%M%S' --utc)timestamps or double-quote backslash escapes (\",\\\") viainputs.argumentswithout executing arbitrary shell command substitutions.JOB_ID, strip CR/LF characters (tr '\n\r' ' '), and write<job>_test_arguments_<index>entries cleanly to$GITHUB_ENV.Verification
zizmor --persona=pedantic .github/actions/test-arguments-action/action.yml(0findings, down from16)bash -nand byte-for-byte expansion verification across$(date '+%m%d%H%M%S' --utc),\", and\\\"caller patterns./gradlew :beam-test-gha:preCommitworkflow_dispatchrun ofbeam_Java_LoadTests_Combine_Smoke.ymlagainstcodescan/gha-test-arguments-action-hardening: https://github.com/apache/beam/actions/runs/45230834434 (succeeded across all 3 Dataflow Combine jobs)