Pin zstd build to immutable commit SHA, not just tag - #1
Open
smn wants to merge 2 commits into
Open
Conversation
…sting the tagged release as that's mutable.
shaunsephton
previously approved these changes
Jun 1, 2026
Author
|
Have created a PR for this upstream as well silviucpp#26 |
Author
|
going to leave this PR open until upstream ships (if it does) just to make sure we have better visibility on drift between the fork & upstream. |
Adopt the maintainer's minimal structure: drop ZSTD_BRANCH and ZSTD_TAG for a single immutable ZSTD_SHA, clone with --no-tags so no mutable tag refs land on disk, and check out the pinned commit by SHA. Removes the extra tag-verification/HEAD checks the maintainer asked to drop. Pin stays on the real v1.5.7 commit f8745da6ff1ad1e7bab384bd1f9d742439278e99 (the upstream comment's 794ea1b0... is the v1.5.7 merge's first parent, i.e. v1.5.6). A plain clone fetches all branches, so the release commit is present for checkout without needing --branch.
Author
|
Upstream merged! |
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
Why
Git tags are mutable. If an attacker (or a well-intentioned maintainer) re-points `v1.5.7` at a different commit upstream, our previous `git checkout v1.5.7` would silently build that new commit. Pinning to an immutable commit SHA and verifying the tag-to-SHA mapping before building eliminates that vector.
What changed
Test plan
Notes for bumping zstd in future
```sh
Find the commit a tag resolves to:
git ls-remote https://github.com/facebook/zstd.git 'v1.5.8^{}'
```
Update both `ZSTD_TAG` and `ZSTD_SHA` in `build_deps.sh` in the same commit.