Any signed GitHub commit can be copied, without the author's secret key, creating a distinct commit with an identical tree, metadata, a valid signature, and a "Verified" badge (www.internationalcyberdigest.com)
from yogthos@lemmy.ml to security@lemmy.ml on 07 Jul 23:12
https://lemmy.ml/post/49749897

PoC: github.com/JakeGinesin/git-chain-malleator

#security

threaded - newest

kevincox@lemmy.ml on 08 Jul 01:21 collapse

I’m a little confused by what this is saying. It seems that you can create a basically identical commit with a different signature and thus a different (hashed) ID.

So basically you can take a Signature S1 and produce a valid Signature S2 over the same data that is not identical.

This doesn’t seem like a very useful exploit primitive to me. Not nothing, but doesn’t seem like a big deal. I feel like I am misunderstanding something.

yogthos@lemmy.ml on 08 Jul 02:30 collapse

A green “Verified” badge on GitHub is supposed to mean that a trusted author signed it, and its ID is a one of a kind fingerprint for that exact code. Turns out that the second promise of a unique fingerprint does not hold. It matters because security teams and package systems behind tools like Go, Nix, and GitHub Actions trust that ID as a unique handle for code. An attacker can reissue the same signed code under a fresh ID that’s still verified to slip past.

kevincox@lemmy.ml on 08 Jul 03:17 collapse

I don’t understand. Why does having two commit IDs with the exact same code cause problems.

A green “Verified” badge on GitHub is supposed to mean that a trusted author signed it

The author did sign it. It is the exact same code.

An attacker can reissue the same signed code under a fresh ID that’s still verified to slip past.

To split past what? At best it seems that they would be able to have a different ID for the exact same code, which seems harmless? Slightly confusing at worst.

Nix also doesn’t use PGP signatures, it requires a separate hash of the resulting commit (the files with the .git directory stripped by default).

jatone@lemmy.dbzer0.com on 08 Jul 03:24 next collapse

sounds like the author thinks because their purist definition is violated its a problem vs it actually being a problem. im in the same boat as you. I dont see the issue with the commit hash changing long as the code doesnt change.

yogthos@lemmy.ml on 08 Jul 04:11 collapse

Right, it’s not a serious exploit which would allow changing code, but it does allow compromising integrity because changing the id mutates history.

kevincox@lemmy.ml on 08 Jul 12:24 collapse

It doesn’t mutate history. It just creates a new branch of history in their own fork. Just like any new commit would do.

yogthos@lemmy.ml on 08 Jul 15:19 collapse

but looking back you have no way to tell which branch is the real one

kevincox@lemmy.ml on 08 Jul 15:25 collapse

Please explain what you mean and how this could be abused. What does “real” mean in this context? They both have the same code. It would probably help if you can provide a specific attack that could actually cause harm rather than just stating facts that have unclear risk.

yogthos@lemmy.ml on 08 Jul 15:29 collapse

My understanding is that you’d end up with two divergent histories and you can’t tell which one is the original. I don’t know how it could be abused off top of my head, but generally speaking people tend to find ways to abuse these kinds of things.