1 |
On Mon, Feb 27, 2017 at 1:02 PM, Alan McKinnon <alan.mckinnon@×××××.com> wrote: |
2 |
> |
3 |
> I always though git's use of SHA hashes was to identify commits and |
4 |
> detect random bit flips, not to provide any measure of security. |
5 |
> |
6 |
|
7 |
As somebody said in Twitter recently (and Linus to some degree in his |
8 |
post), it is, except when it isn't. |
9 |
|
10 |
git supports gpg signatures on tags and commits. The only thing that |
11 |
binds these signatures to the information being signed are sha1 hashes |
12 |
and file sizes, and Google has already demonstrated the ability to |
13 |
manipulate hashes without changing file size. |
14 |
|
15 |
Those hashes apply to blobs and trees, and doing a collision on either |
16 |
lets you modify the contents of the tree. |
17 |
|
18 |
Now, if every commit is being carefully reviewed (via git diff/etc) |
19 |
then the chances of leaking the data needed to make collisions less |
20 |
expensive into the repo is low, as long as you're talking exclusively |
21 |
about text files (which is all we store in the tree). If you go |
22 |
storing pdfs or images/etc in a repo I'm less confident that you could |
23 |
detect attempts to sneak easy-to-collide data into a repo. |
24 |
|
25 |
So, this isn't a reason to panic, but it is a reason for concern. |
26 |
People have been talking about sha-1 collisions for a while. |
27 |
|
28 |
Commit signatures are not the only way to secure the Gentoo |
29 |
repository, but they seem like one of the most convenient to use, |
30 |
assuming we could trust them. I've always seen sha1 brought up as one |
31 |
of the biggest reasons not to. |
32 |
|
33 |
-- |
34 |
Rich |