all 8 comments

sorted by: hot top controversial new old
[–] 5 points 4 months ago (7 children)

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.

  • source
  • hideshow 7 child comments
  • [–] [S] 3 points 4 months ago (6 children)

    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.

  • source
  • parent
  • hideshow 6 child comments
  • [–] 3 points 4 months ago* (5 children)

    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).

  • source
  • parent
  • hideshow 5 child comments
  • [–] [S] 1 point 4 months ago (4 children)

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

  • source
  • parent
  • hideshow 4 child comments
  • [–] 1 point 4 months ago (3 children)

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

  • source
  • parent
  • hideshow 3 child comments
  • [–] [S] 0 points 4 months ago (2 children)

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

  • source
  • parent
  • hideshow 2 child comments
  • [–] 1 point 4 months ago (1 child)

    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.

  • source
  • parent
  • hideshow 1 child comment
  • [–] [S] 0 points 4 months ago

    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.

  • source
  • parent
  • 1 comment in c/cybersecurity@infosec.pub view that post
    [–] 2 points 4 months ago

    This is the opposite of a hash collision (where two different inputs have the same hash), it's instead a case where the same input can produce two distinct hashes. I'm struggling to think of an actual malicious application of this.

    You would need to have a malicious commit (eg. as part of a supply chain attack) which is signed by a maintainer (because their keys were stolen), and then when the project finally reverts the malicious commit, another attacker (without needing the signing keys) can recreate the malicious commit with a new commit-hash, which might trick automated tools into thinking it's a new commit, but the tree and metadata would be identical to the malicious commit, and it would be signed using the old (stolen) signing key that would since have been revoked.

    Is that their point? Or is there some other attack that this enables? This just means that we can't blacklist git commits, since an attacker could produce a new commit hash that represents the same tree. But if an attacker already has the signing keys, then they can do this indefinitely even without this signature malleability. The signing keys would get revoked in both cases, and that's what needs to be checked.

  • source