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

RE: How safe are signed git tags? Only as safe as SHA-1 or somehow safer?

From
Jason Pyeron <jpyeron@pdinc.us>
Date
Nov 21, 2014, 23:32 UTC
Message-ID
<1B02B87E88254A4A95EE138C9D2C4B8B@black>
In-Reply-To
<546FC446.50101@whonix.org>
Show 26 quoted lines
> -----Original Message-----
> From: Patrick Schleizer
> Sent: Friday, November 21, 2014 18:01
> 
> Dear git developers!
> 
> Jeff King wrote:
> > On Sun, Nov 16, 2014 at 03:31:10PM +0000, Patrick Schleizer wrote:
> > 
> >> How safe are signed git tags? Especially because git uses 
> SHA-1. There
> >> is contradictory information around.
> >>
> >> So if one verifies a git tag (`git tag -v tagname`), then 
> `checksout`s
> >> the tag, and checks that `git status` reports no untracked/modified
> >> files, without further manually auditing the code, how 
> secure is this
> >> actually? Is it only as safe as SHA-1?
> > 
> > Yes, it is only as "safe as SHA-1" in the sense that you 
> have GPG-signed
> > only a SHA-1 hash. If somebody can find a collision with a 
> hash you have
> > signed, they can substitute the colliding data for the data 
> you signed.
The whole issue is a lot better than this makes it sound. Yes it is just a SHA1 hash, but it is a hash of a structured data format.
You have very observable parts of that well structured data providede to the hash.
The commit message, the directory contents, and lastly the files themselves.
For a collision to occur, the commit message would have to likely have garbage in the message of a large nature. To generate a colision by commited file contents is unlikely because the file contents is reduced to a hash in the directory structure, which is in turn reduced to a hash in a commit structure.
This would be noticed.
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                                                               -
- Jason Pyeron                      PD Inc. http://www.pdinc.us -
- Principal Consultant              10 West 24th Street #100    -
- +1 (443) 269-1555 x333            Baltimore, Maryland 21218   -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This message is copyright PD Inc, subject to license 20080407P00. 
Previous: Patrick SchleizerNext: Jeff King
Message 4 of 21 in “How safe are signed git tags? Only as safe as SHA-1 or somehow safer?”
  1. Patrick SchleizerNov 16, 2014
  2. Jeff KingNov 17, 2014
  3. Patrick SchleizerNov 21, 2014
  4. Jason PyeronNov 21, 2014
  5. Jeff KingNov 22, 2014
  6. Jeff KingNov 22, 2014
  7. Fedor BrunnerNov 25, 2014
  8. Duy NguyenNov 24, 2014
  9. Michael J GruberNov 24, 2014
  10. Duy NguyenNov 24, 2014
  11. Duy NguyenNov 25, 2014
  12. Jeff KingNov 24, 2014
  13. Nico WilliamsNov 24, 2014
  14. Duy NguyenNov 25, 2014
  15. Jonathan NiederNov 25, 2014
  16. Duy NguyenNov 25, 2014
  17. Stefan BellerNov 25, 2014
  18. Jeff KingNov 25, 2014
  19. Duy NguyenNov 25, 2014
  20. Junio C HamanoNov 25, 2014
  21. brian m. carlsonNov 25, 2014

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.