News for hackers. Stuff that matters.
Re:Git 3.0's upcoming SHA-256 default will be a costly mistake by kazinator on Thursday October 01, 2026 @04:24PM (#49926637)
And so if you don't trust the server that is hosted on or the security of the transport mechanism like TLS/SSL, such that the content may be manipulated by adversaries, you think that git hashes are good enough?

Well, what about someone who is fetching the commit from that server for the first time and has nothing to compare the hash against?

Oh, that would never be a problem for widely disseminated, popular, open source project, so it doesn't matter.

Re:Git 3.0's upcoming SHA-256 default will be a costly mistake by crote on Thursday October 01, 2026 @04:59PM (#49927014)
Dealing with potentially-hostile hosts is quite common, actually. See for example how most Linux mirrors work, or Subresource Integrity with HTML.

Turns out securing a service to transfer a single hash is a lot easier than securing a service to transfer gigabytes of data.

Even if I don't fully trust Github, it is still incredibly convenient to be able to upload my code there and then send someone an email telling them to fetch commit `123abc` from some repo link. As long as my email isn't compromised, that should be secure.

Re:Git 3.0's upcoming SHA-256 default will be a costly mistake by hedora on Thursday October 01, 2026 @11:15PM (#49929505)
Similarly, if you push to github, then trigger CI through something other than github actions, then (other than the SHA-1 problem), you have reasonable assurances that someone who has compromised GH cannot compromise your CI host.

Note that the US CLOUD Act means that, if someone figures out how to actually use collisions to compromise that CI machine, then, if the US government asks Microsoft to do use that vector to break into an overseas machine, then Microsoft will be legally obligated to do it.

Re:Git 3.0's upcoming SHA-256 default will be a costly mistake by hinkley on Friday October 02, 2026 @04:42AM (#49931246)
Code signing also generally relies on hashes. You don’t encrypt the code to make a signature, you encrypt a fingerprint of the code, which is usually a hash from the SHA family.

I pushed aviation toward starting with SHA-256 instead of SHA-1 for code signing more than fifteen years ago, just after NIST first started discouraging the use of SHA-1 in new code.

Re:Git 3.0's upcoming SHA-256 default will be a costly mistake by PunchyHamster on Thursday October 01, 2026 @07:51PM (#49928352)
I mean, Git commit signing should be used more often... then you can actually trust the person signing, not the distribution method

But you still need SHA256 for that

Re:Git 3.0's upcoming SHA-256 default will be a costly mistake by kstrauser on Thursday October 01, 2026 @10:37PM (#49929329)
Rumor has it that GitHub has a flat namespace for commits. They don't store "user1/repo1/abcd1234" in one file and "user2/repo2/abcd1234" in another. Both references point to the same commit in a global shared space. If the hashes are truly unique, then that never matters, because the odds are approximately 0.000000000...000 of you and I accidentally generating the same commit. However, if I see that you pushed commit abcd134, and then I can build and push a colliding commit, and the backend doesn't check uniqueness before writes because the odds are infinitesimal that it'd ever matter, than voila, I've updated your repo by writing to my own.

Or if first writer wins, and I know that you have a popular non-GitHub repo that you're about to migrate into it, then I could pre-poison the namespace by writing my own version of a commit that I see you already have in Codeberg or Savannah or wherever.

I don't swear that this is how GitHub actually works, but I've had knowledgeable friends swear up and down that it is. And honestly, it'd make sense. They could shard storage by the first 4 digits of the hash or something, and that'd be vastly more efficient if all commits were writing to the same space.

Re:Git 3.0's upcoming SHA-256 default will be a costly mistake by hedora on Thursday October 01, 2026 @11:14PM (#49929502)
I'd expect an LLM to prove this (if true) in ~ 60 minutes, given just your post and "try to prove this true or false; here's a github PAT".
Re:Git 3.0's upcoming SHA-256 default will be a costly mistake by nulld3v on Thursday October 01, 2026 @11:48PM (#49929643)
It is already known to be true for repos that are forks or have been forked: https://trufflesecurity.com/blog/anyone-can-access-deleted-a...
Re:Git 3.0's upcoming SHA-256 default will be a costly mistake by computerfriend on Friday October 02, 2026 @12:30AM (#49929849)
That's per-repo. The claim is that user/repo/commit is flattened to just the commit. Your counterpoint (which I agree with and is well-known) is that it's flattened to repo/commit (dropping the user).
Re:Git 3.0's upcoming SHA-256 default will be a costly mistake by nulld3v on Friday October 02, 2026 @01:19AM (#49930077)
Ah right, though I think it is rather unlikely Github flattens across multiple repos given that Github has already blogged about how their repo storage backend (Spokes) works, and it seems to operate entirely on whole repositories.
Re:Git 3.0's upcoming SHA-256 default will be a costly mistake by computerfriend on Friday October 02, 2026 @02:46AM (#49930517)
Yeah, I also don't believe it.
Re:Git 3.0's upcoming SHA-256 default will be a costly mistake by jb1991 on Friday October 02, 2026 @06:24AM (#49931883)
I also don't believe it.
Re:Git 3.0's upcoming SHA-256 default will be a costly mistake by schacon on Friday October 02, 2026 @02:17AM (#49930356)
So, I haven't worked at GitHub in some time, but we never had a flat namespace for objects. There are a lot of SHAs in the DB but objects are always namespaced by repository. Forks shared an object database for efficiency, and have technically added reachable objects to a shared database via fork, but it's never been a real problem afaik.

But the very wrong assumption here is: "if I see that you pushed commit abcd134, and then I can build and push a colliding commit, and the backend doesn't check uniqueness before writes"

All parts of this are incorrect.

You can push a colliding commit to a fork, but Git will see that it's already there and ignore it - first write does win. Also, "backend doesn't check uniqueness" is also wrong. The server will check for collisions and if this particular case happens, the server will see this and warn you _AND_ not write the object.

Re:Git 3.0's upcoming SHA-256 default will be a costly mistake by tanoku on Friday October 02, 2026 @05:35AM (#49931599)
> I don't swear that this is how GitHub actually works, but I've had knowledgeable friends swear up and down that it is.

All the details on how GitHub's infrastructure has evolved over the years are very publicly detailed in the GitHub engineering blog and in technical talks. There are no "secrets" or "rumors" here, all the information is one google search away. Perhaps you need to re-evaluate your priors on how knowledgeable your friends are.

- https://github.blog/engineering/architecture-optimization/in... - https://www.youtube.com/watch?v=Ri8hSZNKzu4 - https://github.blog/engineering/building-resilience-in-spoke... - https://github.blog/open-source/git/counting-objects/ - https://www.youtube.com/watch?v=DY0yNRNkYb0 - https://cursor.com/blog/git-at-any-scale

Re:Git 3.0's upcoming SHA-256 default will be a costly mistake by fpaq on Friday October 02, 2026 @01:55PM (#49936501)
> However, if I see that you pushed commit abcd134, and then I can build and push a colliding commit...

You cannot do that. This is called a second-preimage attack, which has not been demonstrated even against MD5, let alone SHA1.

Re:Git 3.0's upcoming SHA-256 default will be a costly mistake by lxgr on Friday October 02, 2026 @04:35AM (#49931213)
> And so if you don't trust the server that is hosted on or the security of the transport mechanism like TLS/SSL, such that the content may be manipulated by adversaries, you think that git hashes are good enough?

Yes, they ought to be good enough. That has always been git's security model.

Note that the commit doesn't have to be communicated over the same channel as the git data.

> Well, what about someone who is fetching the commit from that server for the first time and has nothing to compare the hash against?

Then they're vulnerable. But what about somebody learning about the trusted hash in another way, e.g. a build server getting an internal call authenticated by an authorized developer?

Just because you can think of an insecure way to use git hashes doesn't mean there aren't any other, secure ones.

Re:Git 3.0's upcoming SHA-256 default will be a costly mistake by kazinator on Friday October 02, 2026 @08:31AM (#49932758)
You are not saying anything other than that hashes are useful for signing. When you communicate to someone that you trust such and such a hash, and they should too, you are informally certifying the hash, the cryptographically formal way to do which is to sign it.
Re:Git 3.0's upcoming SHA-256 default will be a costly mistake by lxgr on Friday October 02, 2026 @08:50AM (#49932949)
> You are not saying anything other than that hashes are useful for signing.

Yes, but you seem to be saying they are not, or maybe just that git hashes are somehow inherently not capable of taking that role, unless I'm misunderstanding.

Re:Git 3.0's upcoming SHA-256 default will be a costly mistake by pjc50 on Friday October 02, 2026 @05:24AM (#49931533)
> And so if you don't trust the server that is hosted on or the security of the transport mechanism like TLS/SSL, such that the content may be manipulated by adversaries

Wait, why is anyone expecting that to be a good idea at all?

Re:Git 3.0's upcoming SHA-256 default will be a costly mistake by zygentoma on Friday October 02, 2026 @10:54AM (#49934202)
> And so if you don't trust the server that is hosted on or the security of the transport mechanism like TLS/SSL, such that the content may be manipulated by adversaries, you think that git hashes are good enough?

How does this matter? When I have a machine that I trust and a git hash that I trust, I don't need to rely on the transport mechanism. As long as the content cannot be forged to match the hash, the transport is completely irrelevant.