ci: pin dart-lang/ecosystem reusable workflows to commit SHA to prevent supply-chain attacks - #2687
Open
XananasX7 wants to merge 1 commit into
Conversation
…nt supply-chain attacks
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.
Summary
The
publish.yaml,health.yaml, andpost_summaries.yamlworkflows all call reusable workflows fromdart-lang/ecosystemusing the mutable branch reference@main:Because
@mainis a mutable branch pointer, any commit pushed todart-lang/ecosystem'smainbranch is immediately picked up by every caller. If thedart-lang/ecosystemrepository 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 withid-token: writepermissions — 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/ecosystemreusable workflows to the full commit SHA848b3bf3b757d2e9ae4d60030eeed5756c87783f(currentmainHEAD at time of writing), with# mainas a comment for readability.