3 ms·
The issue is pretty easy to comprehend once you understand how a Diffie-Hellman key exchange works. Imagine you go to myCompany.com and you do a key exchange w
by baby 10y ago
The issue is pretty easy to comprehend once you understand how a Diffie-Hellman key exchange works.
Imagine you go to myCompany.com and you do a key exchange with both of your public keys.
* your public key: g^a mod n
* your company's public key: g^b mod n
where g and n are public parameters that you agreed on. Let's ignore n: here, both ends can create the shared secret by doing either (g^b)^a or (g^a)^b
so (other dude's public key)^(my private key)
If you know either one of them's private key, you can observe the other public key (it's public!) and compute the shared secret. Then you have enough to replace one of the end in the TLS communication.
So here if you replace the client's certificate with your own keypair, or know the private key of the certificate, you can guess whatever key exchange they try to do with that certificate. From that key exchange you can compute the session keys and replace any end during the following communications.
Most implementations rarely use plain DH though, and instead only offer ephemeral DH or RSA (which are not vulnerable).
EDIT: The paper contradicts me here:
> Support for fixed DH client authentication has been very recently added to the OpenSSL 1.0.2 branch.
EDIT2: From the paper, it looks like this attack is/was practical:
> the attacker, under the hood, interferes with the connection initialization to facebook, and forces the client to use an insecure handshake with client authentication, requesting the previously installed certificate from the system.
How does facebook have these non-ephemeral DH ciphersuites?
-> from the paper, the server doesn't even need to use a static DH ciphersuite. If it has an ECDSA certificate, and didn't specify that it's only to be used to sign then you can use it for the attack (the keyUsage field in the certificate is apparently never used correctly, the few values listed in this RFC[1] tell you how to correctly limit the authorized usages of your public key)
How can you trigger the client to use this ciphersuite?
-> just reply with a serverHello only displaying static ECDH in its ciphersuite list (contrarily to ECDHE, notice the last E for ephemeral). Then show the real ECDSA certificate (the client will interpret that as a ECDH cert because of the fake ciphersuites) and then ask the client for the specific cert you know the private key of.
In addition to the ECDSA -> ECDH trumpery, this is all possible because none of these messages are signed at that moment. They are later authenticated via the shared secret, but it is too late =) I don't know if TLS 1.3 is doing better in this regard.
It also seems to me that in the attack, instead of installing a client cert you could just install a CA cert and MITM ALL TLS connections. (Except the pinned ones.) But then, this attack is more sneaky, and it's another way of doing exactly this.
Damn I ended up writing way too much :|
[1]: https://tools.ietf.org/html/rfc3280#section-4.2.1.3 https://tools.ietf.org/html/rfc3280#section-4.2.1.3
- lucb1e 10y agoGreat explanation, that cleared the whole thing up. Thank you!