fix(ci): harden GitHub Actions workflows (#14789) - #14793
Closed
hf-security-analysis[bot] wants to merge 0 commit into
Closed
hf-security-analysis[bot] wants to merge 0 commit into
hf-security-analysis[bot] wants to merge 0 commit into
Conversation
dependabot
Bot
force-pushed
the
dependabot/github_actions/actions-ca6b5df6ad
branch
2 times, most recently
from
September 17, 2026 12:08
e801a34 to
e6be245
Compare
hf-security-analysis
Bot
force-pushed
the
security/workflow-hardening/pr-14789
branch
from
September 17, 2026 12:08
73af81c to
e801a34
Compare
hf-security-analysis
Bot
force-pushed
the
security/workflow-hardening/pr-14789
branch
from
September 17, 2026 12:14
bb2f1dc to
e6be245
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated hardening of the workflow files flagged on #14789.
Warning
This changes when the workflow runs and what it can reach. Both triggers and permissions were rewritten in
.github/workflows/claude_review.yml,.github/workflows/issue_labeler.yml,.github/workflows/pr_labeler.yml. Read the diff before merging — either one can change what the workflow is able to do.Targets
dependabot/github_actions/actions-ca6b5df6ad. Files changed:.github/workflows/benchmark.yml.github/workflows/bot_pytest.yml.github/workflows/claude_review.yml.github/workflows/issue_labeler.yml.github/workflows/mirror_community_pipeline.yml.github/workflows/notify_slack_about_release.yml.github/workflows/pr_dependency_test.yml.github/workflows/pr_labeler.yml.github/workflows/pr_modular_tests.yml.github/workflows/pr_test_fetcher.yml.github/workflows/pr_tests.yml.github/workflows/pr_tests_gpu.yml.github/workflows/pr_torch_dependency_test.yml.github/workflows/push_tests.yml.github/workflows/push_tests_fast.yml.github/workflows/push_tests_mps.yml.github/workflows/pypi_publish.yaml.github/workflows/release_tests_fast.yml.github/workflows/ssh-runner.yml.github/workflows/stale.yml.github/workflows/trufflehog.yml.github/workflows/update_metadata.ymlFixed by this PR:
broken_auth_gate(claude) — .github/workflows/bot_pytest.ymlunpinned-action(pinact) — .github/workflows/bot_pytest.yml:78unpinned-action(pinact) — .github/workflows/bot_pytest.yml:119excessive-permissions(zizmor) — .github/workflows/claude_review.yml:10excessive-permissions(zizmor) — .github/workflows/claude_review.yml:11unpinned-action(pinact) — .github/workflows/claude_review.yml:37llm_prompt_injection(claude) — .github/workflows/issue_labeler.ymlexcessive-permissions(zizmor) — .github/workflows/issue_labeler.yml:9unpinned-action(pinact) — .github/workflows/mirror_community_pipeline.yml:72unpinned-action(pinact) — .github/workflows/mirror_community_pipeline.yml:78unpinned-action(pinact) — .github/workflows/notify_slack_about_release.yml:16unpinned-action(pinact) — .github/workflows/notify_slack_about_release.yml:19unpinned-action(pinact) — .github/workflows/pr_dependency_test.yml:25unpinned-action(pinact) — .github/workflows/pr_dependency_test.yml:27dangerous-triggers(zizmor) — .github/workflows/pr_labeler.yml:3excessive-permissions(zizmor) — .github/workflows/pr_labeler.yml:9unpinned-action(pinact) — .github/workflows/pr_modular_tests.yml:47unpinned-action(pinact) — .github/workflows/pr_modular_tests.yml:49unpinned-action(pinact) — .github/workflows/pr_modular_tests.yml:67unpinned-action(pinact) — .github/workflows/pr_modular_tests.yml:69unpinned-action(pinact) — .github/workflows/pr_modular_tests.yml:95unpinned-action(pinact) — .github/workflows/pr_modular_tests.yml:125unpinned-action(pinact) — .github/workflows/pr_modular_tests.yml:154unpinned-action(pinact) — .github/workflows/pr_test_fetcher.yml:34unpinned-action(pinact) — .github/workflows/pr_test_fetcher.yml:48unpinned-action(pinact) — .github/workflows/pr_test_fetcher.yml:89unpinned-action(pinact) — .github/workflows/pr_test_fetcher.yml:115unpinned-action(pinact) — .github/workflows/pr_test_fetcher.yml:144unpinned-action(pinact) — .github/workflows/pr_test_fetcher.yml:170unpinned-action(pinact) — .github/workflows/pr_tests.yml:42unpinned-action(pinact) — .github/workflows/pr_tests.yml:44unpinned-action(pinact) — .github/workflows/pr_tests.yml:62unpinned-action(pinact) — .github/workflows/pr_tests.yml:64unpinned-action(pinact) — .github/workflows/pr_tests.yml:122unpinned-action(pinact) — .github/workflows/pr_tests.yml:166unpinned-action(pinact) — .github/workflows/pr_tests.yml:198unpinned-action(pinact) — .github/workflows/pr_tests.yml:226unpinned-action(pinact) — .github/workflows/pr_tests.yml:252unpinned-action(pinact) — .github/workflows/pr_tests.yml:293unpinned-action(pinact) — .github/workflows/pr_tests_gpu.yml:43unpinned-action(pinact) — .github/workflows/pr_tests_gpu.yml:45unpinned-action(pinact) — .github/workflows/pr_tests_gpu.yml:63unpinned-action(pinact) — .github/workflows/pr_tests_gpu.yml:65unpinned-action(pinact) — .github/workflows/pr_tests_gpu.yml:95unpinned-action(pinact) — .github/workflows/pr_tests_gpu.yml:113unpinned-action(pinact) — .github/workflows/pr_tests_gpu.yml:133unpinned-action(pinact) — .github/workflows/pr_tests_gpu.yml:182unpinned-action(pinact) — .github/workflows/pr_tests_gpu.yml:205unpinned-action(pinact) — .github/workflows/pr_tests_gpu.yml:251unpinned-action(pinact) — .github/workflows/pr_tests_gpu.yml:267unpinned-action(pinact) — .github/workflows/pr_tests_gpu.yml:299unpinned-action(pinact) — .github/workflows/pr_torch_dependency_test.yml:25unpinned-action(pinact) — .github/workflows/pr_torch_dependency_test.yml:27unpinned-action(pinact) — .github/workflows/push_tests.yml:40unpinned-action(pinact) — .github/workflows/push_tests.yml:58unpinned-action(pinact) — .github/workflows/push_tests.yml:78unpinned-action(pinact) — .github/workflows/push_tests.yml:109unpinned-action(pinact) — .github/workflows/push_tests.yml:131unpinned-action(pinact) — .github/workflows/push_tests.yml:166unpinned-action(pinact) — .github/workflows/push_tests.yml:183unpinned-action(pinact) — .github/workflows/push_tests.yml:209unpinned-action(pinact) — .github/workflows/push_tests.yml:226unpinned-action(pinact) — .github/workflows/push_tests.yml:251unpinned-action(pinact) — .github/workflows/push_tests.yml:267unpinned-action(pinact) — .github/workflows/push_tests.yml:298unpinned-action(pinact) — .github/workflows/push_tests_fast.yml:63unpinned-action(pinact) — .github/workflows/push_tests_fast.yml:96unpinned-action(pinact) — .github/workflows/push_tests_mps.yml:29unpinned-action(pinact) — .github/workflows/push_tests_mps.yml:71unpinned-action(pinact) — .github/workflows/pypi_publish.yaml:75unpinned-action(pinact) — .github/workflows/release_tests_fast.yml:39unpinned-action(pinact) — .github/workflows/release_tests_fast.yml:58unpinned-action(pinact) — .github/workflows/release_tests_fast.yml:78unpinned-action(pinact) — .github/workflows/release_tests_fast.yml:109unpinned-action(pinact) — .github/workflows/release_tests_fast.yml:131unpinned-action(pinact) — .github/workflows/release_tests_fast.yml:166unpinned-action(pinact) — .github/workflows/release_tests_fast.yml:183unpinned-action(pinact) — .github/workflows/release_tests_fast.yml:223unpinned-action(pinact) — .github/workflows/release_tests_fast.yml:240unpinned-action(pinact) — .github/workflows/release_tests_fast.yml:266unpinned-action(pinact) — .github/workflows/release_tests_fast.yml:283unpinned-action(pinact) — .github/workflows/release_tests_fast.yml:309unpinned-action(pinact) — .github/workflows/release_tests_fast.yml:326unpinned-action(pinact) — .github/workflows/release_tests_fast.yml:359unpinned-action(pinact) — .github/workflows/ssh-runner.yml:41unpinned-action(pinact) — .github/workflows/stale.yml:18unpinned-action(pinact) — .github/workflows/stale.yml:21unpinned-action(pinact) — .github/workflows/trufflehog.yml:18unpinned-action(pinact) — .github/workflows/update_metadata.yml:21This does not fix everything. 43 further finding(s) (39 high, 4 medium) need a decision this bot should not make for you. They are in the security channel with their locations — deliberately not repeated here, since this repository may be public and they are not fixed yet.
Permissions
.github/workflows/bot_pytest.ymlgateissues: write,pull-requests: writerepos/$REPO/issues/comments/$ID/reactionsandrepos/$REPO/issues/$PR/commentsendpoints, which is comment-write on a PR conversation (pull-requests: write);issues: writeis included because the calls go through the /issues/ comment endpoints and would be needed if the command is ever invoked on a plain issue — reviewers can drop it if usage is PR-only.gpucontents: readactions/checkoutofrefs/pull/<n>/headneeds the token (contents: read); the pytest/dependency steps use no API andactions/upload-artifactwithin the same run needs no scope.reportissues: write,pull-requests: writerepos/$REPO/issues/comments/$CID, i.e. editing a comment on the PR thread (pull-requests: write);issues: writeis added only because the call uses the /issues/ comment endpoint and can be removed if the bot is PR-only..github/workflows/claude_review.ymlclaude-reviewcontents: write,issues: read,pull-requests: writegit push origin), runsgh pr createandgh pr comment, which drives contents: write plus pull-requests: write; checkout andgh pr viewneed only read, and issues: read covers reading the triggering issue comment — the step I was least sure about isanthropics/claude-code-action, which in some configurations also wants issues: write (to post/update its tracking comment) and id-token: write, so check that one if the run fails..github/workflows/codeql.yml.github/workflows/issue_labeler.ymllabelcontents: read,issues: writeactions/checkoutneedscontents: read, and the "Apply labels" step runsgh issue edit --add-labelwith GITHUB_TOKEN, requiringissues: write; the "Get labels from LLM" step runs utils/label_issues.py which is not in this file, but it is only given HF_TOKEN and issue title/body — no GITHUB_TOKEN — so it cannot use the repo token..github/workflows/pr_labeler.ymllabelcontents: read,pull-requests: writemissing-testscontents: read,issues: read,pull-requests: writegh pr edit --add-label/--remove-labelneeds pull-requests: write; the GET on repos//issues//labels is read-only, and note that utils/check_test_missing.py is not in this file (it only consumes piped JSON here, but a reviewer should confirm it makes no other API calls with GH_TOKEN).fixes-issueissues: read,pull-requests: writegh pr edit --add-label/--remove-labeldrives pull-requests: write; the GraphQL query only reads PR/closing-issue metadata and the rawgh api repos/*/issues/*/labelscall is a GET, hence issues: read.size-labelissues: read,pull-requests: writegh pr edit --add-label/--remove-labelfor the size/* labels requires pull-requests: write; thegh api repos/*/pulls/*andrepos/*/issues/*/labelscalls are read-only..github/workflows/pr_link_issue_reminder.yml.github/workflows/stale.ymlclose_stale_issuescontents: read,issues: write,pull-requests: writeAnything not listed above keeps the permissions it had. To measure a job this could not read, add
GitHubSecurityLab/actions-permissions/monitorto it and run the workflow — it reports the minimum the run actually used.Pinning changes come from
pinactand are mechanical. Any other change was generated by Claude — read it before merging.