top | item 28390186

(no title)

yc12340 | 4 years ago

> An attacker would merely have to brute force the tip of their attacker repository, a matter which you can do within the hour

So you think, that you can do so in a hour? How much are you willing to bet on that?

For bonus points try to "brute force a tip" for repository, containing actual contents (as opposite to randomly named binary files with gibberish).

discuss

order

Genbox|4 years ago

Not sure what you are asking, but it is trivially easy to fake a git short hash to whatever you like.

I cloned this repo: https://github.com/bradfitz/gitbrute

Ran the command in the readme (had to do it twice for some reason) and the latest commit is now 000001 on my fork of the repo: https://github.com/Genbox/gitbrute/commit/0000019075dabc337f...

It took less than 3 minutes for the full thing.

dfawcus|4 years ago

My example was using cut'n'paste, then cmp, so the full 40 char hash. I don't try comparing those things manually.

As I said trivial to prove valid; and since I was actually reading, using, and compiling the code, quite difficult to achieve a collision in the circumstances.

zaarn|4 years ago

Brute Forcing a commit hash requires no gibberish binary files with random names, the data can be inserted into the commit metadata in ways that won't even show up in your git log. Forcing the entire commit hash is hard but by default everyone only checks the first 6 digits anyway.