News for hackers. Stuff that matters.
Re:SHA-1 'fully and practically broken' by new collision (2020) by ori_b on Tuesday October 12, 2021 @05:12PM (#28845156)
For someone to be able to break your repo using sha1 collisions, they need to be able to commit to it.

If you don't trust someone, don't let them commit to your repo.

> Were they so in love with the performance of C/C++ being able to pass around 20 byte hashes on the stack without worrying about a more complicated structure (eg a collection of variable length hashes)?

The hashes show up everywhere. They're how every object in git is identified. They make it onto disk. They're not just commit ids.

Changing hashes changes the disk format.

Re:SHA-1 'fully and practically broken' by new collision (2020) by kragen on Tuesday October 12, 2021 @09:01PM (#28847038)
They might not need to commit to your repo to break it using SHA-1 collisions.

They might, for example, compute a collision, commit the malicious version to a private GitHub repository, and then send you a patch with the non-malicious version via email, or by sending you a merge request on GitLab. When you accept and merge in their changes and then push to GitHub, perhaps GitHub will recognize the hash of one of your blobs as a hash that it already knows the blob for (from the private commit), and so it will ignore whatever data you send it for that blob.

Maybe that particular scenario won't work — I haven't tried it — but there are hundreds of possible angles of attack. Fundamentally the security of Git is based on the idea that hashes don't collide.

Re:SHA-1 'fully and practically broken' by new collision (2020) by ori_b on Tuesday October 12, 2021 @09:26PM (#28847183)
The correctness of git is based on hashes not colliding within a repo.

This just means GitHub may need to give up on a cost saving measure like dedup between forks It's a GitHub issue, not a git issue.

Re:SHA-1 'fully and practically broken' by new collision (2020) by kragen on Tuesday October 12, 2021 @09:37PM (#28847245)
Agreed. There are lots of other scenarios, though.
Re:SHA-1 'fully and practically broken' by new collision (2020) by lamontcg on Tuesday October 12, 2021 @06:22PM (#28845805)
Yeah I don't think any of these proposed attacks work without write access to the repo, at which point the game is already pretty much over already.
Re:SHA-1 'fully and practically broken' by new collision (2020) by seoaeu on Tuesday October 12, 2021 @10:28PM (#28847555)
There's plenty of workflows where untrusted people have their proposed changes audited and then written to a git repo
Re:SHA-1 'fully and practically broken' by new collision (2020) by lamontcg on Wednesday October 13, 2021 @02:06AM (#28848720)
How do they get through the auditing?

If I'm looking at a PR which contains a hash collision with code that does a `sudo rm -rf --no-preserve-root /` and I don't accept the malicious code, the hash collision becomes irrelevant.