Re:SHA-1 'fully and practically broken' by new collision (2020)
by deckard1 on Tuesday October 12, 2021 @07:56PM
(#28846589)
> swap out the commit
What's the method for doing this? Does a "git push" replace objects with identical hashes on the remote? Or a "git pull" replace identical hashes on the local repo?
I suspect finding a hash collision is only the first difficult part of actually pulling this off. You may need direct write access to the file system of the target. And even then everyone else that has already fetched the repo may not be impacted. At which point collisions becomes moot because you can rewrite the entire git history however you want.
Re:SHA-1 'fully and practically broken' by new collision (2020)
by rini17 on Wednesday October 13, 2021 @06:10AM
(#28850320)
The history teaches us: If any system isn't hardened against something, we can assume it's possible. If Git server isn't specifically hardened against that, it might still be tricked to update the file by adversary client. Or attacker can temporarily add hooks that will replace the file on server. Or integration testing system might have write access to the server repo.
Re:SHA-1 'fully and practically broken' by new collision (2020)
by sirclueless on Tuesday October 12, 2021 @11:06PM
(#28847802)
> Granted, the file that the commit touches would need to be not touched in other commits.
That's not how git works. The commit contains the entire tree. You could prepare two separate repositories such that `git checkout deadbeef0001deadbeef` in one checks out the linux kernel and in the other checks out ILOVEYOU.exe.
Re:SHA-1 'fully and practically broken' by new collision (2020)
by noway421 on Tuesday October 12, 2021 @11:51PM
(#28848042)
You're right. Commit id points to a commit object, that points to a tree object and subsequently to individual blob objects. Then it is sufficiently harder, you need to find a collision between 2 blob objects, both of which are executable and don't look suspicious.
Re:SHA-1 'fully and practically broken' by new collision (2020)
by DSingularity on Tuesday October 12, 2021 @05:51PM
(#28845517)
That one is nasty.
Granted, the file that the commit touches would need to be not touched in other commits. That's not out of question in a typical software project - maybe a file in the utils folder which is only written once and never changed?
> I don't think it's possible to create a collision that's also executeable code
You can include an unreadable binary blob in the commit. Tweak the blob to find the collision while keeping the code the way attack requires.