4 ms·
What's the impact to something like git that makes extensive use of SHA-1? In their example they've created two PDFs with the same SHA-1. Could I replace the b
by koolba 10y ago
What's the impact to something like git that makes extensive use of SHA-1?
In their example they've created two PDFs with the same SHA-1. Could I replace the blob in a git repo with the "bad" version of a file if it matches the SHA-1?
- sanifsddd 10y agoDo you have a paypal account. in case if you have you can add an extra 650 a week in your pay only working on the internet two hours per day. look at this link... http://bit.ly/2atnA1a http://bit.ly/2atnA1a
- cphoover 10y agoGreat question... Can anyone answer this? Seems ripe for exploitation.
- deleted 10y ago[deleted]
- raverbashing 10y agoIt's probably doable, but your commit will be huge with a lot of comments or dummy files to make the collision possible.
- michaelt 10y agoPrevious brute forcing efforts [1] have fiddled with commit and author timestamps. If you had seven commits, and two timestamps per commit, and each timestamp could be fudged by 90 minutes without detection, you might not need any dummy comments or files at all. [1] https://github.com/bradfitz/gitbrute https://github.com/bradfitz/gitbrute
- gcp 10y agoThe shattered site explicitly singles out git as at risk.
- giovannibajo1 10y agoThis is not a pre-image attack, so you can't create a file that matches an existing SHA1. It's a collision attack, so you can create two files whose SHA1 is the same. So what I could potentially do (given a multi-million dollar budget) is create from scratch two git repositories with different content, whose HEAD is the same. This would allow me to serve different repositories to different users. What is currently still not feasible is to create a custom git repository whose HEAD matches that of the Linux kernel. See also: http://crypto.stackexchange.com/questions/1173/what-are-preimage-resistance-and-collision-resistance-and-how-can-the-lack-ther http://crypto.stackexchange.com/questions/1173/what-are-prei...
- geocar 10y ago> What is currently still not feasible is to create a custom git repository whose HEAD matches that of the Linux kernel. I'm not convinced that's good enough. In git, the SHA1 is always the hash of a gzip, which is subject to tricks[1] where a header might be prepared and then some padding inserted to collide a malicious tail. [1]: http://swtch.com/r.zip http://swtch.com/r.zip
- avar 10y agoNo, Git does not hash its internal gzip'd content to produce hashes. It purely hashes the uncompressed content you give it as-is. Any compression like gzip is purely done internally as an optimization and has no impact on hashes.
- jerf 10y agoNobody's saying it's "good enough". Once we see one attack we expect to start seeing more. What's being pointed out here is that this particular attack does not let you craft custom git repos whose HEAD matches one of an existing repo. Nobody is asserting that to be generically impossible, and this new attack is at least weak evidence that such an attack may eventually be practical.
- mike_hearn 10y agoI think this is perhaps not the case. HEADs move. People contribute code. Sure, if you take a snapshot of every git repo you will ever use today and never move past those commits, this attack doesn't help. Obviously nobody will do that. People, potentially malicious people, will continue to contribute commits which they could have collided with one that does something different. I'd think that using commit hashes as a security mechanism will soon be dead.
- ktta 10y agoThere's a good explanation here: http://stackoverflow.com/a/34599081/6448137 http://stackoverflow.com/a/34599081/6448137
- ahoka 10y agoCirca 870,000 USD using AWS p2.xlarge instances. edit.: they seem to quote 560k, I overlooked using both the CPUs and the GPUs.
- deleted 10y ago[deleted]
- joantune 10y agoRead the 'whole' [not that big] page. The explanation is there, in short: yes. >How is GIT affected? GIT strongly relies on SHA-1 for the identification and integrity checking of all file objects and commits. It is essentially possible to create two GIT repositories with the same head commit hash and different contents, say a benign source code and a backdoored one. An attacker could potentially selectively serve either repository to targeted users. This will require attackers to compute their own collision.
- tejohnso 10y agoLinus' answer: http://marc.info/?l=git&m=115678778717621&w=2 http://marc.info/?l=git&m=115678778717621&w=2 tl;dr it's a non-issue
- pacaro 10y agoNo. Linus' answer is correct, as far as it goes, but the threats he considers are only a subset of the real problems. Laying aside the fact that this attack isn't the one you need to attack a hit repo, and recognizing that the theoretical weakness of SHA-1 (that has been known since (IIRC) before the conception of git) has now become a practical weakness If an attacker can forge an arbitrary part of a git tree, then if they can poison an upstream repo (we are presuming a motivated attacker given the costs involved), then they can undetectably compromise anyone downstream that clones the repo. Linus describes in 2006 a trust model where you don't trust remote repos more than your local repo. This isn't how git is used by most users today
- pacaro 10y agoAddendum: given a known good repo, an infected repo can be detected by diffing all elements of the repo. A parallel hash scheme with a strong hash function (SHA-3 at this point) could be used, which would easily detect if parties have differing histories by comparing commit hashses using both schemes (both should match!) We should assume that nation state adversaries may have known this for a while - whether they have acted on it remains to be seen. I suspect it is unlikely for git because it is measurable after the fact (unless you contaminate every instance) I'd be more worried about signing schemes. (Wrote previous while bathing a toddler)
- kriro 10y agoBy design, in case of a collision the new version will not replace the old (older version has preference in case of a collision). Not sure if you could somehow fiddle with the meaning of old and new from the systems POV though.