In a well-fleshed-out post, Scott Chacon shows how unneecessary Git 3.0's move to replace SHA-1 with SHA-256 is.

all 23 comments

sorted by: hot top controversial new old
[–] 12 points 6 days ago (2 children)

This post misses, uh, a few important things that get mentioned in the lobsters comments: https://lobste.rs/s/bytzgl/git_3_0_s_upcoming_sha_256_default_will_be

  • source
  • hideshow 2 child comments
  • [–] 6 points 6 days ago* (2 children)

    It's sad to see this community only listening to people because they're rich: there are a lot of better engineers who knows more than this guy but they're not "co-creator of GitHub". I read this title as boot licking silicon valley.

    That being said you don't hash git commits for security reason : YOU SIGN YOUR COMMITS FOR SECURITY. Sorry for the caps but let's make this visible.

  • source
  • hideshow 2 child comments
  • [–] [S] 2 points 4 days ago

    If you know of write-ups by others on this, you are welcome to share. It was a pretty long post, so I mentioned who authored it. If it was on, say, LWN, I wouldn't have prefixed anything to the topic. It looks like it also helps people to avoid rich-man blogs (if they want to)!

  • source
  • parent
  • [–] 28 points 1 week ago (4 children)

    His defense of SHA-1:

    Mathematically, for SHA-1’s 160-bit output, the birthday bound means that you would need about 1.4 septillion random files (1.4 quadrillion billion files - 1,400,000,000,000,000 billion - it's impossible to effectively describe) in a single project to have file hashes accidentally collide.

    For the most part the article mostly talks about collision attacks, which quite frankly i think is silly.

    He also talks about hashes pointing to other (older) projects using a different hashing algorithm, but can't the software just detect if its a SHA-1 hash or SHA-256, and fetch it accordingly? He acts like its the end of the world when in my mind most everything can (and probably will) be compensated for pretty easily. It's reminiscent of the IPv6 fear-mongering.

    The thing that gets me is he doesn't say if the current hashing algorithm or the new one has any support for when hashes do collide. Since that can theoretically happen with both, to me that sounds like a problem worth tackling.

  • source
  • hideshow 4 child comments
  • [–] 3 points 1 week ago*

    Collision concerns make sense. If you manage to get two different files with the same hash, that will cause issues for your repo - the concerns over a collision justify the move to SHA-256 though.

  • source
  • parent
  • [–] 23 points 1 week ago

    Madness

    We had a similar stupid issue at my last job. Someone made an edict that all Sha-1 and md5 references in the code must be removed for security reasons.

  • source
  • [–] 14 points 1 week ago (3 children)

    Why did they skip the 255 versions?!

    /s

  • source
  • hideshow 3 child comments
  • [–] 8 points 1 week ago (1 child)

    I'm not qualified to talk about it but Hacker News has arguments against his post: https://news.ycombinator.com/item?id=49924179

  • source
  • hideshow 1 child comment
  • [–] 26 points 1 week ago

    You're probably more qualified than most HNers, just less confident, less inclined to indulge in performative expertise and pseudo-intellectual posturing, and more resistant to joining the circle-jerks with those who do indulge.

  • source
  • parent
  • I pull it from there because I trust that GitHub has its authentication game together enough that it's unlikely that anyone malicious...

    i don't. more importantly, my package manager doesn't. that is, every package manager i can think of references git commit hashes in its build system. the end user trusts that when they build from commit xxxxxxxx, they're getting the exact same code as everyone else. what exactly is being signed in these build systems i don't know, but whatever scott or linus or anyone else wishes would happen, in the real world, commit hashes are a part of the trust chain.

    then again, a lot of package managers just use tags. so maybe in practice, they do trust microsoft.

  • source
  • [–] 1 point 1 week ago (3 children)

    There's people who seriously think commit hashes are there for security purposes? Furthermore, there are git MAINTAINERS that think this?

    How absurd. Author is completely right, making SHA-256 the default implementation serves no purpose. SHA-1 is a completely valid algorithm for non-security use cases, which is precisely how git uses it. This is a solution looking for a problem.

    I think he's maybe overblowing the impact of this change. Realistically, the only ones who are going to be impacted are the folks who maintain git-related tools and forges, as he mentions. The rest of us probably won't even notice. But that's still a ton of pointless work for those folks.

  • source
  • hideshow 3 child comments
  • [–] 1 point 6 days ago

    I think he's maybe overblowing the impact of this change.

    Maybe... But I don't look forward to working with the dozens of IT folks at my company who all installed git once and have never upgraded. This will be multiple meetings, show up on slide decks, break builds...

    It's going to be a right pain for nothing.

  • source
  • parent
  • [–] 0 points 6 days ago* (1 child)

    Wait, they don't affect security? Wouldn't a hash collision mean pulling that hash from GitHub would pull wrong code? Or maybe delete code? I'd assume the hash is used as a lookup key in a database somewhere.

    You also pin dependencies to specific hashes for security reasons.

  • source
  • parent
  • hideshow 1 child comment