Skip to content

[CI] Bump style-bot-action to hardened SHA (TOCTOU fix)#1222

Merged
paulinebm merged 1 commit intomainfrom
fix/bump-style-bot-sha
May 5, 2026
Merged

[CI] Bump style-bot-action to hardened SHA (TOCTOU fix)#1222
paulinebm merged 1 commit intomainfrom
fix/bump-style-bot-sha

Conversation

@paulinebm
Copy link
Copy Markdown
Contributor

Summary

Bumps the pinned SHA of the reusable style-bot-action workflow to include security hardening against TOCTOU attacks.

  • f28006016356b5811bf92d45d6c39f9585f2ff4cd87e6e68f8edeab7aa706e88c47f4039744707e9

What changed in the new SHA (huggingface/huggingface_hub#4183)

  • SHA pinning: checkout now uses pr.head.sha (immutable) instead of the branch ref name
  • Credential isolation: persist-credentials: falsebot_token is never accessible during pip install / make style
  • Job separation: untrusted code runs in a sandboxed job; the push happens in a separate trusted job via a git patch artifact
  • Server-side timestamp guard: verifies via GraphQL pushedDate that the head commit was pushed before the @bot /style comment — prevents a contributor from sneaking in a malicious commit just before a maintainer triggers the bot
  • Double SHA re-validation: PR head SHA is re-checked via API both before running untrusted code and before pushing

⚠️ Depends on huggingface/huggingface_hub#4183 being merged first.

@bot-ci-comment
Copy link
Copy Markdown

bot-ci-comment Bot commented May 5, 2026

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@paulinebm paulinebm merged commit 8e25dcf into main May 5, 2026
5 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