Skip to content

fix: resolve template-injection issues and harden workflows#691

Merged
rapids-bot[bot] merged 9 commits intorapidsai:mainfrom
gforsyth:securitize
Apr 27, 2026
Merged

fix: resolve template-injection issues and harden workflows#691
rapids-bot[bot] merged 9 commits intorapidsai:mainfrom
gforsyth:securitize

Conversation

@gforsyth
Copy link
Copy Markdown
Contributor

  • fix(ci): pin all third-party actions
  • fix: replace all template injection sites with env vars
  • fix: suppress GITHUB_ENV warning (non-dangerous)
  • fix: ignore dangerous-trigger warning
  • fix: grant permissions explicitly per-job
  • fix: suppress secrets-inherit warnings
  • fix: disable persist-credentials to prevent credential leakage
  • fix: remediate or ignore all template-injection warnings

@gforsyth gforsyth added improvement Improves an existing functionality non-breaking Introduces a non-breaking change labels Apr 24, 2026
Comment on lines +26 to 32
switch(context.eventName) {
case 'pull_request':
case 'pull_request_target':
return '${{ github.ref }}'.split('/')[2];
return context.ref.split('/')[2];
case 'push':
const branch = '${{ github.ref_name }}';
const branch = context.ref.replace(/^refs\/(heads|tags)\//, '');
if (!branch.match(new RegExp('^pull-request/[0-9]+$'))) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe these are equivalent. They also aren't realistic injection targets, I don't think. I can mark them as # zizmor: ignore[template-injection] instead if folks prefer

Comment on lines +23 to +25
run: | # zizmor: ignore[github-env]
echo "HOME=$RUNNER_WORKSPACE" >> "$GITHUB_ENV";
echo "TMPDIR=$RUNNER_TEMP" >> "$GITHUB_ENV";
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zizmor is scared of all mutation of GITHUB_ENV -- this is a pretty benign mutation

@gforsyth
Copy link
Copy Markdown
Contributor Author

/ok to test

@gforsyth gforsyth marked this pull request as ready for review April 24, 2026 19:22
@gforsyth gforsyth requested a review from a team as a code owner April 24, 2026 19:22
@gforsyth gforsyth requested review from AyodeAwe and trxcllnt and removed request for a team April 24, 2026 19:22
Comment thread .pre-commit-config.yaml
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a CI job that enforces this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, added in 2cd929c

@gforsyth
Copy link
Copy Markdown
Contributor Author

/merge

@rapids-bot rapids-bot Bot merged commit 094fdcf into rapidsai:main Apr 27, 2026
681 of 682 checks passed
@gforsyth gforsyth deleted the securitize branch April 27, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improves an existing functionality non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants