Skip to content

fix(ci): harden GitHub Actions workflows (#14789) - #15019

Closed
hf-security-analysis[bot] wants to merge 2 commits into
dependabot/github_actions/actions-ca6b5df6adfrom
security/workflow-hardening/pr-14789
Closed

hf-security-analysis[bot] wants to merge 2 commits into
dependabot/github_actions/actions-ca6b5df6adfrom
security/workflow-hardening/pr-14789

Conversation

@hf-security-analysis

@hf-security-analysis hf-security-analysis Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Automated hardening of the workflow files flagged on #14789.

Targets dependabot/github_actions/actions-ca6b5df6ad. Files changed, and what changed them:

  • .github/workflows/claude_review.yml — action pins
  • .github/workflows/issue_labeler.yml — llm injection
  • .github/workflows/pypi_publish.yaml — action pins
  • .github/workflows/trufflehog.yml — action pins

Fixed by this PR:

  • HIGH unpinned-action (pinact) — .github/workflows/claude_review.yml:39
  • HIGH llm_prompt_injection (claude) — .github/workflows/issue_labeler.yml
  • HIGH unpinned-action (pinact) — .github/workflows/pypi_publish.yaml:77
  • HIGH unpinned-action (pinact) — .github/workflows/trufflehog.yml:20

This does not fix everything. 44 further finding(s) (40 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.yml

job granted why
gate pull-requests: write Raw gh api calls with literal paths add a reaction to the triggering comment and post a comment via repos/.../issues/${PR}/comments; on a pull request these endpoints accept pull-requests: write, which the job already declares.
gpu contents: read actions/checkout of the PR head needs contents: read; the install and pytest steps use no token, and upload-artifact within the same run needs no permission.
report pull-requests: write A raw gh api -X PATCH repos/.../issues/comments/${CID} call edits the bot's PR comment, which needs pull-requests: write on a pull request.

.github/workflows/codeql.yml

codeql was left as it is — This job only calls the external reusable workflow huggingface/security-workflows/.github/workflows/codeql-reusable.yml, whose job permissions are not visible in this file; the existing grant (security-events: write, packages: read, actions: read, contents: read) is typical for CodeQL analysis and should likely be kept.

.github/workflows/pr_link_issue_reminder.yml

remind was left as it is — The 'Run reminder script' step runs utils/remind_link_issue.py, whose contents are not in this file; per the job's comments it posts reminder comments on PRs and closes them, and checks linked issues and labels. That is consistent with the existing declaration of pull-requests: write and issues: write, and checkout needs contents: read. The reviewer should verify the script against this set.

.github/workflows/stale.yml

job granted why
close_stale_issues contents: read, issues: write, pull-requests: write The 'Close stale issues' step runs utils/stale.py, whose contents are not in this file; by its name, its PyGithub dependency and the job's existing grant, it comments on, labels and closes stale issues and PRs, so issues: write and pull-requests: write are kept, and actions/checkout adds contents: read. Reviewers should confirm the script needs nothing beyond this.

Anything not listed above keeps the permissions it had. To measure a job this could not read, add GitHubSecurityLab/actions-permissions/monitor to it and run the workflow — it reports the minimum the run actually used.

Pinning changes come from pinact and are mechanical. Any other change was generated by Claude — read it before merging.

dependabot Bot and others added 2 commits October 12, 2026 17:36
Bumps the actions group with 18 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [actions/checkout](https://github.com/actions/checkout) | `6.0.2` | `7.0.1` |
| [actions/upload-artifact](https://github.com/actions/upload-artifact) | `4.6.2` | `7.0.1` |
| [actions/github-script](https://github.com/actions/github-script) | `8.0.0` | `9.0.0` |
| [actions/setup-python](https://github.com/actions/setup-python) | `5.6.0` | `7.0.0` |
| [actions/download-artifact](https://github.com/actions/download-artifact) | `4.3.0` | `8.0.1` |
| [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) | `3.12.0` | `4.4.1` |
| [docker/login-action](https://github.com/docker/login-action) | `3.7.0` | `4.6.0` |
| [docker/build-push-action](https://github.com/docker/build-push-action) | `6.19.2` | `7.4.0` |
| [huggingface/doc-builder/.github/workflows/build_main_documentation.yml](https://github.com/huggingface/doc-builder) | `9fc8a41d7729c424fdb2192f2f85ff63102ec9a3` | `c69e96c087165ba49b1788e0c3464654dd60253c` |
| [huggingface/doc-builder/.github/workflows/build_pr_documentation.yml](https://github.com/huggingface/doc-builder) | `9fc8a41d7729c424fdb2192f2f85ff63102ec9a3` | `c69e96c087165ba49b1788e0c3464654dd60253c` |
| [anthropics/claude-code-action](https://github.com/anthropics/claude-code-action) | `1.0.155` | `1.0.242` |
| [huggingface/security-workflows/.github/workflows/codeql-reusable.yml](https://github.com/huggingface/security-workflows) | `1.1.0` | `1.2.0` |
| [actions/labeler](https://github.com/actions/labeler) | `5.0.0` | `7.0.0` |
| [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) | `1.13.0` | `1.14.2` |
| [huggingface/tailscale-action](https://github.com/huggingface/tailscale-action) | `7d53c9737e53934c30290b5524d1c9b4a7c98c8a` | `9d1a67c46875a956cf2d1975473da978a970a2a9` |
| [trufflesecurity/trufflehog](https://github.com/trufflesecurity/trufflehog) | `3.94.2` | `3.98.0` |
| [crate-ci/typos](https://github.com/crate-ci/typos) | `1.42.1` | `1.50.3` |
| [huggingface/doc-builder/.github/workflows/upload_pr_documentation.yml](https://github.com/huggingface/doc-builder) | `9fc8a41d7729c424fdb2192f2f85ff63102ec9a3` | `c69e96c087165ba49b1788e0c3464654dd60253c` |



Updates `actions/checkout` from 6.0.2 to 7.0.1
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v6.0.2...3d3c42e)

Updates `actions/upload-artifact` from 4.6.2 to 7.0.1
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@v4.6.2...043fb46)

Updates `actions/github-script` from 8.0.0 to 9.0.0
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](actions/github-script@v8...3a2844b)

Updates `actions/setup-python` from 5.6.0 to 7.0.0
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v5.6.0...5fda3b9)

Updates `actions/download-artifact` from 4.3.0 to 8.0.1
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](actions/download-artifact@v4.3.0...3e5f45b)

Updates `docker/setup-buildx-action` from 3.12.0 to 4.4.1
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](docker/setup-buildx-action@8d2750c...f87e599)

Updates `docker/login-action` from 3.7.0 to 4.6.0
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](docker/login-action@c94ce9f...dbcb813)

Updates `docker/build-push-action` from 6.19.2 to 7.4.0
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](docker/build-push-action@10e90e3...c3c9e26)

Updates `huggingface/doc-builder/.github/workflows/build_main_documentation.yml` from 9fc8a41d7729c424fdb2192f2f85ff63102ec9a3 to c69e96c087165ba49b1788e0c3464654dd60253c
- [Release notes](https://github.com/huggingface/doc-builder/releases)
- [Changelog](https://github.com/huggingface/doc-builder/blob/main/RELEASE.md)
- [Commits](huggingface/doc-builder@9fc8a41...c69e96c)

Updates `huggingface/doc-builder/.github/workflows/build_pr_documentation.yml` from 9fc8a41d7729c424fdb2192f2f85ff63102ec9a3 to c69e96c087165ba49b1788e0c3464654dd60253c
- [Release notes](https://github.com/huggingface/doc-builder/releases)
- [Changelog](https://github.com/huggingface/doc-builder/blob/main/RELEASE.md)
- [Commits](huggingface/doc-builder@9fc8a41...c69e96c)

Updates `anthropics/claude-code-action` from 1.0.155 to 1.0.242
- [Release notes](https://github.com/anthropics/claude-code-action/releases)
- [Commits](anthropics/claude-code-action@80b3182...6c69018)

Updates `huggingface/security-workflows/.github/workflows/codeql-reusable.yml` from 1.1.0 to 1.2.0
- [Release notes](https://github.com/huggingface/security-workflows/releases)
- [Commits](huggingface/security-workflows@dc6ca34...e0d40aa)

Updates `actions/labeler` from 5.0.0 to 7.0.0
- [Release notes](https://github.com/actions/labeler/releases)
- [Commits](actions/labeler@8558fd7...bf12e9b)

Updates `pypa/gh-action-pypi-publish` from 1.13.0 to 1.14.2
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](pypa/gh-action-pypi-publish@ed0c539...dc37677)

Updates `huggingface/tailscale-action` from 7d53c9737e53934c30290b5524d1c9b4a7c98c8a to 9d1a67c46875a956cf2d1975473da978a970a2a9
- [Release notes](https://github.com/huggingface/tailscale-action/releases)
- [Commits](huggingface/tailscale-action@7d53c97...9d1a67c)

Updates `trufflesecurity/trufflehog` from 3.94.2 to 3.98.0
- [Release notes](https://github.com/trufflesecurity/trufflehog/releases)
- [Commits](trufflesecurity/trufflehog@6bd2d14...0186870)

Updates `crate-ci/typos` from 1.42.1 to 1.50.3
- [Release notes](https://github.com/crate-ci/typos/releases)
- [Changelog](https://github.com/crate-ci/typos/blob/main/CHANGELOG.md)
- [Commits](crate-ci/typos@6512063...00f422f)

Updates `huggingface/doc-builder/.github/workflows/upload_pr_documentation.yml` from 9fc8a41d7729c424fdb2192f2f85ff63102ec9a3 to c69e96c087165ba49b1788e0c3464654dd60253c
- [Release notes](https://github.com/huggingface/doc-builder/releases)
- [Changelog](https://github.com/huggingface/doc-builder/blob/main/RELEASE.md)
- [Commits](huggingface/doc-builder@9fc8a41...c69e96c)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/download-artifact
  dependency-version: 8.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/github-script
  dependency-version: 9.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/labeler
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/setup-python
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: anthropics/claude-code-action
  dependency-version: 1.0.220
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: crate-ci/typos
  dependency-version: 1.50.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: docker/build-push-action
  dependency-version: 7.3.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: docker/login-action
  dependency-version: 4.6.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: docker/setup-buildx-action
  dependency-version: 4.3.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: huggingface/doc-builder/.github/workflows/build_main_documentation.yml
  dependency-version: cf20b09f274383f0d91a7055c5e43f0a2ab3d1a3
  dependency-type: direct:production
  dependency-group: actions
- dependency-name: huggingface/doc-builder/.github/workflows/build_pr_documentation.yml
  dependency-version: cf20b09f274383f0d91a7055c5e43f0a2ab3d1a3
  dependency-type: direct:production
  dependency-group: actions
- dependency-name: huggingface/doc-builder/.github/workflows/upload_pr_documentation.yml
  dependency-version: cf20b09f274383f0d91a7055c5e43f0a2ab3d1a3
  dependency-type: direct:production
  dependency-group: actions
- dependency-name: huggingface/security-workflows/.github/workflows/codeql-reusable.yml
  dependency-version: 1.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: huggingface/tailscale-action
  dependency-version: 9d1a67c46875a956cf2d1975473da978a970a2a9
  dependency-type: direct:production
  dependency-group: actions
- dependency-name: pypa/gh-action-pypi-publish
  dependency-version: 1.14.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: trufflesecurity/trufflehog
  dependency-version: 3.97.4
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
@github-actions github-actions Bot added CI size/S PR with diff < 50 LOC labels Oct 12, 2026
@dependabot
dependabot Bot force-pushed the dependabot/github_actions/actions-ca6b5df6ad branch from fbce7d2 to ef564da Compare October 14, 2026 11:01
@hf-security-analysis

Copy link
Copy Markdown
Contributor Author

Replaced by one pull request per kind of fix, so each can be reviewed and merged on its own:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI size/S PR with diff < 50 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants