News for hackers. Stuff that matters.
Re:Git undo: We can do better by stickfigure on Monday June 21, 2021 @02:03PM (#27581816)
I've actually worked on git internals and I'm in the same boat.

As part of a security-related project some years ago, my team and I hacked jgit to use SHA256, which required changing the length of pretty much every on-disk data structure. Sadly, there was (probably still is) no HASH_LEN constant, just a lot of magic offsets strewn throughout the code. I had to compare lengths against the git spec at every step.

And yet I still scramble for stackoverflow every time something goes slightly amiss.

Re:Git undo: We can do better by davvid on Monday June 21, 2021 @04:36PM (#27584101)
There's an ongoing effort to rework core Git so that the hash implementation can be swapped out for eg. SHA256. [1]

jGit is actually a separate project from core Git, but once it gets adopted into core Git we can expect that jGit will follow suite, given that it's critical to Gerrit and other projects.

[1] https://lore.kernel.org/git/[email protected]...

Re:Git undo: We can do better by sam_lowry_ on Monday June 21, 2021 @02:54PM (#27582639)
What a pointless project! U hope you were paid well, at least.
Re:Git undo: We can do better by stickfigure on Monday June 21, 2021 @03:16PM (#27583010)
I was. But it wasn't quite as pointless as it sounds - the tool was a sort of tripwire-like system, with changes shipped to an append-only log, that itself was checkpointed in an early blockchain-ish structure. The threat model was "nation state actor" so the client wouldn't accept SHA1.

It was actually a pretty cool system. I don't think it was ever sold though.

Re:Git undo: We can do better by unknown_error on Monday June 21, 2021 @05:50PM (#27584986)
Man, I thought zero days and secret backdoors were bad enough. Now we have to worry about manufactured hash collisions in all our repos' files dating back forever?
Re:Git undo: We can do better by simonelnahas on Monday June 21, 2021 @06:14PM (#27585226)
That seems like an overkill. Couldn't you combine the hash together with the date to obtain uniqueness?
Re:Git undo: We can do better by unknown_error on Monday June 21, 2021 @06:26PM (#27585341)
The date isn't really meaningful since it can be set to anything on a file. But if you can force two dissimilar files to have the same hash, you can combine that with some other attack to inject it into some sort of chain of trust, whether it's git or some other type of checksum based system. Then combine that with a SolarWinds like attack and even if they try to revert to something from years earlier, they can't guarantee that the rollback files are still unaltered unless they had multiple hashes to compare it to or diffed it manually. But multiply that by X thousand files over Y commits during Z years and it would be very difficult to detect.
Re:Git undo: We can do better by sam_lowry_ on Tuesday June 22, 2021 @02:18AM (#27588584)
I do not remember jgit internals, but its API is pretty bad. I always assumed it was some kind of throwaway PoC suddenly turned popular.
Re:Git undo: We can do better by stickfigure on Tuesday June 22, 2021 @02:09PM (#27595039)
> some kind of throwaway PoC suddenly turned popular

Wow, that description feels spot on.