git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Possible vulnerability to SHA-1 collisions

From
Andreas Ericsson <ae@op5.se>
Date
Nov 28, 2012, 09:35 UTC
Message-ID
<50B5DAC9.7020609@op5.se>
In-Reply-To
<20121128002714.GA23224@sigill.intra.peff.net>
On 11/28/2012 01:27 AM, Jeff King wrote:
Show 38 quoted lines
> On Tue, Nov 27, 2012 at 06:30:17PM -0500, Aaron Schrab wrote:
> 
>> At 18:07 -0500 27 Nov 2012, Jeff King <peff@peff.net> wrote:
>>> PS I also think the OP's "sockpuppet creates innocuous bugfix" above is
>>>   easier said than done. We do not have SHA-1 collisions yet, but if
>>>   the md5 attacks are any indication, the innocuous file will not be
>>>   completely clean; it will need to have some embedded binary goo that
>>>   is mutated randomly during the collision process (which is why the
>>>   md5 attacks were demonstrated with postscript files which _rendered_
>>>   to look good, but contained a chunk of random bytes in a spot ignored
>>>   by the postscript interpreter).
>>
>> I don't think that really saves us though.  Many formats have parts
>> of the file which will be ignored, such as comments in source code.
> 
> Agreed, it does not save us unconditionally. It just makes it harder to
> execute the attack. Would you take a patch from a stranger that had a
> kilobyte of binary garbage in a comment?
> 
> A more likely avenue would be a true binary file where nobody is
> expected to read the diff.
> 
>> With the suggested type of attack, there isn't a requirement about
>> which version of the file is modified.  So the attacker should be
>> able to generate a version of a file with an innocuous change, get
>> the SHA-1 for that, then add garbage comments to their malicious
>> version of the file to try to get the same SHA-1.
> 
> That's not how birthday collision attacks usually work, though. You do
> not get to just mutate the malicious side and leave the innocuous side
> untouched. You are mutating both sides over and over and hoping to find
> a matching sha1 from the "good" and "evil" sides.
> 
> Of course, I have not been keeping up too closely with the efforts to
> break sha-1. Maybe there is something more nefarious about the current
> attacks. I am just going off my recollection of the md5 collision
> attacks.
> 

AFAIR, collision attacks can be executed with a 2^51 probability (with a 2^80 claim, that's pretty bad), but preimage attacks are still stuck very close to the claimed 2^160.

That means every attack involving SHA1 means Mr. Malicious creates both the involved files or does exceptional research without sharing it.

I think git's job is to make sure that write access to only one of the repositories is insufficient to launch an attack. If the attacker manages to change all repositories involved then the hash function used is really quite irrelevant.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.
Previous: Jeff King
Message 6 of 6 in “Possible vulnerability to SHA-1 collisions”
  1. Michael HirshleiferNov 24, 2012
  2. Shawn PearceNov 24, 2012
  3. Jeff KingNov 27, 2012
  4. Aaron SchrabNov 27, 2012
  5. Jeff KingNov 28, 2012
  6. Andreas EricssonNov 28, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.