Internet-Draft | DTLS Return Routability Check | August 2023 |
Tschofenig, et al. | Expires 3 March 2024 | [Page] |
This document specifies a return routability check for use in context of the Connection ID (CID) construct for the Datagram Transport Layer Security (DTLS) protocol versions 1.2 and 1.3.¶
This note is to be removed before publishing as an RFC.¶
Discussion of this document takes place on the Transport Layer Security Working Group mailing list (tls@ietf.org), which is archived at https://mailarchive.ietf.org/arch/browse/tls/.¶
Source for this draft and an issue tracker can be found at https://github.com/tlswg/dtls-rrc.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 3 March 2024.¶
Copyright (c) 2023 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
In "classical" DTLS, selecting a security context of an incoming DTLS record is accomplished with the help of the 5-tuple, i.e. source IP address, source port, transport protocol, destination IP address, and destination port. Changes to this 5 tuple can happen for a variety reasons over the lifetime of the DTLS session. In the IoT context, NAT rebinding is common with sleepy devices. Other examples include end host mobility and multi-homing. Without CID, if the source IP address and/or source port changes during the lifetime of an ongoing DTLS session then the receiver will be unable to locate the correct security context. As a result, the DTLS handshake has to be re-run. Of course, it is not necessary to re-run the full handshake if session resumption is supported and negotiated.¶
A CID is an identifier carried in the record layer header of a DTLS datagram that gives the receiver additional information for selecting the appropriate security context. The CID mechanism has been specified in [RFC9146] for DTLS 1.2 and in [RFC9147] for DTLS 1.3.¶
Section 6 of [RFC9146] describes how the use of CID increases the attack surface by providing both on-path and off-path attackers an opportunity for (D)DoS. It then goes on describing the steps a DTLS principal must take when a record with a CID is received that has a source address (and/or port) different from the one currently associated with the DTLS connection. However, the actual mechanism for ensuring that the new peer address is willing to receive and process DTLS records is left open. This document standardizes a return routability check (RRC) as part of the DTLS protocol itself.¶
The return routability check is performed by the receiving peer before the CID-to-IP address/port binding is updated in that peer's session state database. This is done in order to provide more confidence to the receiving peer that the sending peer is reachable at the indicated address and port.¶
Note however that, irrespective of CID, if RRC has been successfully negotiated by the peers, path validation can be used at any time by either endpoint. For instance, an endpoint might use RRC to check that a peer is still in possession of its address after a period of quiescence.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
This document assumes familiarity with the CID format and protocol defined for DTLS 1.2 [RFC9146] and for DTLS 1.3 [RFC9147]. The presentation language used in this document is described in Section 4 of [RFC8446].¶
This document reuses the definition of "anti-amplification limit" from [RFC9000] to mean three times the amount of data received from an unvalidated address. This includes all DTLS records originating from that source address, excluding discarded ones.¶
The use of RRC is negotiated via the rrc
DTLS-only extension. On connecting,
the client includes the rrc
extension in its ClientHello if it wishes to use
RRC. If the server is capable of meeting this requirement, it responds with a
rrc
extension in its ServerHello. The extension_type
value for this
extension is TBD1 and the extension_data
field of this extension is empty.
The client and server MUST NOT use RRC unless both sides have successfully
exchanged rrc
extensions.¶
Note that the RRC extension applies to both DTLS 1.2 and DTLS 1.3.¶
This document defines the return_routability_check
content type
(Figure 1) to carry Return Routability Check protocol messages.¶
The protocol consists of three message types: path_challenge
, path_response
and path_drop
that are used for path validation and selection as described in
Section 7.¶
Each message carries a Cookie, a 8-byte field containing arbitrary data.¶
The return_routability_check
message MUST be authenticated and encrypted
using the currently active security context.¶
Future extensions or additions to the Return Routability Check protocol may
define new message types. Implementations MUST be able to parse and ignore
messages with an unknown msg_type
.¶
RRC offers an in-protocol mechanism to perform peer address validation that complements the "peer address update" procedure described in Section 6 of [RFC9146]. Specifically, when both CID [RFC9146] and RRC have been successfully negotiated for the session, if a record with CID is received that has the source address of the enclosing UDP datagram different from the one currently associated with that CID value, the receiver SHOULD perform a return routability check as described in Section 7, unless an application layer specific address validation mechanism can be triggered instead.¶
We define two classes of attackers, off-path and on-path, with increasing capabilities (see Figure 2) partly following terminology introduced in QUIC [RFC9000]:¶
Note that in general, attackers cannot craft DTLS records in a way that would successfully pass verification due to the cryptographic protections applied by the DTLS record layer.¶
RRC is designed to defend against the following attacks:¶
Both on-path and off-path attackers can send a packet (either by modifying it on the fly, or by copying, injecting and racing it, respectively) with the source address modified to that of a victim host. If the traffic generated by the server in response is larger compared to the received packet (e.g., a CoAP server returning an MTU's worth of data from a 20-bytes GET request) the attacker can use the server as a traffic amplifier toward the victim.¶
When receiving a packet with a known CID and a spoofed source address, an
RRC-capable endpoint will not send a (potentially large) response but instead a
small path_challenge
message to the victim host. Since the host is not able
to decrypt it and generate a valid path_response
, the address validation
fails, which in turn keeps the original address binding unaltered.¶
Note that in case of an off-path attacker, the original packet still reaches the intended destination; therefore, an implementation could use a different strategy to mitigate the attack.¶
An off-path attacker that can observe packets might forward copies of genuine packets to endpoints over a different path. If the copied packet arrives before the genuine packet, this will appear as a path change, like in a genuine NAT rebinding occurrence. Any genuine packet will be discarded as a duplicate. If the attacker is able to continue forwarding packets, it might be able to cause migration to a path via the attacker. This places the attacker on-path, giving it the ability to observe or drop all subsequent packets.¶
This style of attack relies on the attacker using a path that has the same or better characteristics (e.g., due to a more favourable service level agreements) as the direct path between endpoints. The attack is more reliable if relatively few packets are sent or if packet loss coincides with the attempted attack.¶
A data packet received on the original path that increases the maximum received packet number will cause the endpoint to move back to that path. Therefore, eliciting packets on this path increases the likelihood that the attack is unsuccessful. Note however that, unlike QUIC, DTLS has no "non-probing" packets so this would require application specific mechanisms.¶
Figure 3 illustrates the case where a receiver receives a
packet with a new source IP address and/or new port number. In order
to determine whether this path change was not triggered
by an off-path attacker, the receiver will send a RRC message of type
path_challenge
(1) on the old path.¶
Three cases need to be considered:¶
Case 1: The old path is dead (e.g., due to a NAT rebinding), which leads to a timeout of (1).¶
As shown in Figure 4, a path_challenge
(2) needs to be sent on
the new path. If the sender replies with a path_response
on the new path
(3), the switch to the new path is considered legitimate.¶
Case 2: The old path is alive but not preferred.¶
This case is shown in Figure 5 whereby the sender
replies with a path_drop
message (2) on the old path. This triggers
the receiver to send a path_challenge
(3) on the new path. The sender
will reply with a path_response
(4) on the new path, thus providing
confirmation for the path migration.¶
Case 3: The old path is alive and preferred.¶
This is most likely the result of an off-path attacker trying to place itself
on path. The receiver sends a path_challenge
on the old path and the sender
replies with a path_response
(2) on the old path. The interaction is shown in
Figure 6. This results in the connection not being migrated
to the new path, thus thwarting the attack.¶
Note that this defense is imperfect, but this is not considered a serious problem. If the path via the attack is reliably faster than the old path despite multiple attempts to use that old path, it is not possible to distinguish between an attack and an improvement in routing.¶
An endpoint could also use heuristics to improve detection of this style of attack. For instance, NAT rebinding is improbable if packets were recently received on the old path; similarly, rebinding is rare on IPv6 paths. Endpoints can also look for duplicated packets. Conversely, a change in connection ID is more likely to indicate an intentional migration rather than an attack. Note that changes in connection IDs are supported in DTLS 1.3 but not in DTLS 1.2.¶
The receiver that observes the peer's address or port update MUST stop sending any buffered application data, or limit the data sent to the unvalidated address to the anti-amplification limit.¶
It then initiates the return routability check that proceeds as described either in Section 7.2 or Section 7.1, depending on whether the off-path attacker scenario described in Section 6.2 is to be taken into account or not.¶
(The decision on what strategy to choose depends mainly on the threat model, but may also be influenced by other considerations. Examples of impacting factors include: the need to minimise implementation complexity, privacy concerns, the need to reduce the time it takes to switch path. The choice may be offered as a configuration option to the user.)¶
After the path validation procedure is completed, any pending send operation is resumed to the bound peer address.¶
Section 7.3 and Section 7.4 list the requirements for the initiator and responder roles, broken down per protocol phase.¶
return_routability_check
message of
type path_challenge
and places the unpredictable cookie into the message.¶
return_routability_check
message of
type path_challenge
and responds by echoing the cookie value in a
return_routability_check
message of type path_response
.¶
return_routability_check
message of type path_response
and verifies that it contains the sent cookie, it updates the peer
address binding.¶
return_routability_check
message of
type path_challenge
and places the unpredictable cookie into the message.¶
If the path is still functional, the peer endpoint cryptographically verifies the received
return_routability_check
message of
type path_challenge
.
The action to be taken depends on whether the path through which
the message was received is the preferred one or not anymore:¶
return_routability_check
message of type path_response
MUST be returned.¶
return_routability_check
message of type path_drop
MUST be returned.
In either case, the peer endpoint echoes the cookie value in the response.¶
The initiator receives and verifies that the return_routability_check
message contains the previously sent cookie. The actions taken by the
initiator differ based on the received message:¶
return_routability_check
message of type path_response
was received,
the initiator MUST continue using the previously valid address, i.e. no switch
to the new path takes place and the peer address binding is not updated.¶
return_routability_check
message of type path_drop
was received,
the initiator MUST perform a return routability check on the observed new
address, as described in Section 7.1.¶
The initiator MAY send multiple return_routability_check
messages of type
path_challenge
to cater for packet loss on the probed path.¶
path_challenge
SHOULD go into different transport packets. (Note that
the DTLS implementation may not have control over the packetization done by
the transport layer.)¶
path_challenge
messages SHOULD be paced to
decrease the chance of loss.¶
path_challenge
message MUST contain random data.¶
path_response
or
path_drop
messages.¶
path_response
or path_drop
message
for each received path_challenge
.¶
path_response
or the path_drop
on the path
where the corresponding path_challenge
has been received, so that validation
succeeds only if the path is functional in both directions. The initiator
MUST NOT enforce this behaviour.¶
path_response
or
path_drop
it receives.¶
Note that RRC does not cater for PMTU discovery on the reverse path. If the responder wants to do PMTU discovery using RRC, it should initiate a new path validation procedure.¶
When setting T, implementations are cautioned that the new path could have a longer round-trip time (RTT) than the original.¶
In settings where there is external information about the RTT of the active path, implementations SHOULD use T = 3xRTT.¶
If an implementation has no way to obtain information regarding the RTT of the active path, T SHOULD be set to 1s.¶
Profiles for specific deployment environments -- for example, constrained networks [I-D.ietf-uta-tls13-iot-profile] -- MAY specify a different, more suitable value.¶
In the example TLS 1.3 handshake shown in Figure 7, a client and a server successfully negotiate support for CID as well as the RRC extension.¶
Once a connection has been established the client and the server exchange application payloads protected by DTLS with a unilaterally used CID. In our case, the client is requested to use CID 100 for records sent to the server.¶
At some point in the communication interaction the IP address used by the client changes and, thanks to the CID usage, the security context to interpret the record is successfully located by the server. However, the server wants to test the reachability of the client at its new IP address.¶
Figure 8 shows the server initiating a "basic" RRC exchange (see Section 7.1) that establishes reachability of the client at the new IP address.¶
Note that the return routability checks do not protect against flooding of third-parties if the attacker is on-path, as the attacker can redirect the return routability checks to the real peer (even if those datagrams are cryptographically authenticated). On-path adversaries can, in general, pose a harm to connectivity.¶
When using DTLS 1.3, peers SHOULD avoid using the same CID on multiple network paths, in particular when initiating connection migration or when probing a new network path, as described in Section 7, as an adversary can otherwise correlate the communication interaction across those different paths. DTLS 1.3 provides mechanisms to ensure that a new CID can always be used. In general, an endpoint should proactively send a RequestConnectionId message to ask for new CIDs as soon as the pool of spare CIDs is depleted (or goes below a threshold). Also, in case a peer might have exhausted available CIDs, a migrating endpoint could include NewConnectionId in packets sent on the new path to make sure that the subsequent path validation can use fresh CIDs.¶
Note that DTLS 1.2 does not offer the ability to request new CIDs during the session lifetime since CIDs have the same life-span of the connection. Therefore, deployments that use DTLS in multihoming environments SHOULD refuse to use CIDs with DTLS 1.2 and switch to DTLS 1.3 if the correlation privacy threat is a concern.¶
RFC Editor: please replace RFCthis with this RFC number and remove this note.¶
IANA is requested to allocate an entry to the TLS ContentType
registry, for the return_routability_check(TBD2)
message defined in
this document. The return_routability_check
content type is only
applicable to DTLS 1.2 and 1.3.¶
IANA is requested to allocate the extension code point (TBD1) for the rrc
extension to the TLS ExtensionType Values
registry as described in
Table 1.¶
Value | Extension Name | TLS 1.3 | DTLS-Only | Recommended | Reference |
---|---|---|---|---|---|
TBD1 | rrc | CH, SH | Y | N | RFCthis |
IANA is requested to create a new sub-registry for RRC Message Types in the TLS Parameters registry [IANA.tls-parameters], with the policy "expert review" [RFC8126].¶
Each entry in the registry must include:¶
A number in the range from 0 to 255 (decimal)¶
a brief description of the message¶
RRC is only available in DTLS, therefore this column will be set to Y
for
all the entries in this registry¶
a reference document¶
The initial state of this sub-registry is as follows:¶
Value | Description | DTLS-Only | Reference |
---|---|---|---|
0 | path_challenge | Y | RFCthis |
1 | path_response | Y | RFCthis |
2 | path_drop | Y | RFCthis |
3-255 | Unassigned |
Issues against this document are tracked at https://github.com/tlswg/dtls-rrc/issues¶
We would like to thank Hanno Becker, Hanno Böck, Manuel Pégourié-Gonnard, Martin Thomson, Mohit Sahni and Rich Salz for their input to this document.¶
RFC EDITOR: PLEASE REMOVE THIS SECTION¶
draft-ietf-tls-dtls-rrc-08¶
draft-ietf-tls-dtls-rrc-07¶
draft-ietf-tls-dtls-rrc-06¶
path_delete
to path_drop
(#16)¶
draft-ietf-tls-dtls-rrc-05¶
draft-ietf-tls-dtls-rrc-04¶
draft-ietf-tls-dtls-rrc-03¶
draft-ietf-tls-dtls-rrc-02¶
draft-ietf-tls-dtls-rrc-01¶
Revamp message layout:¶
draft-ietf-tls-dtls-rrc-00¶
draft-tschofenig-tls-dtls-rrc-01¶
draft-tschofenig-tls-dtls-rrc-00¶