Re: About git and the use of SHA-1

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Dmitry Potapov
Date: Tuesday, April 29, 2008 - 5:41 am

On Mon, Apr 28, 2008 at 06:29:07PM +0200, Henrik Austad wrote:

SHA-1 is broken in the sense that it requires computation less than
finding a collision  by brute force (2^80). It is still very costly and
AFAIK no one yet has found a single collision for SHA-1 yet, but even if
such a collision is found, the question is how it can be exploit?

This collision cannot be used to replace any existing code in Git. The
only way to exploit this collision is to submit a patch based on one
sequence to the maintainer and it should look legitimate to be accepted
and then create another blob with malicious code based on the other
sequence, so the second blob has the same SHA-1 then anyone who pulls
from you will get malicious code.

However, it is tricky to create these two blobs -- one which should pass
inspection and look like as a real improvement but the other one that
should do what you want. All what you have is two sequences of 20 bytes
with the same SHA-1 and you have no control over them. For some binary
files, it is possible by including both good and bad contents in the
submitted blob and using one sequence in the right place to hide the bad
part and make only the good one active/visible. Then the other blob will
be almost the same but contains the other sequence, which is used to
activate the bad part. This can work if the maintainer cannot see
everything but only the "visible" part. However, I don't think you can
do anything like that with _source_ code, which is inspect. And if
submitted code is not reviewed, there is nothing that can protect you
from malicious code getting into the repository (and even worse it will
get directly into the official repository!).

So, I don't think we have to worry much about possibility a collision
attack, but only about preimage attacks; and a preimage attack on SHA-1
is far away from reality.

Dmitry
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
About git and the use of SHA-1, Henrik Austad, (Mon Apr 28, 9:29 am)
Re: About git and the use of SHA-1, Daniel Barkalow, (Mon Apr 28, 12:34 pm)
Re: About git and the use of SHA-1, Henrik Austad, (Mon Apr 28, 2:29 pm)
Re: About git and the use of SHA-1, Daniel Barkalow, (Mon Apr 28, 3:15 pm)
Re: About git and the use of SHA-1, Andreas Ericsson, (Mon Apr 28, 11:38 pm)
Re: About git and the use of SHA-1, Russ Dill, (Tue Apr 29, 12:09 am)
Re: About git and the use of SHA-1, Andreas Ericsson, (Tue Apr 29, 12:21 am)
Re: About git and the use of SHA-1, Sverre Rabbelier, (Tue Apr 29, 4:05 am)
Re: About git and the use of SHA-1, Andreas Ericsson, (Tue Apr 29, 5:27 am)
Re: About git and the use of SHA-1, Dmitry Potapov, (Tue Apr 29, 5:41 am)
Re: About git and the use of SHA-1, Jurko Gospodnetić, (Tue Apr 29, 5:46 am)
Re: About git and the use of SHA-1, Paolo Bonzini, (Tue Apr 29, 6:05 am)
Re: About git and the use of SHA-1, Andreas Ericsson, (Tue Apr 29, 7:37 am)
Re: About git and the use of SHA-1, Andreas Ericsson, (Tue Apr 29, 7:41 am)
Re: About git and the use of SHA-1, Paolo Bonzini, (Tue Apr 29, 7:52 am)
Re: About git and the use of SHA-1, Tom Widmer, (Tue Apr 29, 8:02 am)
Re: About git and the use of SHA-1, Geoffrey Irving, (Tue Apr 29, 8:34 am)
Re: About git and the use of SHA-1, Nicolas Pitre, (Tue Apr 29, 8:42 am)
Re: About git and the use of SHA-1, Geoffrey Irving, (Tue Apr 29, 8:59 am)
Re: About git and the use of SHA-1, Russ Dill, (Tue Apr 29, 9:21 am)
Re: About git and the use of SHA-1, Russ Dill, (Tue Apr 29, 9:24 am)
Re: About git and the use of SHA-1, Daniel Barkalow, (Tue Apr 29, 9:27 am)
Re: About git and the use of SHA-1, Nicolas Pitre, (Tue Apr 29, 9:39 am)
Re: About git and the use of SHA-1, Tom Widmer, (Tue Apr 29, 10:08 am)
Re: About git and the use of SHA-1, Geoffrey Irving, (Tue Apr 29, 10:48 am)
Re: About git and the use of SHA-1, Nicolas Pitre, (Tue Apr 29, 10:55 am)
Re: About git and the use of SHA-1, Geoffrey Irving, (Tue Apr 29, 11:02 am)
Re: About git and the use of SHA-1, Matthieu Moy, (Tue Apr 29, 11:17 am)
Re: About git and the use of SHA-1, Fredrik Skolmli, (Tue Apr 29, 11:23 am)
Re: About git and the use of SHA-1, Daniel Barkalow, (Tue Apr 29, 11:41 am)
Re: About git and the use of SHA-1, Geoffrey Irving, (Tue Apr 29, 1:31 pm)
Re: About git and the use of SHA-1, Fredrik Skolmli, (Tue Apr 29, 1:50 pm)
Re: About git and the use of SHA-1, Geoffrey Irving, (Tue Apr 29, 2:39 pm)
Re: About git and the use of SHA-1, Fredrik Skolmli, (Tue Apr 29, 2:52 pm)
Re: About git and the use of SHA-1, Martin Langhoff, (Tue Apr 29, 7:58 pm)
Re: About git and the use of SHA-1, Geoffrey Irving, (Tue Apr 29, 10:18 pm)
Re: About git and the use of SHA-1, David Brown, (Tue Apr 29, 10:47 pm)
Re: About git and the use of SHA-1, Martin Langhoff, (Tue Apr 29, 10:56 pm)