The Fork That Remembered: Reading a Deleted Commit Through Its Fork Network
The challenge
Halyard erased a commit that leaked a key. Find the deleted commit through an old fork. Recover the key they decided not to rotate.
What you'll learn
- Explain why force-pushing or deleting a repo does not delete a GitHub commit
- Spot a force push in GH Archive push events
- Open a commit through any fork of its network by short SHA
- Tell a revoked old secret from a live one using history and context
Skills tested
Prerequisites
- What a git commit and its SHA are
- What a fork is on GitHub
How it works
On GitHub, a repository and all of its forks form a fork network that shares one object store. A commit pushed anywhere in the network can be opened through any member's URL, github.com/<any-fork>/<repo>/commit/<sha>, even if that fork never had it. GitHub only adds a banner: This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Truffle Security called this Cross Fork Object Reference (CFOR) in July 2024. Commits from a deleted fork, from a deleted upstream (as long as one fork survives), and even from a private fork can stay reachable. GitHub answered that this works as designed. Force-pushing does not help either: the old commit becomes dangling, not deleted.
The only thing an attacker needs is the SHA, and that is easy. GitHub accepts short SHAs down to 4 hex characters, only 65,536 guesses, and GH Archive records every public push with its before and head SHAs. In 2025, a researcher working with Truffle Security scanned the commits that force pushes had dropped and collected about $25,000 in bug bounties.
Common mistakes
- Answering the 2025 key from b18f0d4. It also starts with
pw_live_, but the fork's history shows commit 7a52c1e, old key revoked. That commit is also on the fork's own branch (no banner), not the one the force push hid. - Stopping at the 404. The new repository is a different repository (GH Archive shows a new
repo_id), so its URL knows nothing of the old network. The fork still does. - Picking the wrong push. The 16:49 row starts from
0000000: that is the first push of the recreated repository, which creates its main. The force push is the row whose head goes back to a commit main already had. - Answering the account ID.
PARCELWISE_ACCOUNT_IDidentifies the customer, it is not the secret.
How to defend against it
- Treat any secret that reached a public repository as leaked: revoke and replace it at the provider first. Rewriting history never un-leaks it.
- Turn on GitHub secret scanning with push protection, add custom patterns for vendor or in-house key formats, and run a scanner such as gitleaks or TruffleHog as a pre-commit hook.
- Keep
.env*in.gitignoreand review any change to it: narrowing that one line is how this key got committed. - Load production secrets from a secret manager at runtime instead of files in the repo.
- To clean up after rotating, follow GitHub's guide to removing sensitive data and ask GitHub Support to purge cached views; know that forks keep their own copies.