News for hackers. Stuff that matters.
Re:Git 3.0's upcoming SHA-256 default will be a costly mistake by orf on Thursday October 01, 2026 @06:28PM (#49927804)
> The GPG signature is not signing the git hash, if that's what you mean.

It kind of is - it’s signing the hash of the tree object, which is the actual thing that you’d attack with a hash collision

Re:Git 3.0's upcoming SHA-256 default will be a costly mistake by kazinator on Thursday October 01, 2026 @06:35PM (#49927876)
I understand that if we sign a commit with the help of some arbitrarily strong hash, it doesn't protect the parent commit(s). The integrity of the SHA-1 hash references to the parent commits is not in question, but the authenticity of those commits themselves.
Re:Git 3.0's upcoming SHA-256 default will be a costly mistake by orf on Thursday October 01, 2026 @06:50PM (#49927974)
No, not the abstract tree formed by a series of commits.

The actual git ‘tree’ object, which is the thing a commit actually points to, referenced by a hash in the commit. That is signed by the GPG signature.

Re:Git 3.0's upcoming SHA-256 default will be a costly mistake by Borealid on Friday October 02, 2026 @03:51AM (#49930942)
Correct. The content of the git `tree` is partially controlled by the attacker because filenames in the repository are part of it. So if it's feasible to manufacture a generic hash collision it MAY (not MUST) be feasible to generate two colliding `tree` objects.
Re:Git 3.0's upcoming SHA-256 default will be a costly mistake by tremon on Friday October 02, 2026 @05:45AM (#49931658)
The actual thing you'd attack with a hash collision is the blob object, not the tree object, right? The tree object has a rigid structure and git will throw a fit if you add non-functional data to modify its hash. Source code files have comments which make it much easier to manipulate the hash.
Re:Git 3.0's upcoming SHA-256 default will be a costly mistake by orf on Friday October 02, 2026 @06:29AM (#49931920)
you're right, i worded that poorly. what i meant to imply was that a blob hash collision causes any tree referencing it to be malicious, which cascades down to many different commits/tags (potentially all of them, if the tree is untouched since repo creation).
Re:Git 3.0's upcoming SHA-256 default will be a costly mistake by kazinator on Friday October 02, 2026 @02:43PM (#49937051)
Maybe you could make a valid tree object with the same hash and different content; the details about which graph node at which level is used as a target do not seem that important.