"Keybase Attack" on RSA signatures
2014-09-09 21:24:31 GMT
Tony Arcieri
_______________________________________________ Messaging mailing list Messaging <at> moderncrypto.org https://moderncrypto.org/mailman/listinfo/messaging
_______________________________________________ Messaging mailing list Messaging <at> moderncrypto.org https://moderncrypto.org/mailman/listinfo/messaging
Keybase attempts to bind user identities on social media to their PGP keys by having users publish an RSA signature under an unknown key, which Keybase refers to as a "proof". The (allegedly) signed message contains a link to their Keybase identity, but contains no information about their public key fingerprint.
After clicking on the link in the message we're taken to the Keybase web site where their alleged public key is listed. We are then asked to verify this key is authentic by checking if the digital signature in the original message verifies.However, is this actually secure? Or more specifically:Can we produce an RSA keypair such that an existing digital signature will verify under it if we control both the private and public key?
I'd also note that, if someone does have a solution to this problem, it would probably be good to responsibly disclose to Keybase ;)
_______________________________________________ Messaging mailing list Messaging <at> moderncrypto.org https://moderncrypto.org/mailman/listinfo/messaging
A Keybase “proofs” is a signatures of JSON object that includes: [...] (3) the user’s PGP fingerprint
_______________________________________________ Messaging mailing list Messaging <at> moderncrypto.org https://moderncrypto.org/mailman/listinfo/messaging
Comment below.
Original Message
----------------
From: cryptography [mailto:cryptography-bounces+dennis.hamilton=acm.org <at> metzdowd.com] On Behalf Of Tony Arcieri
Sent: Tuesday, September 9, 2014 15:07
To: Max Krohn
Cc: messaging; Crypto
Subject: Re: [Cryptography] [messaging] "Keybase Attack" on RSA signatures
On Tue, Sep 9, 2014 at 2:52 PM, Max Krohn <themax <at> gmail.com> wrote:
A Keybase “proofs” is a signatures of JSON object that includes: [...] (3) the user’s PGP fingerprint
Sorry, I must've glossed over this. It would seem to provide an immediate defense to forging a keypair under which the signature would validate, however it seems in conjunction with a SHA1 collision that allows the replacement of the fingerprint in the original message, this could be potentially problematic.
--
Tony Arcieri
I am not certain how this can work.
The fact that there is a fingerprint included in the message that keybase.io has be signed with my private key does not mean that determines the public key certificate that is used for verification of the signed message. If someone else finds one of my claims, they should use my keybase.io ID to fetch the key to use in verifying the signed message for themselves. I.e., if they want to check the message at http://orcmid.com/keybase.txt, they should go to keybase.io/orcmid to get my public-key certificate if they don’t have it already.
Now, if you could forge a message such that it verifies with an existing affixed signature, and the message is even intelligible, that would be a remarkable action against public-key technology. It would mean a lot more than there being a defect in keybase.io protocols for association of identifiers with an entity having authority over a private key. Not only would you have found an SHA1 collision, let’s say, but you are able to have the modified message still look like a JSON plaintext and be unnoticeable as a crafted collision. There’s just no place to do that in these plaintext claim documents.
Since the readable plaintext in those posted claims is not the actual signed message, but a statement about what the signed message is, it is possible to be misleading. But if the signed message block that is on that page is altered, keybase.io will detect that on periodic verification of the file at that URL.
_______________________________________________ The cryptography mailing list cryptography <at> metzdowd.com http://www.metzdowd.com/mailman/listinfo/cryptography
Now, if you could forge a message such that it verifies with an existing affixed signature, and the message is even intelligible, that would be a remarkable action against public-key technology.
_______________________________________________ The cryptography mailing list cryptography <at> metzdowd.com http://www.metzdowd.com/mailman/listinfo/cryptography
Keybase attempts to bind user identities on social media to their PGP keys by having users publish an RSA signature under an unknown key, which Keybase refers to as a "proof". The (allegedly) signed message contains a link to their Keybase identity, but contains no information about their public key fingerprint.After clicking on the link in the message we're taken to the Keybase web site where their alleged public key is listed. We are then asked to verify this key is authentic by checking if the digital signature in the original message verifies.However, is this actually secure? Or more specifically:
Can we produce an RSA keypair such that an existing digital signature will verify under it if we control both the private and public key?
For the purposes of this problem, let's say it doesn't even need to be a good / secure RSA key, just one that the "proof" signature verifies under.
_______________________________________________ Messaging mailing list Messaging <at> moderncrypto.org https://moderncrypto.org/mailman/listinfo/messaging
> Indeed; as best I can tell, keybase.io's OpenPGP implementation is not checking any of the RSA cryptosystem's validity conditions. (Neither does Google's E2E. GnuPGP and PGP check some, but not all.) What RSA public key consumers should check, in rough order of importance: > > gcd(n, e) == 1 > n mod 2 == 1 > 1 < e <= 2^16+1 > is_prime(e) > > (Note that the last two are more restrictive than the sufficient conditions for validity. There is no particular reason to be more lenient, however. It is also nice to check that n can't be factored by trial division or random ECM instances for rho, lambda, and p-1, but this is impractical for JS implementations.) Thank you for these suggestions, I’ll incorporate them into the Web client. The command-line client shells out to GnuPG so should be partially covered. Are there analagous checks recommended for DSA and ECDSA keys?
_______________________________________________ Messaging mailing list Messaging <at> moderncrypto.org https://moderncrypto.org/mailman/listinfo/messaging
RSS Feed