idnits 2.17.1 draft-fujiwara-dnsop-avoid-fragmentation-01.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords -- however, there's a paragraph with a matching beginning. Boilerplate error? (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The document date (September 27, 2019) is 1672 days in the past. Is this intentional? Checking references for intended status: Best Current Practice ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Downref: Normative reference to an Informational RFC: RFC 3542 ** Downref: Normative reference to an Informational RFC: RFC 7739 ** Obsolete normative reference: RFC 8499 (Obsoleted by RFC 9499) Summary: 3 errors (**), 0 flaws (~~), 2 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group K. Fujiwara 3 Internet-Draft JPRS 4 Intended status: Best Current Practice P. Vixie 5 Expires: March 30, 2020 Farsight 6 September 27, 2019 8 Avoid IP fragmentation in DNS 9 draft-fujiwara-dnsop-avoid-fragmentation-01 11 Abstract 13 Path MTU discovery remains widely undeployed due to security issues, 14 and IP fragmentation has exposed weaknesses in application protocols. 15 Currently, DNS is known to be the largest user of IP fragmentation. 16 It is possible to avoid IP fragmentation in DNS by limiting response 17 size where possible, and signaling the need to upgrade from UDP to 18 TCP transport where necessary. This document proposes to avoid IP 19 fragmentation in DNS. 21 Status of This Memo 23 This Internet-Draft is submitted in full conformance with the 24 provisions of BCP 78 and BCP 79. 26 Internet-Drafts are working documents of the Internet Engineering 27 Task Force (IETF). Note that other groups may also distribute 28 working documents as Internet-Drafts. The list of current Internet- 29 Drafts is at https://datatracker.ietf.org/drafts/current/. 31 Internet-Drafts are draft documents valid for a maximum of six months 32 and may be updated, replaced, or obsoleted by other documents at any 33 time. It is inappropriate to use Internet-Drafts as reference 34 material or to cite them other than as "work in progress." 36 This Internet-Draft will expire on March 30, 2020. 38 Copyright Notice 40 Copyright (c) 2019 IETF Trust and the persons identified as the 41 document authors. All rights reserved. 43 This document is subject to BCP 78 and the IETF Trust's Legal 44 Provisions Relating to IETF Documents 45 (https://trustee.ietf.org/license-info) in effect on the date of 46 publication of this document. Please review these documents 47 carefully, as they describe your rights and restrictions with respect 48 to this document. Code Components extracted from this document must 49 include Simplified BSD License text as described in Section 4.e of 50 the Trust Legal Provisions and are provided without warranty as 51 described in the Simplified BSD License. 53 Table of Contents 55 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 56 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 57 3. Proposal to avoid IP fragmentation in DNS . . . . . . . . . . 3 58 4. Default maximum DNS/UDP payload size . . . . . . . . . . . . 4 59 5. Incremental deployment . . . . . . . . . . . . . . . . . . . 5 60 6. Request to zone operator . . . . . . . . . . . . . . . . . . 5 61 7. Considerations . . . . . . . . . . . . . . . . . . . . . . . 5 62 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5 63 9. Security Considerations . . . . . . . . . . . . . . . . . . . 5 64 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 5 65 10.1. Normative References . . . . . . . . . . . . . . . . . . 5 66 10.2. Informative References . . . . . . . . . . . . . . . . . 6 67 Appendix A. How to retrieve path MTU value to a destination . . 7 68 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 7 70 1. Introduction 72 DNS has EDNS0 [RFC6891] mechanism. It enables that DNS server can 73 send large size response using UDP. Now EDNS0 is widely deployed, 74 and DNS (over UDP) is said to be the biggest user of IP 75 fragmentation. 77 However, "Fragmentation Considered Poisonous" [Herzberg2013] proposed 78 effective off-path DNS cache poisoning attack vectors using IP 79 fragmentation. "IP fragmentation attack on DNS" [Hlavacek2013] and 80 "Domain Validation++ For MitM-Resilient PKI" [Brandt2018] proposed 81 that off-path attackers can intervene in path MTU discovery [RFC1191] 82 to perform intentionally fragmented responses from authoritative 83 servers. [RFC7739] stated security implications of predictable 84 fragment identification values. 86 And more, Section 3.2 Message Side Guidelines of UDP Usage Guidelines 87 [RFC8085] specifies that an application SHOULD NOT send UDP datagrams 88 that result in IP packets that exceed the Maximum Transmission Unit 89 (MTU) along the path to the destination. 91 As a result, we cannot trust fragmented UDP packets, primarily due to 92 the low level of entropy provided by UDP port numbers and DNS message 93 identifiers, each of which being 16 bits in size. By comparison, TCP 94 is considered resistant against IP fragmentation attacks because TCP 95 has a 32-bit sequence number and 32-bit acknowledgement number in 96 each segment. 98 This document proposes to avoid IP fragmentation in DNS/UDP. 100 2. Terminology 102 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 103 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 104 "OPTIONAL" in this document are to be interpreted as described in 105 BCP14 [RFC2119] [RFC8174] when, and only when, they appear in all 106 capitals, as shown here. 108 "Requestor" refers to the side that sends a request. "Responder" 109 refers to an authoritative, recursive resolver or other DNS component 110 that responds to questions. (Quoted from EDNS0 [RFC6891]) 112 "path MTU" is the minimum link MTU of all the links in a path between 113 a source node and a destination node. (Quoted from [RFC8201]) 115 Many of the specialized terms used in this document are defined in 116 DNS Terminology [RFC8499]. 118 3. Proposal to avoid IP fragmentation in DNS 120 TCP avoids fragmentation using its Maximum Segment Size (MSS) 121 parameter, but each transmitted segment is header-size aware such 122 that the size of the IP and TCP headers is known, as well as the far 123 end's MSS parameter and the interface or path MTU, in order to send a 124 smaller segment as necessary to keep the each IP datagram below a 125 target size. TCP's packetizing process is also elastic as to how 126 much queued data will fit into the next segment. DNS has no message 127 size elasticity and lacks insight into IP header and option size, and 128 so must make more conservative estimates about available UDP payload 129 space. 131 The minimum MTU for an IPv4 interface is 576 octets, and for an IPv6 132 interface, 1280 octets. These are theoretic limits and no modern 133 networks implement them. In practice, the smallest MTU witnessed in 134 the operational DNS community is 1500 octets, the Ethernet maximum 135 payload size. While many networks such as Packet on SONET (PoS), 136 Fiber Distributed Data Exchange (FDDI), and Ethernet Jumbo Frame, 137 there is no reliable way of discovering such links in an IP 138 transmission path. Absent some kind of path MTU discovery result or 139 a static configuration by the server or system operator, a 140 conservative estimate must be chosen, even if less efficient. 142 The methods to avoid IP fragmentation in DNS are described below: 144 o UDP requestors and responders SHOULD send DNS responses with 145 IP_DONTFRAG / IPV6_DONTFRAG [RFC3542] options, which will yield 146 either a silent timeout, or a network (ICMP) error, if the path 147 MTU is exceeded. Upon a timeout, UDP requestors may retry using 148 TCP or UDP, per local policy. 150 o The estimated maximum DNS/UDP payload size SHOULD be the actual or 151 estimated path MTU minus the estimated header space. When actual 152 path MTU information is not available, use the default maximum 153 DNS/UDP payload size described in following section. 155 o The maximum buffer size offered by an EDNS0 requestor SHOULD be no 156 larger than the estimated maximum DNS/UDP payload size. If the 157 response cannot be reasonably expected fit into a buffer of that 158 size, TCP should be used instead of UDP. 160 o Responders SHOULD compose UDP responses that result in IP packets 161 that do not exceed the path MTU to the requestor. Thus, if the 162 requestor offers a buffer size larger than estimated maximum DNS/ 163 UDP payload size, then the responder will behave as though the 164 requestor had specified a buffer size equal to the estimated 165 maximum DNS/UDP payload size. 167 o Fragmented DNS/UDP messages may be dropped before IP assembly. An 168 ICMP error should should be sent in this case, with rate limiting 169 to prevent this logic from becoming a DDoS amplification vector. 170 If rate limiting is not possible, then no ICMP error should be 171 sent. (This is a countermeasure against DNS spoofing attacks 172 using IP fragmentation.) 174 The cause and effect of the TC bit is unchanged from EDNS0 [RFC6891]. 176 4. Default maximum DNS/UDP payload size 178 o [RFC4035] defines that "A security-aware name server MUST support 179 the EDNS0 message size extension, MUST support a message size of 180 at least 1220 octets". Then, the smallest number of the maximum 181 DNS/UDP payload size is 1220. 183 o However, in practice, the smallest MTU witnessed in the 184 operational DNS community is 1500 octets. The estimated size of a 185 DNS message's UDP headers, IP headers, IP options, and one or more 186 set of tunnel, IP-in-IP, VLAN, and virtual circuit headers, SHOULD 187 be 100 octets. Then, the maximum DNS/UDP payload size may be 188 1400. 190 5. Incremental deployment 192 The proposed method supports incremental deployment. 194 When a full-service resolver implements the proposed method, the 195 full-service resolver becomes to avoid IP fragmentation in DNS. 197 When an authoritative server implements the proposed method, the 198 authoritative server becomes to avoid IP fragmentation in DNS. 200 6. Request to zone operator 202 Fat DNS responses come from fat configurations of zones. Zone 203 operator SHOULD consider small response size configurations. For 204 example, 206 o Use smaller number of name servers (13 may be too large) 208 o Use smaller number of A/AAAA RRs for a domain name 210 o Use smaller signature / public key size algorithm for DNSSEC. 211 Signature size of ECDSA or EdDSA is smaller than RSA. 213 7. Considerations 215 In past researches ([Fujiwara2018] / dns-operations mailing list 216 discussions), there are some authoritative servers that ignore EDNS0 217 requestor's UDP payload size, and return large UDP responses. 219 And it is known that there are some authoritative servers that do not 220 support TCP transport. 222 8. IANA Considerations 224 This document has no IANA actions. 226 9. Security Considerations 228 10. References 230 10.1. Normative References 232 [RFC1191] Mogul, J. and S. Deering, "Path MTU discovery", RFC 1191, 233 DOI 10.17487/RFC1191, November 1990, 234 . 236 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 237 Requirement Levels", BCP 14, RFC 2119, 238 DOI 10.17487/RFC2119, March 1997, 239 . 241 [RFC3542] Stevens, W., Thomas, M., Nordmark, E., and T. Jinmei, 242 "Advanced Sockets Application Program Interface (API) for 243 IPv6", RFC 3542, DOI 10.17487/RFC3542, May 2003, 244 . 246 [RFC4035] Arends, R., Austein, R., Larson, M., Massey, D., and S. 247 Rose, "Protocol Modifications for the DNS Security 248 Extensions", RFC 4035, DOI 10.17487/RFC4035, March 2005, 249 . 251 [RFC6891] Damas, J., Graff, M., and P. Vixie, "Extension Mechanisms 252 for DNS (EDNS(0))", STD 75, RFC 6891, 253 DOI 10.17487/RFC6891, April 2013, 254 . 256 [RFC7739] Gont, F., "Security Implications of Predictable Fragment 257 Identification Values", RFC 7739, DOI 10.17487/RFC7739, 258 February 2016, . 260 [RFC8085] Eggert, L., Fairhurst, G., and G. Shepherd, "UDP Usage 261 Guidelines", BCP 145, RFC 8085, DOI 10.17487/RFC8085, 262 March 2017, . 264 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 265 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 266 May 2017, . 268 [RFC8201] McCann, J., Deering, S., Mogul, J., and R. Hinden, Ed., 269 "Path MTU Discovery for IP version 6", STD 87, RFC 8201, 270 DOI 10.17487/RFC8201, July 2017, 271 . 273 [RFC8499] Hoffman, P., Sullivan, A., and K. Fujiwara, "DNS 274 Terminology", BCP 219, RFC 8499, DOI 10.17487/RFC8499, 275 January 2019, . 277 10.2. Informative References 279 [Brandt2018] 280 Brandt, M., Dai, T., Klein, A., Shulman, H., and M. 281 Waidner, "Domain Validation++ For MitM-Resilient PKI", 282 Proceedings of the 2018 ACM SIGSAC Conference on Computer 283 and Communications Security , 2018. 285 [Fujiwara2018] 286 Fujiwara, K., "Measures against cache poisoning attacks 287 using IP fragmentation in DNS", OARC 30 Workshop , 2019. 289 [Herzberg2013] 290 Herzberg, A. and H. Shulman, "Fragmentation Considered 291 Poisonous", IEEE Conference on Communications and Network 292 Security , 2013. 294 [Hlavacek2013] 295 Hlavacek, T., "IP fragmentation attack on DNS", RIPE 67 296 Meeting , 2013, . 299 Appendix A. How to retrieve path MTU value to a destination 301 Socket options: "IP_MTU (since Linux 2.2) Retrieve the current known 302 path MTU of the current socket. Valid only when the socket has been 303 connected. Returns an integer. Only valid as a getsockopt(2)." 304 (Quoted from Debian GNU Linux manual: man 7 ip) 306 "IPV6_MTU getsockopt(): Retrieve the current known path MTU of the 307 current socket. Only valid when the socket has been connected. 308 Returns an integer." (Quoted from Debian GNU Linux manual: man 7 309 ipv6) 311 Authors' Addresses 313 Kazunori Fujiwara 314 Japan Registry Services Co., Ltd. 315 Chiyoda First Bldg. East 13F, 3-8-1 Nishi-Kanda 316 Chiyoda-ku, Tokyo 101-0065 317 Japan 319 Phone: +81 3 5215 8451 320 Email: fujiwara@jprs.co.jp 322 Paul Vixie 323 Farsight Security Inc 324 177 Bovet Road, Suite 180 325 San Mateo, CA 94402 327 Phone: +1 650 393 3994 328 Email: paul@redbarn.org