Repository navigation
Closed
Labels
area:ciWorkflows, pre-commit hooks, repo-shape guards, release pipelinekind:securitySecurity impact; report a vulnerability to [email protected], not hereprio:mediumScheduled
Description
Related to #2397 (signing-time race) but distinct: this is about the token scope and action pinning of the release pipeline itself.
1. Every release job holds contents:write + packages:write, persists the token, and runs mutable third-party code
.github/workflows/release.yml:21-23grantscontents: writeandpackages: writeworkflow-wide;tag(:41),verify(:167),build-binaries(:352) andupload-assets(:574) all inherit it, while onlydocker(:639) needspackages.actions/checkoutat:51, :181, :416, :581, :674keeps the defaultpersist-credentials(contrastci.yml:774,codeql.yml:40,sdk-contract.yml:64,94, which setfalse).- Mutable refs running under that token:
anchore/sbom-action@v0(:771),obi1kenobi/cargo-semver-checks-action@v2(:299),Swatinem/rust-cache@v2(:189),docker/*@v4/v6/v7(:682-758),dtolnay/[email protected](a branch), plus unpinnedcross,git-cliff,cargo-nextestinstalls — and every dependencybuild.rsundercargo nextest/cargo publish --dry-run.security.yml:39,100usesaquasecurity/[email protected], an action whose tags have been hijacked before. Meanwhileci.yml:1083,1123already SHA-pins slither/aderyn, so this is inconsistent with the repo's own practice. - Impact: a hijacked action tag or malicious build script in a release run reads the persisted
GITHUB_TOKEN; withpackages:writeit pushesghcr.io/decdn/sponsord:latestdirectly —deploy/sponsord/compose.yaml:24,44defaults to:latest, so a backdoored image reaches the host holding the treasury keystore. Withcontents:writeit can alter release assets and push to the unprotectedmain. That contradictsSECURITY.md:122("Every tag you can pull … is created only after that digest has been signed"). - Workflow-level
permissions: contents: read; grantcontents: writeonly to the draft/upload steps,packages: writeonly todocker -
persist-credentials: falseon every checkout - Pin third-party actions by SHA; pin
cross/git-cliff/cargo-nextestversions
2. Per-archive binstall signatures are not tied to name, version, or target
scripts/sign-release.sh:556signs each archive with a bareminisign -S;crates/cli/Cargo.toml:53-56names the pubkey. cargo-binstall only prints the trusted comment — it does not enforce it — so with release-asset write access (item 1) an older signed archive can be served under a newer name: a silent rollback.decdn self-updateis unaffected (its signedSHA256SUMSbinds versioned names and it refuses downgrades).- Add a trusted comment naming
<name> <version> <target>for human checks, and document that theSHA256SUMSpath is the rollback-proof one
Metadata
Metadata
Assignees
Labels
area:ciWorkflows, pre-commit hooks, repo-shape guards, release pipelinekind:securitySecurity impact; report a vulnerability to [email protected], not hereprio:mediumScheduled
Type
Fields
Priority
None yet
Projects
- StatusShow more project fieldsDone
Activity