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

Re: Git and SHA-1 security (again)

From
DLDavid Lang <david@lang.hm>
Date
Jul 18, 2016, 20:01 UTC
Message-ID
<alpine.DEB.2.02.1607181258160.25425@nftneq.ynat.uz>
In-Reply-To
<CAPp-Vra5ri7V03SSkU6=UnWrsq-jk0XcNpQuzGH8kQxE-TkPjA@mail.gmail.com>
On Mon, 18 Jul 2016, Herczeg Zsolt wrote:
Show 45 quoted lines
>> In particular, as far as I know and as Theodore Ts'o's post describes
>> better than I could[1], you seem to be confusing preimage attacks with
>> collision attacks, and then concluding that because SHA1 is vulnerable
>> to collision attacks that use-cases that would need a preimage attack
>> to be compromised (which as far is I can tell, includes all your
>> examples) are also "broken".
>
> I understand the differences between the collision and preimage
> attacks. A collision attack is not that bad for git in a typical
> use-case. But I think that it's important to note that there are many
> use-cases which do need a hash safe from collision attack. Some
> examples:
>
> You maintain a repository with gittorrent with signed commits Others
> can use these signatures to verify it's original. Let's say you
> include some safe file (potentially binary) from a third-party
> contributor. That would be fine if the hash algo is safe. Currently
> there is the possibility that you received a (safe) file which was
> made to collide with another malicious one. Once you committed (and
> signed) that file, the attacker joins the gittorrent network and
> starts to distribute the malicious file. Suddenly most of your clients
> pulling are infected however your signature is correct.
>
> Or, you would like to make a continuous delivery system, where you use
> signed tags. The delivery happens only when signature is right, and
> the signer is responsible for it. Your colleague makes a collision,
> pushes the good-file. You make all the tests, everything is fine, sign
> and push and wait for the delivery to happen. Your colleague changes
> the file on the server. The delivery makes a huge mass, and you're
> fired.
>
> Or, let's say you use a service like github, which is nice enough to
> make a repository for you, with .gitignore, licenses and everything.
> Likely, you'll never change dose files. Let's say that service made
> one of those initial files to collide something bad. That means, they
> can "infect" anyone, who is pulling your repo.
>
> Do you need more hypothetical stories? There are a lot. Of course they
> need a lot of work, and they're unlikely to happen. But it's possible.
> If you need trust, and gpg signatures that means you need ultimate
> trust. What's the point in making GPG signatures anyway if you cannot
> ultimately trust them? You could just as well say: well that's
> repository is only reachable by trustworthy persons, everything here
> is just fine and really made by the person named in the "author
> field".

All of your examples are actually preimage attacks. If the bad guy can tamper with the both the 'safe' and 'malicious' versions of the file, they don't actually need the malicious version, they can attack you through the one you think is 'safe'

The 'collision' attack isn't that there is some increased chance of a random file colliding with your safe file, it's that if you are manipulating the contents of both files, you can create two that collide. This won't hurt a Git repository unless one of these manipulated files is able to be introduced as a legitimate part of the repo you are dealing with.

David Lang
Previous: Herczeg ZsoltNext: Herczeg Zsolt
Message 32 of 52 in “Git and SHA-1 security (again)”
  1. Herczeg ZsoltJul 16, 2016
  2. brian m. carlsonJul 16, 2016
  3. Herczeg ZsoltJul 16, 2016
  4. brian m. carlsonJul 16, 2016
  5. Johannes SchindelinJul 17, 2016
  6. brian m. carlsonJul 17, 2016
  7. Duy NguyenJul 17, 2016
  8. brian m. carlsonJul 17, 2016
  9. Theodore Ts'oJul 17, 2016
  10. brian m. carlsonJul 17, 2016
  11. Junio C HamanoJul 18, 2016
  12. Jonathan NiederJul 18, 2016
  13. brian m. carlsonJul 18, 2016
  14. Johannes SchindelinJul 21, 2016
  15. Johannes SchindelinJul 21, 2016
  16. Junio C HamanoJul 22, 2016
  17. Johannes SchindelinJul 18, 2016
  18. brian m. carlsonJul 18, 2016
  19. Johannes SchindelinJul 21, 2016
  20. Duy NguyenJul 18, 2016
  21. Johannes SchindelinJul 19, 2016
  22. David LangJul 19, 2016
  23. Duy NguyenJul 19, 2016
  24. Junio C HamanoJul 19, 2016
  25. Duy NguyenJul 19, 2016
  26. Junio C HamanoJul 19, 2016
  27. Ævar Arnfjörð BjarmasonJul 18, 2016
  28. Herczeg ZsoltJul 18, 2016
  29. Ævar Arnfjörð BjarmasonJul 18, 2016
  30. Junio C HamanoJul 18, 2016
  31. Herczeg ZsoltJul 18, 2016
  32. David LangJul 18, 2016
  33. Fwd: Git and SHA-1 security (again)Herczeg Zsolt, Jul 18, 2016
  34. Johannes SchindelinJul 18, 2016
  35. Herczeg ZsoltJul 18, 2016
  36. Johannes SchindelinJul 18, 2016
  37. Duy NguyenJul 18, 2016
  38. Johannes SchindelinJul 19, 2016
  39. Duy NguyenJul 19, 2016
  40. David LangJul 19, 2016
  41. Duy NguyenJul 19, 2016
  42. David LangJul 19, 2016
  43. Duy NguyenJul 19, 2016
  44. Herczeg ZsoltJul 19, 2016
  45. Duy NguyenJul 20, 2016
  46. Johannes SchindelinJul 20, 2016
  47. Duy NguyenJul 20, 2016
  48. Stefan BellerJul 20, 2016
  49. Junio C HamanoJul 20, 2016
  50. Philip OakleyAug 22, 2016
  51. Herczeg ZsoltJul 18, 2016
  52. Johannes SchindelinJul 19, 2016

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.