Skip to content

ci: verify splitsh-lite checksum before running it - #8441

Open
alexisLefebvre wants to merge 1 commit into
api-platform:4.3from
alexisLefebvre:harden-splitsh-download
Open

ci: verify splitsh-lite checksum before running it#8441
alexisLefebvre wants to merge 1 commit into
api-platform:4.3from
alexisLefebvre:harden-splitsh-download

Conversation

@alexisLefebvre

Copy link
Copy Markdown
Contributor
Q A
Branch? 4.3
Bug fix? no
New feature? no
Deprecations? no
Issues
License MIT
Doc PR

What

The Subtree Split job downloads the splitsh-lite release tarball, unpacks it and executes it. This adds a sha256sum --check between the download and tar, so a tarball whose bytes changed aborts the job instead of running. curl also gains -f: without it an HTTP error page is written to the file and curl still exits 0, leaving tar to consume the error body.

The version and the digest live in env: so they stay visibly paired, and the checksum line uses the exact two-space format sha256sum emits, so it can be regenerated and pasted verbatim.

Why

Release assets on GitHub are mutable: the URL pins a name, not a payload, and anyone with push access to splitsh/lite can replace the file behind an unchanged v1.0.1 link. That download happens in the one job that holds API_PLATFORM_APP_PRIVATE_KEY, whose App can write to all twenty-one component repositories and dispatch releases in api-platform/api-platform and api-platform/demo. Arbitrary code there reaches every published Composer package, so it is the highest-value step in the repository to leave unverified. This is the same class of hole that pinning actions to commit SHAs closes, applied to a payload no action pin covers.

splitsh/lite publishes no checksums, so the digest was computed from the asset as currently served. That is trust-on-first-use: it prevents future substitution but cannot prove the current bytes are the 2017 originals. The release API corroborates them — the asset's updated_at is two seconds after its created_at in February 2017 and has not moved since, and GitHub bumps that field when an asset is replaced, across 203k downloads.

A stronger root of trust would mean building splitsh-lite from a pinned source commit or vendoring the binary; both are larger changes than this one.

🤖 Generated with Claude Code

The release asset was fetched and executed unverified in the job that holds the
GitHub App private key. Release assets are mutable, so pinning the URL alone did
not pin the bytes.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant