In relation to ACKs for KeyUpdate messages, DTLS 1.3 Draft 37 states:
Although KeyUpdate MUST be acknowledged, it is possible for the ACK
to be lost, in which case the sender of the KeyUpdate will retransmit
it. Implementations MUST retain the ability to ACK the KeyUpdate for
up to 2MSL. It is RECOMMENDED that they do so by retaining the pre-
update keying material, but they MAY do so by responding to messages
which appear to be out-of-epoch with a canned ACK message; in this
case, implementations SHOULD rate limit how often they send such
ACKs.
This seems to allow implementations to remove old incoming keys immediately
after ACKing the KeyUpdate, which appears to open the door for the following
situation leading to deadlock:
+-------------------------+
| KeyUpdate, epoch N |-------------> received
+-------------------------+
+------------------------+
lost x-----| ACK, epoch M |
+------------------------+
[ new incoming epoch N+1,
remove keys for epoch N ]
- +------------------------+
received <-------------| KeyUpdate, epoch M |
+------------------------+
+-------------------------+
| ACK, epoch N |-------[ irrelevant whether it goes through - see
below ]
+-------------------------+
[ new incoming epoch M+1,
remove keys for epoch M ]
Note: This isn't an entirely unlikely situation, since a KeyUpdate with
update_requested flag
will result in a subsequent KeyUpdate from the other side, and the only unlucky
thing that
needs to happen is for the original ACK to be lost while both KeyUpdate
messages go through.
At this point, both sides have updated their incoming key material but
not their outgoing key material, since they're still awaiting the ACK -
however, it turns out that they can't actually read those ACKs anymore:
After some time, the peers resend the KeyUpdate messages, which will be
blindly ACKed by the peer according to the recommendation in the spec;
however, the ACKs will be encrypted with the wrong keys and cannot
be parsed on either side:
+---------------------------+
| resent KeyUpdate, epoch N |-------------> received, but can't be read
+---------------------------+ because incoming epoch N+1
send 'blind' ACK
received, but can't be read +------------------------+
because incoming epoch M+1 <--------------| ACK, epoch M |
+------------------------+
The same will happen to KeyUpdate retransmission from the other side.
It seems that this results in a deadlock. Am I missing / misunderstanding
something?
A possible mitigation would be to force retaining the old key material for 2MSL,
or alternatively, to mandate that old key material must only be removed upon
receipt and successful decryption of a message using the new keys.
IMPORTANT NOTICE: The contents of this email and any attachments are
confidential and may also be privileged. If you are not the intended recipient,
please notify the sender immediately and do not disclose the contents to any
other person, use it for any purpose, or store or copy the information in any
medium. Thank you.
_______________________________________________
TLS mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/tls