transformers - 💡(How to fix) Fix MEDIUM: All CI jobs use secrets:inherit — full org secrets passed to every reusable workflow

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Every CI job in the daily scheduled workflow inherits the full organization secrets:

model-ci:
  uses: ./.github/workflows/self-scheduled.yml
  with:
    job: run_models_gpu
  secrets: inherit  # All org secrets passed to every job

With secrets: inherit, all available GitHub Actions secrets are passed to the reusable workflow — including HF Hub API tokens, PyPI publish tokens, Docker Hub credentials, and Slack webhook URLs. A compromised reusable workflow or a supply chain attack on a Docker image used in CI (huggingface/transformers-all-latest-gpu) would have access to every secret.

Combined with the repository_dispatch trigger, external events can trigger CI runs with org-wide secret access.

Root Cause

Every CI job in the daily scheduled workflow inherits the full organization secrets:

model-ci:
  uses: ./.github/workflows/self-scheduled.yml
  with:
    job: run_models_gpu
  secrets: inherit  # All org secrets passed to every job

With secrets: inherit, all available GitHub Actions secrets are passed to the reusable workflow — including HF Hub API tokens, PyPI publish tokens, Docker Hub credentials, and Slack webhook URLs. A compromised reusable workflow or a supply chain attack on a Docker image used in CI (huggingface/transformers-all-latest-gpu) would have access to every secret.

Combined with the repository_dispatch trigger, external events can trigger CI runs with org-wide secret access.

Fix Action

Fix / Workaround

Combined with the repository_dispatch trigger, external events can trigger CI runs with org-wide secret access.

Remediation

  1. Use secrets: inherit only for jobs that need it
  2. Explicitly pass only required secrets via the secrets: block
  3. Remove repository_dispatch trigger or limit it to trusted sources

Code Example

model-ci:
  uses: ./.github/workflows/self-scheduled.yml
  with:
    job: run_models_gpu
  secrets: inherit  # All org secrets passed to every job
RAW_BUFFERClick to expand / collapse

CWE-1357: Improper Access Control — secrets:inherit across all CI jobs

Severity: MEDIUM (CVSS 5.3)

Location

.github/workflows/self-scheduled-caller.yml — all jobs use secrets: inherit

Description

Every CI job in the daily scheduled workflow inherits the full organization secrets:

model-ci:
  uses: ./.github/workflows/self-scheduled.yml
  with:
    job: run_models_gpu
  secrets: inherit  # All org secrets passed to every job

With secrets: inherit, all available GitHub Actions secrets are passed to the reusable workflow — including HF Hub API tokens, PyPI publish tokens, Docker Hub credentials, and Slack webhook URLs. A compromised reusable workflow or a supply chain attack on a Docker image used in CI (huggingface/transformers-all-latest-gpu) would have access to every secret.

Combined with the repository_dispatch trigger, external events can trigger CI runs with org-wide secret access.

Impact

Compromise of a Docker image or reusable workflow used in CI exposes all organization secrets, including package publishing tokens and API credentials.

Remediation

  1. Use secrets: inherit only for jobs that need it
  2. Explicitly pass only required secrets via the secrets: block
  3. Remove repository_dispatch trigger or limit it to trusted sources

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

transformers - 💡(How to fix) Fix MEDIUM: All CI jobs use secrets:inherit — full org secrets passed to every reusable workflow