Skip to content

workflows: harden GitHub Actions YAML against injection - #4361

Merged
rickeylev merged 1 commit into
bazel-contrib:mainfrom
rickeylev:audit_gha_injection_vulnerabilities
Oct 27, 2026
Merged

rickeylev merged 1 commit into
bazel-contrib:mainfrom
rickeylev:audit_gha_injection_vulnerabilities

Conversation

@rickeylev

Copy link
Copy Markdown
Collaborator

Interpolating GitHub Actions expressions directly into shell run:
blocks, actions/github-script scripts, and .bazelrc configs risks
command, script, or flag injection when inputs or refs contain shell
metacharacters, newlines, or leading hyphens.

Pass workflow inputs and context values through step-scoped env:
variables, sanitize branch names written to .bazelrc, use
printf '%s\n' instead of echo, and guard CLI arguments with
--flag=value or -- separators. Also require parse_comment to
succeed before posting failure reactions on issue comments.

Interpolating GitHub Actions expressions directly into shell `run:`
blocks, `actions/github-script` scripts, and `.bazelrc` configs risks
command, script, or flag injection when inputs or refs contain shell
metacharacters, newlines, or leading hyphens.

Pass workflow inputs and context values through step-scoped `env:`
variables, sanitize branch names written to `.bazelrc`, use
`printf '%s\n'` instead of `echo`, and guard CLI arguments with
`--flag=value` or `--` separators. Also require `parse_comment` to
succeed before posting failure reactions on issue comments.
@rickeylev
rickeylev requested a review from aignas as a code owner October 27, 2026 03:49
@rickeylev

Copy link
Copy Markdown
Collaborator Author

AI Disclosure: This PR was prepared with the assistance of an AI coding agent operating in a semi-autonomous mode under human direction and review. Review comments on this PR will be reviewed by the human author, who may use an AI assistant to draft responses or fixes before approval.

This is an automatically generated agent comment.

@rickeylev
rickeylev merged commit 7f2238d into bazel-contrib:main Oct 27, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant