ci: pin third-party Actions to commit SHAs (CWE-829)#116
Open
GaltRanch wants to merge 1 commit into
Open
Conversation
Signed-off-by: GaltRanch <bruno@nexocore.uy>
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
Pin third-party GitHub Actions in
.github/workflows/to immutable40-character commit SHAs, addressing CWE-829: Inclusion of Functionality
from Untrusted Control Sphere.
This is a follow-up to the sibling PR against the parent cFS bundle
(nasa/cFS#1040) covering the
same supply-chain hygiene class — the parent PR could only touch the
workflows that live in the cFS root; this PR covers the ones inside
the submodule.
Why
A third-party Action pinned to a mutable tag (
@v2) or a moving branch(
@master) executes whatever the upstream maintainer pushes to that refat workflow run time. A maintainer compromise or a tag/branch rewrite
causes the action to run attacker code with
${{ secrets.* }}in scope.The March 2025
tj-actions/changed-filessupply-chain incident(CVE-2025-30066) was
exactly this shape: 23,000+ workflows compromised because they used
@v45instead of a SHA. GitHub's hardening guidance recommends SHApinning for third-party Actions in its
security hardening reference.
Branch-pinned references (
@master) are the higher-risk subset becausethe branch HEAD moves on every push to the upstream repo.
Changes
Each
@<tag-or-branch>was resolved to its 40-character commit SHA viagh apiagainst the live GitHub refs. The human-readable ref ispreserved as a
# <ref>inline comment so future Dependabot bumps andhuman reviewers can see the intended version. NASA / GitHub first-party
actions (
actions/*,github/*,nasa/*) are out of scope and nottouched.
Test plan
tag/branch HEAD previously in use; nothing functionally changes).
Provenance
Discovered by Kulvex Code (KCode),
a deterministic SAST scanner. Pattern:
cloud-006-gha-third-party-no-sha.Same audit campaign that produced nasa/CryptoLib#511,
nasa/cFS#1040, and
nasa/trick#2132.
Per common AI-assist disclosure practice: AI tooling was used. Discovery
via KCode (deterministic regex+AST patterns + LLM verifier). Fix generation
via KCode agentic mode. Each SHA resolution was done by
gh apicalls,not invented.
— Bruno Aiub · AstroLexis · Kulvex Code · contact@astrolexis.space