3 ms·
Side question: what about an active MITM attack which changes the ciphersuite preferences? So e.g. if I know as an attacker of a weakness in scheme X (which is
by mschuster91 13y ago
Side question: what about an active MITM attack which changes the ciphersuite preferences?
So e.g. if I know as an attacker of a weakness in scheme X (which is advertised by both server and client), but server and client would prefer scheme Y, then I'd just have to manipulate the initial handshake to include only scheme X, right?
- Nursie 13y ago>> Side question: what about an active MITM attack which changes the ciphersuite preferences? Part of the protocol involves exchanging checksums of all data passed between the server and client. Can't remember off the top of my head exactly when this takes place, but effectively the whole handshake process is fed into a hash algorithm and if they don't match then the connection won't be established. The hash itself will be protected from MITM by some sort of signing/MAC.
- mnordhoff 13y agoIt happens during the Finished messages. The OP covers the handshake about halfway down, and 72deluxe's Wikipedia link covers it nicely, too: https://en.wikipedia.org/wiki/Transport_Layer_Security#TLS_handshake https://en.wikipedia.org/wiki/Transport_Layer_Security#TLS_h... In TLS 1.0 and 1.1, the Finished message is protected by HMAC-MD5 and HMAC-SHA1. (RFC 2246, sections 5 and 7.4.9.) (By the way, while there are attacks against MD5 and SHA-1, there are no known attacks against HMAC-MD5 or HMAC-SHA1. Don't freak out.) TLS 1.1 is the same as TLS 1.0. (RFC 4346, sections 5 and 7.4.9.) For TLS 1.2, I am uncertain which algorithm is used. See RFC 5246, sections 5 and 7.4.9. It's either HMAC-SHA256 or the MAC defined by the chosen cipher suite, which would currently be one of HMAC-MD5, HMAC-SHA1, HMAC-SHA256 or HMAC-SHA384. (As long as your weakest cipher suite's MAC can't be broken in half a second, this doesn't help an attacker.) Edit: Staring at RFC 5246 a bit longer, I am almost certain that TLS 1.2 will always use HMAC-SHA256. Future cipher suites may define a different algorithm, but no such cipher suites yet exist. (Edits: This post was basically written one sentence at a time in a dozen different edits.)
- Nursie 13y ago>> In TLS 1.0 and 1.1, the Finished message is protected by HMAC-MD5 and HMAC-SHA1. (RFC 2246, sections 5 and 7.4.9.) (By the way, while there are attacks against MD5 and SHA-1, there are no known attacks against HMAC-MD5 or HMAC-SHA1. Don't freak out.) Yeah, been reading up on HMAC lately. I had to implement a MAC algorithm due to a weird failing by an embedded platform vendor. HMAC(sha256) was it, until at the last minute we switched out for iso9797 algorithm 3, pad 3* because a second vendor we have to work with couldn't support 32 byte keys. It's always a bit sad to write beautiful code and then discard it again within days... (*why yes, it is a retail application)
- PinguTS 13y agoYes, your are right. That is the weakness. That is the reason why it his highly advised to look at your supported cipher suites on the client side and disable the weak ones. Many people say: "No problem, it is anyhow a decision by the server and this side will choose a strong encryption." But the weakness here is the problem you described.
- Nursie 13y ago>> Yes, your are right. That is the weakness. That is the reason why it his highly advised to look at your supported cipher suites on the client side and disable the weak ones. You absolutely should configure all endpoints only to use adequate cipher suites, but that's simply because the bad ones shouldn't be used and as a client you don't want to rely on the server being well configured (and vice-versa). HOWEVER - that does not mean a handshake MITM is possible, the protocol accounts for this, please see my parallel reply to yours.
- PinguTS 13y agoUnfortunately, that seems not to be correct. If you read RFC4346 (TLS1.1) correctly, then you recognize that the ClientHello message is comprised of the following data: - client_version - random - session_id - cipher_suites - compression_methods There is no additional hashing involved. Some of these issues are addressed in later versions. But. And there is always a big BUT: http://f0rki.at/static/slides/f0rki-downgrade-attacks-by-example-bsidesvienna2012.pdf http://f0rki.at/static/slides/f0rki-downgrade-attacks-by-exa... I will now not got through all the published informations or talks from BlackHat, CCC, and so on. ;o)
- mnordhoff 13y agoKeep reading down to section 7.4.9. After the negotiation is finished, the client and server exchange MACs of the previous messages to be sure they weren't tampered with.
- lvh 13y agoThe verification occurs at the end of the handshake, not at the start. After all, at ClientHello, the peers haven't agreed on anything yet.