Skip to content

ci: pin dart-lang/ecosystem reusable workflows to commit SHA to prevent supply-chain attacks - #2687

Open
XananasX7 wants to merge 1 commit into
dart-lang:masterfrom
XananasX7:fix/security-pin-ecosystem-workflow-to-commit-sha
Open

ci: pin dart-lang/ecosystem reusable workflows to commit SHA to prevent supply-chain attacks#2687
XananasX7 wants to merge 1 commit into
dart-lang:masterfrom
XananasX7:fix/security-pin-ecosystem-workflow-to-commit-sha

Conversation

@XananasX7

Copy link
Copy Markdown

Summary

The publish.yaml, health.yaml, and post_summaries.yaml workflows all call reusable workflows from dart-lang/ecosystem using the mutable branch reference @main:

uses: dart-lang/ecosystem/.github/workflows/publish.yaml@main

Because @main is a mutable branch pointer, any commit pushed to dart-lang/ecosystem's main branch is immediately picked up by every caller. If the dart-lang/ecosystem repository were compromised (supply-chain attack, maintainer account takeover, malicious PR merged), an attacker could inject arbitrary code that runs in the context of this repository with id-token: write permissions — enabling unauthorized package publishing to pub.dev.

Vulnerability class

Supply-chain attack via mutable reusable workflow reference (CWE-829). See GitHub Security hardening.

Fix

All three workflow files now pin dart-lang/ecosystem reusable workflows to the full commit SHA 848b3bf3b757d2e9ae4d60030eeed5756c87783f (current main HEAD at time of writing), with # main as a comment for readability.

@github-actions github-actions Bot added the type-infra A repository infrastructure change or enhancement label Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-infra A repository infrastructure change or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant