Skip to content

fix(security): prevent untrusted users from triggering TRL CI dispatch#45302

Merged
qgallouedec merged 1 commit intomainfrom
fix/trl-ci-bot-trust-check
Apr 7, 2026
Merged

fix(security): prevent untrusted users from triggering TRL CI dispatch#45302
qgallouedec merged 1 commit intomainfrom
fix/trl-ci-bot-trust-check

Conversation

@jagwar
Copy link
Copy Markdown
Contributor

@jagwar jagwar commented Apr 7, 2026

Security Fix

Fixes a trust check bypass in trl-ci-bot.yml that allowed any GitHub user to trigger TRL CI on self-hosted GPU runners by commenting /trl-ci on any PR.

The bug

The "Ignore untrusted commenter" step used exit 0, which only exits the shell step with success. GitHub Actions interprets this as "step passed" and continues to the next steps — dispatching the TRL workflow, which runs attacker-controlled code on self-hosted runners with access to secrets.

The fix

  1. Changed exit 0 to exit 1 — now fails the step and halts the job
  2. Added if: steps.trust.outputs.trusted == 'true' on every subsequent step as defense in depth

Impact

  • The workflow has been disabled as an immediate mitigation
  • HF_TOKEN exposed in the incident has been revoked
  • All affected secrets are being rotated

Reported via HackerOne. Please merge promptly and re-enable the workflow after merge.

The trust check used `exit 0` which only exits the shell step with
success — the workflow continued to dispatch TRL CI for untrusted
commenters. This allowed any GitHub user to execute arbitrary code on
self-hosted GPU runners by commenting `/trl-ci` on any PR.

Fix: change `exit 0` to `exit 1` (fail the step) AND add explicit
`if: steps.trust.outputs.trusted == 'true'` guards on every subsequent
step as defense in depth.

Reported via HackerOne #3656858.
@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

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.

@qgallouedec
Copy link
Copy Markdown
Member

My bad, thanks for the fix

@qgallouedec qgallouedec added this pull request to the merge queue Apr 7, 2026
Merged via the queue into main with commit 3606a1f Apr 7, 2026
18 checks passed
@qgallouedec qgallouedec deleted the fix/trl-ci-bot-trust-check branch April 7, 2026 21:59
bigshanedogg pushed a commit to bigshanedogg/transformers that referenced this pull request Apr 9, 2026
huggingface#45302)

The trust check used `exit 0` which only exits the shell step with
success — the workflow continued to dispatch TRL CI for untrusted
commenters. This allowed any GitHub user to execute arbitrary code on
self-hosted GPU runners by commenting `/trl-ci` on any PR.

Fix: change `exit 0` to `exit 1` (fail the step) AND add explicit
`if: steps.trust.outputs.trusted == 'true'` guards on every subsequent
step as defense in depth.

Reported via HackerOne #3656858.
sirzechs66 pushed a commit to sirzechs66/transformers that referenced this pull request Apr 18, 2026
huggingface#45302)

The trust check used `exit 0` which only exits the shell step with
success — the workflow continued to dispatch TRL CI for untrusted
commenters. This allowed any GitHub user to execute arbitrary code on
self-hosted GPU runners by commenting `/trl-ci` on any PR.

Fix: change `exit 0` to `exit 1` (fail the step) AND add explicit
`if: steps.trust.outputs.trusted == 'true'` guards on every subsequent
step as defense in depth.

Reported via HackerOne #3656858.
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.

3 participants