idnits 2.17.1 draft-ietf-tcpm-icmp-attacks-10.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** You're using the IETF Trust Provisions' Section 6.b License Notice from 12 Sep 2009 rather than the newer Notice from 28 Dec 2009. (See https://trustee.ietf.org/license-info/) 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 : ---------------------------------------------------------------------------- == There are 1 instance of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document seems to contain a disclaimer for pre-RFC5378 work, and may have content which was first submitted before 10 November 2008. The disclaimer is necessary when there are original authors that you have been unable to contact, or if some do not wish to grant the BCP78 rights to the IETF Trust. If you are able to get all authors (current and original) to grant those rights, you can and should remove the disclaimer; otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (January 30, 2010) is 5199 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- ** Obsolete normative reference: RFC 793 (Obsoleted by RFC 9293) ** Obsolete normative reference: RFC 1981 (Obsoleted by RFC 8201) ** Obsolete normative reference: RFC 2460 (Obsoleted by RFC 8200) == Outdated reference: A later version (-11) exists of draft-ietf-tcpm-tcp-auth-opt-08 == Outdated reference: A later version (-03) exists of draft-ietf-tcpm-tcp-security-00 == Outdated reference: A later version (-13) exists of draft-ietf-tcpm-tcpsecure-12 == Outdated reference: A later version (-09) exists of draft-ietf-tsvwg-port-randomization-05 -- Obsolete informational reference (is this intentional?): RFC 816 (Obsoleted by RFC 7805) -- Obsolete informational reference (is this intentional?): RFC 1323 (Obsoleted by RFC 7323) -- Obsolete informational reference (is this intentional?): RFC 2385 (Obsoleted by RFC 5925) -- Obsolete informational reference (is this intentional?): RFC 2616 (Obsoleted by RFC 7230, RFC 7231, RFC 7232, RFC 7233, RFC 7234, RFC 7235) Summary: 4 errors (**), 0 flaws (~~), 6 warnings (==), 6 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 TCP Maintenance and Minor F. Gont 3 Extensions (tcpm) UTN/FRH 4 Internet-Draft January 30, 2010 5 Intended status: Informational 6 Expires: August 3, 2010 8 ICMP attacks against TCP 9 draft-ietf-tcpm-icmp-attacks-10.txt 11 Abstract 13 This document discusses the use of the Internet Control Message 14 Protocol (ICMP) to perform a variety of attacks against the 15 Transmission Control Protocol (TCP). Additionally, describes a 16 number of widely implemented modifications to TCP's handling of ICMP 17 error messages that help to mitigate these issues. 19 Status of this Memo 21 This Internet-Draft is submitted to IETF in full conformance with the 22 provisions of BCP 78 and BCP 79. 24 Internet-Drafts are working documents of the Internet Engineering 25 Task Force (IETF), its areas, and its working groups. Note that 26 other groups may also distribute working documents as Internet- 27 Drafts. 29 Internet-Drafts are draft documents valid for a maximum of six months 30 and may be updated, replaced, or obsoleted by other documents at any 31 time. It is inappropriate to use Internet-Drafts as reference 32 material or to cite them other than as "work in progress." 34 The list of current Internet-Drafts can be accessed at 35 http://www.ietf.org/ietf/1id-abstracts.txt. 37 The list of Internet-Draft Shadow Directories can be accessed at 38 http://www.ietf.org/shadow.html. 40 This Internet-Draft will expire on August 3, 2010. 42 Copyright Notice 44 Copyright (c) 2010 IETF Trust and the persons identified as the 45 document authors. All rights reserved. 47 This document is subject to BCP 78 and the IETF Trust's Legal 48 Provisions Relating to IETF Documents 49 (http://trustee.ietf.org/license-info) in effect on the date of 50 publication of this document. Please review these documents 51 carefully, as they describe your rights and restrictions with respect 52 to this document. Code Components extracted from this document must 53 include Simplified BSD License text as described in Section 4.e of 54 the Trust Legal Provisions and are provided without warranty as 55 described in the BSD License. 57 This document may contain material from IETF Documents or IETF 58 Contributions published or made publicly available before November 59 10, 2008. The person(s) controlling the copyright in some of this 60 material may not have granted the IETF Trust the right to allow 61 modifications of such material outside the IETF Standards Process. 62 Without obtaining an adequate license from the person(s) controlling 63 the copyright in such materials, this document may not be modified 64 outside the IETF Standards Process, and derivative works of it may 65 not be created outside the IETF Standards Process, except to format 66 it for publication as an RFC or to translate it into languages other 67 than English. 69 Table of Contents 71 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 72 2. Background . . . . . . . . . . . . . . . . . . . . . . . . . . 5 73 2.1. The Internet Control Message Protocol (ICMP) . . . . . . . 5 74 2.1.1. ICMP for IP version 4 (ICMP) . . . . . . . . . . . . . 5 75 2.1.2. ICMP for IP version 6 (ICMPv6) . . . . . . . . . . . . 6 76 2.2. Handling of ICMP error messages . . . . . . . . . . . . . 6 77 2.3. Handling of ICMP error messages in the context of IPsec . 7 78 3. Constraints in the possible solutions . . . . . . . . . . . . 8 79 4. General counter-measures against ICMP attacks . . . . . . . . 10 80 4.1. TCP sequence number checking . . . . . . . . . . . . . . . 10 81 4.2. Port randomization . . . . . . . . . . . . . . . . . . . . 11 82 4.3. Filtering ICMP error messages based on the ICMP payload . 11 83 5. Blind connection-reset attack . . . . . . . . . . . . . . . . 12 84 5.1. Description . . . . . . . . . . . . . . . . . . . . . . . 12 85 5.2. Attack-specific counter-measures . . . . . . . . . . . . . 13 86 6. Blind throughput-reduction attack . . . . . . . . . . . . . . 15 87 6.1. Description . . . . . . . . . . . . . . . . . . . . . . . 15 88 6.2. Attack-specific counter-measures . . . . . . . . . . . . . 16 89 7. Blind performance-degrading attack . . . . . . . . . . . . . . 16 90 7.1. Description . . . . . . . . . . . . . . . . . . . . . . . 16 91 7.2. Attack-specific counter-measures . . . . . . . . . . . . . 18 92 7.3. The counter-measure for the PMTUD attack in action . . . . 21 93 7.3.1. Normal operation for bulk transfers . . . . . . . . . 22 94 7.3.2. Operation during Path-MTU changes . . . . . . . . . . 23 95 7.3.3. Idle connection being attacked . . . . . . . . . . . . 24 96 7.3.4. Active connection being attacked after discovery 97 of the Path-MTU . . . . . . . . . . . . . . . . . . . 25 98 7.3.5. TCP peer attacked when sending small packets just 99 after the three-way handshake . . . . . . . . . . . . 26 100 7.4. Pseudo-code for the counter-measure for the blind 101 performance-degrading attack . . . . . . . . . . . . . . . 27 102 8. Security Considerations . . . . . . . . . . . . . . . . . . . 30 103 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 31 104 10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 31 105 11. References . . . . . . . . . . . . . . . . . . . . . . . . . . 32 106 11.1. Normative References . . . . . . . . . . . . . . . . . . . 32 107 11.2. Informative References . . . . . . . . . . . . . . . . . . 33 108 Appendix A. Changes from previous versions of the draft (to 109 be removed by the RFC Editor before publishing 110 this document as an RFC) . . . . . . . . . . . . . . 35 111 A.1. Changes from draft-ietf-tcpm-icmp-attacks-09 . . . . . . . 35 112 A.2. Changes from draft-ietf-tcpm-icmp-attacks-08 . . . . . . . 36 113 A.3. Changes from draft-ietf-tcpm-icmp-attacks-07 . . . . . . . 36 114 A.4. Changes from draft-ietf-tcpm-icmp-attacks-06 . . . . . . . 36 115 A.5. Changes from draft-ietf-tcpm-icmp-attacks-05 . . . . . . . 36 116 A.6. Changes from draft-ietf-tcpm-icmp-attacks-04 . . . . . . . 36 117 A.7. Changes from draft-ietf-tcpm-icmp-attacks-03 . . . . . . . 36 118 A.8. Changes from draft-ietf-tcpm-icmp-attacks-02 . . . . . . . 36 119 A.9. Changes from draft-ietf-tcpm-icmp-attacks-01 . . . . . . . 37 120 A.10. Changes from draft-ietf-tcpm-icmp-attacks-00 . . . . . . . 37 121 A.11. Changes from draft-gont-tcpm-icmp-attacks-05 . . . . . . . 37 122 A.12. Changes from draft-gont-tcpm-icmp-attacks-04 . . . . . . . 38 123 A.13. Changes from draft-gont-tcpm-icmp-attacks-03 . . . . . . . 38 124 A.14. Changes from draft-gont-tcpm-icmp-attacks-02 . . . . . . . 38 125 A.15. Changes from draft-gont-tcpm-icmp-attacks-01 . . . . . . . 39 126 A.16. Changes from draft-gont-tcpm-icmp-attacks-00 . . . . . . . 39 127 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 39 129 1. Introduction 131 ICMP [RFC0792] is a fundamental part of the TCP/IP protocol suite, 132 and is used mainly for reporting network error conditions. However, 133 the current specifications do not recommend any kind of validation 134 checks on the received ICMP error messages, thus allowing variety of 135 attacks against TCP [RFC0793] by means of ICMP, which include blind 136 connection-reset, blind throughput-reduction, and blind performance- 137 degrading attacks. All of these attacks can be performed even being 138 off-path, without the need to sniff the packets that correspond to 139 the attacked TCP connection. 141 While the possible security implications of ICMP have been known in 142 the research community for a long time, there has never been an 143 official proposal on how to deal with these vulnerabilities. In 144 2005, a disclosure process was carried out by the UK's National 145 Infrastructure Security Co-ordination Centre (NISCC) (now CPNI, 146 Centre for the Protection of National Infrastructure), with the 147 collaboration of other computer emergency response teams. A large 148 number of implementations were found vulnerable to either all or a 149 subset of the attacks discussed in this document [NISCC][US-CERT]. 150 The affected systems ranged from TCP/IP implementations meant for 151 desktop computers, to TCP/IP implementations meant for core Internet 152 routers. 154 It is clear that implementations should be more cautious when 155 processing ICMP error messages, to eliminate or mitigate the use of 156 ICMP to perform attacks against TCP [RFC4907]. 158 This document aims to raise awareness of the use of ICMP to perform a 159 variety of attacks against TCP, and discusses several counter- 160 measures that eliminate or minimize the impact of these attacks. 161 Most of the these counter-measures can be implemented while still 162 remaining compliant with the current specifications, as they simply 163 describe reasons for not taking the advice provided in the 164 specifications in terms of "SHOULDs", but still comply with the 165 requirements stated as "MUSTs". 167 We note that the counter-measures discussed in this document are not 168 part of standard TCP behavior and this document does not change that 169 state of affairs. The consensus of the TCPM WG (TCP Maintenance and 170 Minor Extensions Working Group) was to document this widespread 171 implementation of nonstandard TCP behavior but to not change the TCP 172 standard. 174 Section 2 provides background information on ICMP. Section 3 175 discusses the constraints in the general counter-measures that can be 176 implemented against the attacks described in this document. 178 Section 4 describes several general validation checks that can be 179 implemented to mitigate any ICMP-based attack. Finally, Section 5, 180 Section 6, and Section 7, discuss a variety of ICMP attacks that can 181 be performed against TCP, and describe attack-specific counter- 182 measures that eliminate or greatly mitigate their impact. 184 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 185 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 186 document are to be interpreted as described in RFC 2119 [RFC2119]. 188 2. Background 190 2.1. The Internet Control Message Protocol (ICMP) 192 The Internet Control Message Protocol (ICMP) is used in the Internet 193 architecture mainly to perform the fault-isolation function, that is, 194 the group of actions that hosts and routers take to determine that 195 there is some network failure [RFC0816]. 197 When an intermediate router detects a network problem while trying to 198 forward an IP packet, it will usually send an ICMP error message to 199 the source system, to inform about the network problem taking place. 200 In the same way, there are a number of scenarios in which an end- 201 system may generate an ICMP error message if it finds a problem while 202 processing a datagram. The received ICMP errors are handed to the 203 corresponding transport-protocol instance, which will usually perform 204 a fault recovery function. 206 It is important to note that ICMP error messages are transmitted 207 unreliably, and may be discarded due to data corruption, network 208 congestion or rate-limiting. Thus, while they provide useful 209 information, upper layer protocols cannot depend on ICMP for correct 210 operation. 212 It should be noted that are no timeliness requirements for ICMP error 213 messages. ICMP error messages could be delayed for various reasons, 214 and at least in theory could be received with an arbitrarily long 215 delay. For example, there are no existing requirements that a router 216 flushes any queued ICMP error messages when it is rebooted. 218 2.1.1. ICMP for IP version 4 (ICMP) 220 [RFC0792] specifies the Internet Control Message Protocol (ICMP) to 221 be used with the Internet Protocol version 4 (IPv4). It defines, 222 among other things, a number of error messages that can be used by 223 end-systems and intermediate systems to report errors to the sending 224 system. The Host Requirements RFC [RFC1122] classifies ICMP error 225 messages into those that indicate "soft errors", and those that 226 indicate "hard errors", thus roughly defining the semantics of them. 228 The ICMP specification [RFC0792] also defines the ICMP Source Quench 229 message (type 4, code 0), which is meant to provide a mechanism for 230 flow control and congestion control. 232 [RFC1191] defines a mechanism called "Path MTU Discovery" (PMTUD), 233 which makes use of ICMP error messages of type 3 (Destination 234 Unreachable), code 4 (fragmentation needed and DF bit set) to allow 235 systems to determine the MTU of an arbitrary internet path. 237 Finally, [RFC4884] redefines selected ICMP messages to include an 238 extension structure and a length attribute, such that those ICMP 239 messages can carry additional information by encoding that 240 information in the extension structure. 242 Appendix D of [RFC4301] provides information about which ICMP error 243 messages are produced by hosts, intermediate routers, or both. 245 2.1.2. ICMP for IP version 6 (ICMPv6) 247 [RFC4443] specifies the Internet Control Message Protocol (ICMPv6) to 248 be used with the Internet Protocol version 6 (IPv6) [RFC2460]. 250 [RFC4443] defines the "Packet Too Big" (type 2, code 0) error 251 message, that is analogous to the ICMP "fragmentation needed and DF 252 bit set" (type 3, code 4) error message. [RFC1981] defines the Path 253 MTU Discovery mechanism for IP Version 6, that makes use of these 254 messages to determine the MTU of an arbitrary internet path. 256 Finally, [RFC4884] redefines selected ICMP messages to include an 257 extension structure and a length attribute, such that those ICMP 258 messages can carry additional information by encoding that 259 information in the extension structure. 261 Appendix D of [RFC4301] provides information about which ICMPv6 error 262 messages are produced by hosts, intermediate routers, or both. 264 2.2. Handling of ICMP error messages 266 The Host Requirements RFC [RFC1122] states in Section 4.2.3.9 that a 267 TCP MUST act on an ICMP error message passed up from the IP layer, 268 directing it to the connection that triggered the error. 270 In order to allow ICMP messages to be demultiplexed by the receiving 271 system, part of the original packet that triggered the message is 272 included in the payload of the ICMP error message. Thus, the 273 receiving system can use that information to match the ICMP error to 274 the transport protocol instance that triggered it. 276 Neither the Host Requirements RFC [RFC1122] nor the original TCP 277 specification [RFC0793] recommend any validation checks on the 278 received ICMP messages. Thus, as long as the ICMP payload contains 279 the information that identifies an existing communication instance, 280 it will be processed by the corresponding transport-protocol 281 instance, and the corresponding action will be performed. 283 Therefore, in the case of TCP, an attacker could send a crafted ICMP 284 error message to the attacked system, and, as long as he is able to 285 guess the four-tuple (i.e., Source IP Address, Source TCP port, 286 Destination IP Address, and Destination TCP port) that identifies the 287 communication instance to be attacked, he will be able to use ICMP to 288 perform a variety of attacks. 290 Generally, the four-tuple required to perform these attacks is not 291 known. However, as discussed in [Watson] and [RFC4953], there are a 292 number of scenarios (notably that of TCP connections established 293 between two BGP routers [RFC4271]), in which an attacker may be able 294 to know or guess the four-tuple that identifies a TCP connection. In 295 such a case, if we assume the attacker knows the two systems involved 296 in the TCP connection to be attacked, both the client-side and the 297 server-side IP addresses could be known or be within a reasonable 298 number of possibilities. Furthermore, as most Internet services use 299 the so-called "well-known" ports, only the client port number might 300 need to be guessed. In such a scenario, an attacker would need to 301 send, in principle, at most 65536 packets to perform any of the 302 attacks described in this document. These issues are exacerbated by 303 the fact that most systems choose the port numbers they use for 304 outgoing connections from a subset of the whole port number space, 305 thus reducing the amount of work needed to successfully perform these 306 attacks. 308 The need to be more cautious when processing received ICMP error 309 messages in order to mitigate or eliminate the impact of the attacks 310 described in this document has been documented by the Internet 311 Architecture Board (IAB) in [RFC4907]. 313 2.3. Handling of ICMP error messages in the context of IPsec 315 Section 5.2 of [RFC4301] describes the processing of inbound IP 316 Traffic in the case of "unprotected-to-protected". In the case of 317 ICMP, when an unprotected ICMP error message is received, it is 318 matched to the corresponding security association by means of the SPI 319 (Security Parameters Index) included in the payload of the ICMP error 320 message. Then, local policy is applied to determine whether to 321 accept or reject the message and, if accepted, what action to take as 322 a result. For example, if an ICMP unreachable message is received, 323 the implementation must decide whether to act on it, reject it, or 324 act on it with constraints. Section 8 ("Path MTU/DF processing") 325 discusses the processing of unauthenticated ICMP "fragmentation 326 needed and DF bit set" (type 3, code 3) and ICMPv6 "Packet Too Big" 327 (type 2, code 0) messages when an IPsec implementation is configured 328 to process (vs. ignore) such messages. 330 Section 6.1.1 of [RFC4301] notes that processing of unauthenticated 331 ICMP error messages may result in denial or degradation of service, 332 and therefore it would be desirable to ignore such messages. 333 However, it also notes that in many cases ignoring these ICMP 334 messages can degrade service, e.g., because of a failure to process 335 PMTUD and redirection messages, and therefore there is also a 336 motivation for accepting and acting upon them. It finally states 337 that to accommodate both ends of this spectrum, a compliant IPsec 338 implementation MUST permit a local administrator to configure an 339 IPsec implementation to accept or reject unauthenticated ICMP 340 traffic, and that this control MUST be at the granularity of ICMP 341 type and MAY be at the granularity of ICMP type and code. 342 Additionally, an implementation SHOULD incorporate mechanisms and 343 parameters for dealing with such traffic. 345 Thus, the policy to apply for the processing of unprotected ICMP 346 error messages is left up to the implementation and administrator. 348 3. Constraints in the possible solutions 350 If a host wants perform validation checks on the received ICMP error 351 messages before acting on them, it is limited by the piece of the 352 packet that triggered error that the sender of the ICMP error message 353 chose to include in the ICMP payload. This contrains the possible 354 validation checks, as the number of bytes of the packet that 355 triggered the error message that is included in the ICMP payload is 356 limited. 358 For ICMPv4, [RFC0792] states that the IP header plus the first 64 359 bits of the packet that triggered the ICMP message are to be included 360 in the payload of the ICMP error message. Thus, it is assumed that 361 all data needed to identify a transport protocol instance and process 362 the ICMP error message is contained in the first 64 bits of the 363 transport protocol header. Section 3.2.2 of [RFC1122] states that 364 "the Internet header and at least the first 8 data octets of the 365 datagram that triggered the error" are to be included in the payload 366 of ICMP error messages, and that "more than 8 octets MAY be sent", 367 thus allowing implementations to include more data from the original 368 packet than those required by the original ICMP specification. The 369 Requirements for IP Version 4 Routers RFC [RFC1812] states that ICMP 370 error messages "SHOULD contain as much of the original datagram as 371 possible without the length of the ICMP datagram exceeding 576 372 bytes". 374 Thus, for ICMP messages generated by hosts, we can only expect to get 375 the entire IP header of the original packet, plus the first 64 bits 376 of its payload. For TCP, this means that the only fields that will 377 be included in the ICMP payload are: the source port number, the 378 destination port number, and the 32-bit TCP sequence number. This 379 clearly imposes a constraint on the possible validation checks that 380 can be performed, as there is not much information available on which 381 to perform them. 383 This means, for example, that even if TCP were signing its segments 384 by means of the TCP MD5 signature option [RFC2385], this mechanism 385 could not be used as a counter-measure against ICMP-based attacks, 386 because, as ICMP messages include only a piece of the TCP segment 387 that triggered the error, the MD5 [RFC1321] signature could not be 388 recalculated. In the same way, even if the attacked peer were 389 authenticating its packets at the IP layer [RFC4301], because only a 390 part of the original IP packet would be available, the signature used 391 for authentication could not be recalculated, and thus the 392 authentication header in the original packet could not be used as a 393 counter-measure for ICMP-based attacks against TCP. 395 For IPv6, the payload of ICMPv6 error messages includes as many 396 octets from the IPv6 packet that triggered the ICMPv6 error message 397 as will fit without making the resulting ICMPv6 error message exceed 398 the minimum IPv6 MTU (1280 octets) [RFC4443]. Thus, more information 399 is available than in the IPv4 case. 401 Hosts could require ICMP error messages to be authenticated 402 [RFC4301], in order to act upon them. However, while this 403 requirement could make sense for those ICMP error messages sent by 404 hosts, it would not be feasible for those ICMP error messages 405 generated by routers, as this would imply either that the attacked 406 system should have a security association [RFC4301] with every 407 existing intermediate system, or that it should be able to establish 408 one dynamically. Current levels of deployment of protocols for 409 dynamic establishment of security associations makes this unfeasible. 410 Additionally, this would require routers to use certificates with 411 paths compatible for all hosts on the network. Finally, there may be 412 some scenarios, such as embedded devices, in which the processing 413 power requirements of authentication might not allow IPsec 414 authentication to be implemented effectively. 416 4. General counter-measures against ICMP attacks 418 The following subsections describe a number of mitigation techniques 419 that help to eliminate or mitigate the impact of the attacks 420 discussed in this document. Rather than being alternative counter- 421 measures, they can be implemented together to increase the protection 422 against these attacks. 424 4.1. TCP sequence number checking 426 The current specifications do not impose any validity checks on the 427 TCP segment that is contained in the ICMP payload. For instance, no 428 checks are performed to verify that a received ICMP error message has 429 been triggered by a segment that was "in flight" to the destination. 430 Thus, even stale ICMP error messages will be acted upon. 432 Many TCP implementations have incorporated a validation check such 433 that they react only to those ICMP error messages that appear to 434 relate to segments currently "in-flight" to the destination system. 435 These implementations check that the TCP sequence number contained in 436 the payload of the ICMP error message is within the range SND.UNA =< 437 SEG.SEQ < SND.NXT. This means that they require that the sequence 438 number be within the range of the data already sent but not yet 439 acknowledged. If an ICMP error message does not pass this check, it 440 is discarded. 442 Even if an attacker were able to guess the four-tuple that identifies 443 the TCP connection, this additional check would reduce the 444 possibility of considering a spoofed ICMP packet as valid to 445 Flight_Size/2^^32 (where Flight_Size is the number of data bytes 446 already sent to the remote peer, but not yet acknowledged [RFC5681]). 447 For connections in the SYN-SENT or SYN-RECEIVED states, this would 448 reduce the possibility of considering a spoofed ICMP packet as valid 449 to 1/2^^32. For a TCP endpoint with no data "in flight", this would 450 completely eliminate the possibility of success of these attacks. 452 This validation check has been implemented in Linux [Linux] for many 453 years, in OpenBSD [OpenBSD] since 2004, and in FreeBSD [FreeBSD] and 454 NetBSD [NetBSD] since 2005. 456 It is important to note that while this check greatly increases the 457 number of packets required to perform any of the attacks discussed in 458 this document, this may not be enough in those scenarios in which 459 bandwidth is easily available, and/or large TCP windows [RFC1323] are 460 in use. Additionally, this validation check does not help to prevent 461 on-path attacks, that is, attacks performed in scenarios in which the 462 attacker can sniff the packets that correspond to the target TCP 463 connection. 465 It should be noted that as there are no timeliness requirements for 466 ICMP error messages, the TCP Sequence Number check described in this 467 section might cause legitimate ICMP error messages to be discarded. 468 Also, even if this check is enforced, TCP might end up responding to 469 stale ICMP error messages (e.g., if the Sequence Number for the 470 corresponding direction of the data transfer wrap around). 472 4.2. Port randomization 474 As discussed in the previous sections, in order to perform any of the 475 attacks described in this document, an attacker would need to guess 476 (or know) the four-tuple that identifies the connection to be 477 attacked. Increasing the port number range used for outgoing TCP 478 connections, and randomizing the port number chosen for each outgoing 479 TCP connections would make it harder for an attacker to perform any 480 of the attacks discussed in this document. 482 [I-D.ietf-tsvwg-port-randomization] recommends that transport 483 protocols randomize the ephemeral ports used by clients, and proposes 484 a number of randomization algorithms. 486 4.3. Filtering ICMP error messages based on the ICMP payload 488 The source address of ICMP error messages does not need to be spoofed 489 to perform the attacks described in this document, as the ICMP error 490 messages might legitimately come from an intermediate system. 491 Therefore, simple filtering based on the source address of ICMP error 492 messages does not serve as a counter-measure against these attacks. 493 However, a more advanced packet filtering can be implemented in 494 middlebox devices such as firewalls and NATs. Middleboxes 495 implementing such advanced filtering look at the payload of the ICMP 496 error messages, and perform ingress and egress packet filtering based 497 on the source IP address of the IP header contained in the payload of 498 the ICMP error message. As the source IP address contained in the 499 payload of the ICMP error message does need to be spoofed to perform 500 the attacks described in this document, this kind of advanced 501 filtering serves as a counter-measure against these attacks. As with 502 traditional egress filtering [IP-filtering], egress filtering based 503 on the ICMP payload can help to prevent users of the network being 504 protected by the firewall from successfully performing ICMP attacks 505 against TCP connections established between external systems. 506 Additionally, ingress filtering based on the ICMP payload can prevent 507 TCP connections established between internal systems from attacks 508 performed by external systems. [ICMP-Filtering] provides examples of 509 ICMP filtering based on the ICMP payload. 511 This filtering technique has been implemented in OpenBSD's Packet 512 Filter [OpenBSD-PF], which has in turn been ported to a number of 513 systems, including FreeBSD [FreeBSD]. 515 5. Blind connection-reset attack 517 5.1. Description 519 When TCP is handed an ICMP error message, it will perform its fault 520 recovery function, as follows: 522 o If the network problem being reported is a hard error, TCP will 523 abort the corresponding connection. 525 o If the network problem being reported is a soft error, TCP will 526 just record this information, and repeatedly retransmit its data 527 until they either get acknowledged, or the connection times out. 529 The Host Requirements RFC [RFC1122] states (in Section 4.2.3.9) that 530 a host SHOULD abort the corresponding connection when receiving an 531 ICMP error message that indicates a "hard error", and states that 532 ICMP error messages of type 3 (Destination Unreachable) codes 2 533 (protocol unreachable), 3 (port unreachable), and 4 (fragmentation 534 needed and DF bit set) should be considered to indicate hard errors. 535 In the case of ICMP port unreachables, the specifications are 536 ambiguous, as Section 4.2.3.9 of [RFC1122] states that TCP SHOULD 537 abort the corresponding connection in response to them, but Section 538 3.2.2.1 of the same RFC ([RFC1122] states that TCP MUST abort the 539 connection in response to them. 541 While [RFC4443] did not exist when [RFC1122] was published, one could 542 extrapolate the concept of "hard errors" to ICMPv6 error messages of 543 type 1 (Destination unreachable) codes 1 (communication with 544 destination administratively prohibited), and 4 (port unreachable). 546 Thus, an attacker could use ICMP to perform a blind connection-reset 547 attack by sending any ICMP error message that indicates a "hard 548 error", to either of the two TCP endpoints of the connection. 549 Because of TCP's fault recovery policy, the connection would be 550 immediately aborted. 552 Some stacks are known to extrapolate ICMP hard errors across TCP 553 connections, increasing the impact of this attack, as a single ICMP 554 packet could bring down all the TCP connections between the 555 corresponding peers. 557 It is important to note that even if TCP itself were protected 558 against the blind connection-reset attack described in [Watson] and 559 [I-D.ietf-tcpm-tcpsecure], by means of authentication at the network 560 layer [RFC4301], by means of the TCP MD5 signature option [RFC2385], 561 by means of the TCP-AO [I-D.ietf-tcpm-tcp-auth-opt], or by means of 562 the mechanism specified in [I-D.ietf-tcpm-tcpsecure], the blind 563 connection-reset attack described in this document would still 564 succeed. 566 5.2. Attack-specific counter-measures 568 An analysis of the circumstances in which ICMP messages that indicate 569 hard errors may be received can shed some light to mitigate the 570 impact of ICMP-based blind connection-reset attacks. 572 ICMP type 3 (Destination Unreachable), code 2 (protocol unreachable) 574 This ICMP error message indicates that the host sending the ICMP 575 error message received a packet meant for a transport protocol it 576 does not support. For connection-oriented protocols such as TCP, 577 one could expect to receive such an error as the result of a 578 connection-establishment attempt. However, it would be strange to 579 get such an error during the life of a connection, as this would 580 indicate that support for that transport protocol has been removed 581 from the system sending the error message during the life of the 582 corresponding connection. 584 ICMP type 3 (Destination Unreachable), code 3 (port unreachable) 586 This error message indicates that the system sending the ICMP 587 error message received a packet meant for a socket (IP address, 588 port number) on which there is no process listening. Those 589 transport protocols which have their own mechanisms for notifying 590 this condition should not be receiving these error messages, as 591 the protocol would signal the port unreachable condition by means 592 of its own messages. Assuming that once a connection is 593 established it is not usual for the transport protocol to change 594 (or be reloaded), it should be unusual to get these error 595 messages. 597 ICMP type 3 (Destination Unreachable), code 4 (fragmentation needed 598 and DF bit set) 600 This error message indicates that an intermediate node needed to 601 fragment a datagram, but the DF (Don't Fragment) bit in the IP 602 header was set. It is considered a soft error when TCP implements 603 PMTUD, and a hard error if TCP does not implement PMTUD. Those 604 TCP/IP stacks that do not implement PMTUD (or have disabled it) 605 but support IP fragmentation/reassembly should not be sending 606 their IP packets with the DF bit set, and thus should not be 607 receiving these ICMP error messages. Some TCP/IP stacks that do 608 not implement PMTUD and that do not support IP fragmentation/ 609 reassembly are known to send their packets with the DF bit set, 610 and thus could legitimately receive these ICMP error messages. 612 ICMPv6 type 1 (Destination Unreachable), code 1 (communication with 613 destination administratively prohibited) 615 This error message indicates that the destination is unreachable 616 because of an administrative policy. For connection-oriented 617 protocols such as TCP, one could expect to receive such an error 618 as the result of a connection-establishment attempt. Receiving 619 such an error for a connection in any of the synchronized states 620 would mean that the administrative policy changed during the life 621 of the connection. However, in the same way this error condition 622 (which was not present when the connection was established) 623 appeared, it could get solved in the near term. 625 ICMPv6 type 1 (Destination Unreachable), code 4 (port unreachable) 627 This error message is analogous to the ICMP type 3 (Destination 628 Unreachable), code 3 (Port unreachable) error message discussed 629 above. Therefore, the same considerations apply. 631 The Host Requirements RFC [RFC1122] states in Section 4.2.3.9 that 632 TCP SHOULD abort the corresponding connection in response to ICMP 633 messages of type 3, codes 2 (protocol unreachable), 3 (port 634 unreachable), and 4 (fragmentation needed and DF bit set). However, 635 Section 3.2.2.1 states that TCP MUST accept an ICMP port unreachable 636 (type 3, code 3) for the same purpose as an RST. Therefore, for ICMP 637 messages of type 3 codes 2 and 4 there is room to go against the 638 advice provided in the existing specifications, while in the case of 639 ICMP messages of type 3 code 3 there is ambiguity in the 640 specifications that may or may not provide some room to go against 641 that advice. 643 Based on this analysis, most popular TCP implementations treat all 644 ICMP "hard errors" received for connections in any of the 645 synchronized states (ESTABLISHED, FIN-WAIT-1, FIN-WAIT-2, CLOSE-WAIT, 646 CLOSING, LAST-ACK or TIME-WAIT) as "soft errors". That is, they do 647 not abort the corresponding connection upon receipt of them. 648 Additionally, they do not extrapolate ICMP errors across TCP 649 connections. This policy is based on the premise that TCP should be 650 as robust as possible. Aborting the connection would be to ignore 651 the valuable feature of the Internet that for many internal failures 652 it reconstructs its function without any disruption of the end points 653 [RFC0816]. 655 It is interesting to note that, as ICMP error messages are 656 transmitted unreliably, transport protocols should not depend on them 657 for correct functioning. In the event one of these messages were 658 legitimate, the corresponding connection would eventually time out. 659 Also, applications may still be notified asynchronously about the 660 error condition, and thus may still abort their connections on their 661 own if they consider it appropriate. 663 In scenarios such as that in which an intermediate system sets the DF 664 bit in the segments transmitted by a TCP that does not implement 665 PMTUD, or the TCP at one of the endpoints of the connection is 666 dynamically disabled, TCP would only abort the connection after a 667 USER TIMEOUT [RFC0793], losing responsiveness. However, these 668 scenarios are very unlikely in production environments, and it is 669 probably preferable to potentially lose responsiveness for the sake 670 of robustness. It should also be noted that applications may still 671 be notified asynchronously about the error condition, and thus may 672 still abort their connections on their own if they consider it 673 appropriate. 675 In scenarios of multipath routing or route changes, failures in some 676 (but not all) of the paths may elicit ICMP error messages that would 677 likely not cause a connection abort if any of the counter-measures 678 described in this section were implemented. However, aborting the 679 connection would be to ignore the valuable feature of the Internet 680 that for many internal failures it reconstructs its function without 681 any disruption of the end points [RFC0816]. That is, communication 682 should survive if there is still a working path to the destination 683 system [DClark]. Additionally, applications may still be notified 684 asynchronously about the error condition, and thus may still abort 685 their connections on their own if they consider it appropriate. 687 This counter-measure has been implemented in BSD-derived TCP/IP 688 implementations (e.g., [FreeBSD], [NetBSD], and [OpenBSD]) for more 689 than ten years [Wright][McKusick]. The Linux kernel has also 690 implemented this policy for more than ten years [Linux]. 692 6. Blind throughput-reduction attack 694 6.1. Description 696 The Host requirements RFC [RFC1122] states in Section 4.2.3.9 that 697 hosts MUST react to ICMP Source Quench messages by slowing 698 transmission on the connection. Thus, an attacker could send ICMP 699 Source Quench (type 4, code 0) messages to a TCP endpoint to make it 700 reduce the rate at which it sends data to the other end-point of the 701 connection. [RFC1122] further adds that the RECOMMENDED procedure is 702 to put the corresponding connection in the slow-start phase of TCP's 703 congestion control algorithm [RFC5681]. In the case of those 704 implementations that use an initial congestion window of one segment, 705 a sustained attack would reduce the throughput of the attacked 706 connection to about SMSS (Sender Maximum Segment Size) [RFC5681] 707 bytes per RTT (round-trip time). The throughput achieved during an 708 attack might be a little higher if a larger initial congestion window 709 is in use [RFC3390]. 711 6.2. Attack-specific counter-measures 713 As discussed in the Requirements for IP Version 4 Routers RFC 714 [RFC1812], research seems to suggest that ICMP Source Quench is an 715 ineffective (and unfair) antidote for congestion. [RFC1812] further 716 states that routers SHOULD NOT send ICMP Source Quench messages in 717 response to congestion. Furthermore, TCP implements its own 718 congestion control mechanisms [RFC5681] [RFC3168], that do not depend 719 on ICMP Source Quench messages. 721 Based on this reasoning, a large number of implementations completely 722 ignore ICMP Source Quench messages meant for TCP connections. This 723 behavior has been implemented in, at least, Linux [Linux] since 2004, 724 and in FreeBSD [FreeBSD], NetBSD [NetBSD], and OpenBSD [OpenBSD] 725 since 2005. However, it must be noted that this behaviour violates 726 the requirement in [RFC1122] to react to ICMP Source Quench messages 727 by slowing transmission on the connection. 729 7. Blind performance-degrading attack 731 7.1. Description 733 When one IP system has a large amount of data to send to another 734 system, the data will be transmitted as a series of IP datagrams. It 735 is usually preferable that these datagrams be of the largest size 736 that does not require fragmentation anywhere along the path from the 737 source to the destination. This datagram size is referred to as the 738 Path MTU (PMTU), and is equal to the minimum of the MTUs of each hop 739 in the path. A technique called "Path MTU Discovery" (PMTUD) lets IP 740 systems determine the Path MTU of an arbitrary internet path. 741 [RFC1191] and [RFC1981] specify the PMTUD mechanism for IPv4 and 742 IPv6, respectively. 744 The PMTUD mechanism for IPv4 uses the Don't Fragment (DF) bit in the 745 IP header to dynamically discover the Path MTU. The basic idea 746 behind the PMTUD mechanism is that a source system assumes that the 747 MTU of the path is that of the first hop, and sends all its datagrams 748 with the DF bit set. If any of the datagrams is too large to be 749 forwarded without fragmentation by some intermediate router, the 750 router will discard the corresponding datagram, and will return an 751 ICMP "Destination Unreachable" (type 3) "fragmentation needed and DF 752 set" (code 4) error message to the sending system. This message will 753 report the MTU of the constricting hop, so that the sending system 754 can reduce the assumed Path-MTU accordingly. 756 For IPv6, intermediate systems do not fragment packets. Thus, 757 there's an "implicit" DF bit set in every packet sent on a network. 758 If any of the datagrams is too large to be forwarded without 759 fragmentation by some intermediate router, the router will discard 760 the corresponding datagram, and will return an ICMPv6 "Packet Too 761 Big" (type 2, code 0) error message to sending system. This message 762 will report the MTU of the constricting hop, so that the sending 763 system can reduce the assumed Path-MTU accordingly. 765 As discussed in both [RFC1191] and [RFC1981], the Path-MTU Discovery 766 mechanism can be used to attack TCP. An attacker could send a 767 crafted ICMP "Destination Unreachable, fragmentation needed and DF 768 set" packet (or their ICMPv6 counterpart) to the sending system, 769 advertising a small Next-Hop MTU. As a result, the attacked system 770 would reduce the size of the packets it sends for the corresponding 771 connection accordingly. 773 The effect of this attack is two-fold. On one hand, it will increase 774 the headers/data ratio, thus increasing the overhead needed to send 775 data to the remote TCP end-point. On the other hand, if the attacked 776 system wanted to keep the same throughput it was achieving before 777 being attacked, it would have to increase the packet rate. On 778 virtually all systems this will lead to an increased processing 779 overhead, thus degrading the overall system performance. 781 A particular scenario that may take place is that in which an 782 attacker reports a Next-Hop MTU smaller than or equal to the amount 783 of bytes needed for headers (IP header, plus TCP header). For 784 example, if the attacker reports a Next-Hop MTU of 68 bytes, and the 785 amount of bytes used for headers (IP header, plus TCP header) is 786 larger than 68 bytes, the assumed Path-MTU will not even allow the 787 attacked system to send a single byte of application data without 788 fragmentation. This particular scenario might lead to unpredictable 789 results. Another possible scenario is that in which a TCP connection 790 is being secured by means of IPsec. If the Next-Hop MTU reported by 791 the attacker is smaller than the amount of bytes needed for headers 792 (IP and IPsec, in this case), the assumed Path-MTU will not even 793 allow the attacked system to send a single byte of the TCP header 794 without fragmentation. This is another scenario that may lead to 795 unpredictable results. 797 For IPv4, the reported Next-Hop MTU could be as low as 68 octets, as 799 [RFC0791] requires every internet module to be able to forward a 800 datagram of 68 octets without further fragmentation. For IPv6, the 801 reported Next-Hop MTU could be as low as 1280 octets (the minimum 802 IPv6 MTU) [RFC2460]. 804 7.2. Attack-specific counter-measures 806 The IETF has standardized a Path-MTU Discovery mechanism called 807 "Packetization Layer Path MTU Discovery" that does not depend on ICMP 808 error messages. Implementation of the aforementioned mechanism in 809 replacement of the traditional PMTUD (specified in [RFC1191] and 810 [RFC1981]) eliminates this vulnerability. However, it can also lead 811 to an increase of the PMTUD convergence time. 813 This section describes a modification to the PMTUD mechanism 814 specified in [RFC1191] and [RFC1981] that has been incorporated in 815 OpenBSD and NetBSD (since 2005) to improve TCP's resistance to the 816 blind performance-degrading attack described in Section 7.1. The 817 described mechanism basically disregards ICMP messages when a 818 connection makes progress, without violating any of the requirements 819 stated in [RFC1191] and [RFC1981]. 821 Henceforth, we will refer to both ICMP "fragmentation needed and DF 822 bit set" and ICMPv6 "Packet Too Big" messages as "ICMP Packet Too 823 Big" messages. 825 In addition to the general validation check described in Section 4.1, 826 these implementations include a modification to TCP's reaction to 827 ICMP "Packet Too Big" error messages that disregards them when a 828 connection makes progress, and honors them only after the 829 corresponding data have been retransmitted a specified number of 830 times. This means that upon receipt of an ICMP "Packet Too Big" 831 error message, TCP just records this information, and honors it only 832 when the corresponding data have already been retransmitted a 833 specified number of times. 835 While this basic policy would greatly mitigate the impact of the 836 attack against the PMTUD mechanism, it would also mean that it might 837 take TCP more time to discover the Path-MTU for a TCP connection. 838 This would be particularly annoying for connections that have just 839 been established, as it might take TCP several transmission attempts 840 (and the corresponding timeouts) before it discovers the PMTU for the 841 corresponding connection. Thus, this policy would increase the time 842 it takes for data to begin to be received at the destination host. 844 In order to protect TCP from the attack against the PMTUD mechanism, 845 while still allowing TCP to quickly determine the initial Path-MTU 846 for a connection, the aforementioned implementations have divided the 847 traditional PMTUD mechanism into two stages: Initial Path-MTU 848 Discovery, and Path-MTU Update. 850 The Initial Path-MTU Discovery stage is when TCP tries to send 851 segments that are larger than the ones that have so far been sent and 852 acknowledged for this connection. That is, in the Initial Path-MTU 853 Discovery stage TCP has no record of these large segments getting to 854 the destination host, and thus these implementations believe the 855 network when it reports that these packets are too large to reach the 856 destination host without being fragmented. 858 The Path-MTU Update stage is when TCP tries to send segments that are 859 equal to or smaller than the ones that have already been sent and 860 acknowledged for this connection. During the Path-MTU Update stage, 861 TCP already has knowledge of the estimated Path-MTU for the given 862 connection. Thus, in this case these implementations are more 863 cautious with the errors being reported by the network. 865 In order to allow TCP to distinguish segments between those 866 performing Initial Path-MTU Discovery and those performing Path-MTU 867 Update, two new variables are introduced to TCP: maxsizeacked and 868 maxsizesent. 870 maxsizesent holds the size (in octets) of the largest packet that has 871 so far been sent for this connection. It is initialized to 68 (the 872 minimum IPv4 MTU) when the underlying internet protocol is IPv4, and 873 is initialized to 1280 (the minimum IPv6 MTU) when the underlying 874 internet protocol is IPv6. Whenever a packet larger than maxsizesent 875 octets is sent, maxsizesent is set to that value. 877 On the other hand, maxsizeacked holds the size (in octets) of the 878 largest packet (data, plus headers) that has so far been acknowledged 879 for this connection. It is initialized to 68 (the minimum IPv4 MTU) 880 when the underlying internet protocol is IPv4, and is initialized to 881 1280 (the minimum IPv6 MTU) when the underlying internet protocol is 882 IPv6. Whenever an acknowledgement for a packet larger than 883 maxsizeacked octets is received, maxsizeacked is set to the size of 884 that acknowledged packet. Note that because of TCP's cumulative 885 acknowledgement, a single ACK may acknowledge the receipt of more 886 than one packet. When that happens, the algorithm may "incorrectly" 887 asume it is in the "Path-MTU Update" stage, rather than the "Initial 888 Path-MTU Discovery" stage (as described bellow). 890 Upon receipt of an ICMP "Packet Too Big" error message, the Next-Hop 891 MTU claimed by the ICMP message (henceforth "claimedmtu") is compared 892 with maxsizesent. If claimedmtu is larger than maxsizesent, then the 893 ICMP error message is silently discarded. The rationale for this is 894 that the ICMP error message cannot be legitimate if it claims to have 895 been triggered by a packet larger than the largest packet we have so 896 far sent for this connection. 898 If this check is passed, claimedmtu is compared with maxsizeacked. 899 If claimedmtu is equal to or larger than maxsizeacked, TCP is 900 supposed to be at the Initial Path-MTU Discovery stage, and thus the 901 ICMP "Packet Too Big" error message is honored immediately. That is, 902 the assumed Path-MTU is updated according to the Next-Hop MTU claimed 903 in the ICMP error message. Also, maxsizesent is reset to the minimum 904 MTU of the internet protocol in use (68 for IPv4, and 1280 for IPv6). 906 On the other hand, if claimedmtu is smaller than maxsizeacked, TCP is 907 supposed to be in the Path-MTU Update stage. At this stage, these 908 implementations are more cautious with the errors being reported by 909 the network, and therefore just record the received error message, 910 and delay the update of the assumed Path-MTU. 912 To perform this delay, one new variable and one new parameter is 913 introduced to TCP: nsegrto and MAXSEGRTO. nsegrto holds the number of 914 times a specified segment has timed out. It is initialized to zero, 915 and is incremented by one every time the corresponding segment times 916 out. MAXSEGRTO specifies the number of times a given segment must 917 timeout before an ICMP "Packet Too Big" error message can be honored, 918 and can be set, in principle, to any value greater than or equal to 919 0. 921 Thus, if nsegrto is greater than or equal to MAXSEGRTO, and there's a 922 pending ICMP "Packet Too Big" error message, the corresponding error 923 message is processed. At that point, maxsizeacked is set to 924 claimedmtu, and maxsizesent is set to 68 (for IPv4) or 1280 (for 925 IPv6). 927 If while there is a pending ICMP "Packet Too Big" error message the 928 TCP SEQ claimed by the pending message is acknowledged (i.e., an ACK 929 that acknowledges that sequence number is received), then the 930 "pending error" condition is cleared. 932 The rationale behind performing this delayed processing of ICMP 933 "Packet Too Big" messages is that if there is progress on the 934 connection, the ICMP "Packet Too Big" errors must be a false claim. 935 By checking for progress on the connection, rather than just for 936 staleness of the received ICMP messages, TCP is protected from attack 937 even if the offending ICMP messages are "in window", and as a 938 corollary, is made more robust to spurious ICMP messages triggered 939 by, for example, corrupted TCP segments. 941 MAXSEGRTO can be set, in principle, to any value greater than or 942 equal to 0. Setting MAXSEGRTO to 0 would make TCP perform the 943 traditional PMTUD mechanism defined in [RFC1191] and [RFC1981]. A 944 MAXSEGRTO of 1 provides enough protection for most cases. In any 945 case, implementations are free to choose higher values for this 946 constant. MAXSEGRTO could be a function of the Next-Hop MTU claimed 947 in the received ICMP "Packet Too Big" message. That is, higher 948 values for MAXSEGRTO could be imposed when the received ICMP "Packet 949 Too Big" message claims a Next-Hop MTU that is smaller than some 950 specified value. Both OpenBSD and NetBSD set MAXSEGRTO to 1. 952 In the event a higher level of protection is desired at the expense 953 of a higher delay in the discovery of the Path-MTU, an implementation 954 could consider TCP to always be in the Path-MTU Update stage, thus 955 always delaying the update of the assumed Path-MTU. 957 Section 7.3 shows this counter-measure in action. Section 7.4 shows 958 this counter-measure in pseudo-code. 960 It is important to note that the mechanism described in this section 961 is an improvement to the current Path-MTU discovery mechanism, to 962 mitigate its security implications. The current PMTUD mechanism, as 963 specified by [RFC1191] and [RFC1981], still suffers from some 964 functionality problems [RFC2923] that this document does not aim to 965 address. A mechanism that addresses those issues is described in 966 [RFC4821]. 968 7.3. The counter-measure for the PMTUD attack in action 970 This section illustrates the operation of the counter-measure for the 971 ICMP attack against the PMTUD mechanism that has been implemented in 972 OpenBSD and NetBSD . It shows both how the fix protects TCP from 973 being attacked and how the counter-measure works in normal scenarios. 974 As discussed in Section 7.2, this section assumes the PMTUD-specific 975 counter-measure is implemented in addition to the TCP sequence number 976 checking described in Section 4.1. 978 Figure 1 illustrates an hypothetical scenario in which two hosts are 979 connected by means of three intermediate routers. It also shows the 980 MTU of each hypothetical hop. All the following subsections assume 981 the network setup of this figure. 983 Also, for simplicity sake, all subsections assume an IP header of 20 984 octets and a TCP header of 20 octets. Thus, for example, when the 985 PMTU is assumed to be 1500 octets, TCP will send segments that 986 contain, at most, 1460 octets of data. 988 For simplicity sake, all the following subsections assume the TCP 989 implementation at Host 1 has chosen a a MAXSEGRTO of 1. 991 +----+ +----+ +----+ +----+ +----+ 992 | H1 |--------| R1 |--------| R2 |--------| R3 |--------| H2 | 993 +----+ +----+ +----+ +----+ +----+ 994 MTU=4464 MTU=2048 MTU=1500 MTU=4464 996 Figure 1: Hypothetical scenario 998 7.3.1. Normal operation for bulk transfers 1000 This subsection shows the counter-measure in normal operation, when a 1001 TCP connection is used for bulk transfers. That is, it shows how the 1002 counter-measure works when there is no attack taking place, and a TCP 1003 connection is used for transferring large amounts of data. This 1004 section assumes that just after the connection is established, one of 1005 the TCP endpoints begins to transfer data in packets that are as 1006 large as possible. 1008 Host 1 Host 2 1010 1. --> --> 1011 2. <-- <-- 1012 3. --> --> 1013 4. --> --> 1014 5. <--- ICMP "Packet Too Big" MTU=2048, TCPseq#=101 <--- R1 1015 6. --> --> 1016 7. <--- ICMP "Packet Too Big" MTU=1500, TCPseq#=101 <--- R2 1017 8. --> --> 1018 9. <-- <-- 1020 Figure 2: Normal operation for bulk transfers 1022 nsegrto is initialized to zero. Both maxsizeacked and maxsizesent 1023 are initialized to the minimum MTU for the internet protocol being 1024 used (68 for IPv4, and 1280 for IPv6). 1026 In lines 1 to 3 the three-way handshake takes place, and the 1027 connection is established. In line 4, H1 tries to send a full-sized 1028 TCP segment. As described by [RFC1191] and [RFC1981], in this case 1029 TCP will try to send a segment with 4424 bytes of data, which will 1030 result in an IP packet of 4464 octets. Therefore, maxsizesent is set 1031 to 4464. When the packet reaches R1, it elicits an ICMP "Packet Too 1032 Big" error message. 1034 In line 5, H1 receives the ICMP error message, which reports a Next- 1035 Hop MTU of 2048 octets. After performing the TCP sequence number 1036 check described in Section 4.1, the Next-Hop MTU reported by the ICMP 1037 error message (claimedmtu) is compared with maxsizesent. As it is 1038 smaller than maxsizesent, it passes the check, and thus is then 1039 compared with maxsizeacked. As claimedmtu is larger than 1040 maxsizeacked, TCP assumes that the corresponding TCP segment was 1041 performing the Initial PMTU Discovery. Therefore, the TCP at H1 1042 honors the ICMP message by updating the assumed Path-MTU. maxsizesent 1043 is reset to the minimum MTU of the internet protocol in use (68 for 1044 IPv4, and 1280 for IPv6). 1046 In line 6, the TCP at H1 sends a segment with 2008 bytes of data, 1047 which results in an IP packet of 2048 octets. maxsizesent is thus set 1048 to 2008 bytes. When the packet reaches R2, it elicits an ICMP 1049 "Packet Too Big" error message. 1051 In line 7, H1 receives the ICMP error message, which reports a Next- 1052 Hop MTU of 1500 octets. After performing the TCP sequence number 1053 check, the Next-Hop MTU reported by the ICMP error message 1054 (claimedmtu) is compared with maxsizesent. As it is smaller than 1055 maxsizesent, it passes the check, and thus is then compared with 1056 maxsizeacked. As claimedmtu is larger than maxsizeacked, TCP assumes 1057 that the corresponding TCP segment was performing the Initial PMTU 1058 Discovery. Therefore, the TCP at H1 honors the ICMP message by 1059 updating the assumed Path-MTU. maxsizesent is reset to the minimum 1060 MTU of the internet protocol in use. 1062 In line 8, the TCP at H1 sends a segment with 1460 bytes of data, 1063 which results in an IP packet of 1500 octets. maxsizesent is thus set 1064 to 1500. This packet reaches H2, where it elicits an acknowledgement 1065 (ACK) segment. 1067 In line 9, H1 finally gets the acknowledgement for the data segment. 1068 As the corresponding packet was larger than maxsizeacked, TCP updates 1069 maxsizeacked, setting it to 1500. At this point TCP has discovered 1070 the Path-MTU for this TCP connection. 1072 7.3.2. Operation during Path-MTU changes 1074 Let us suppose a TCP connection between H1 and H2 has already been 1075 established, and that the PMTU for the connection has already been 1076 discovered to be 1500. At this point, both maxsizesent and 1077 maxsizeacked are equal to 1500, and nsegrto is equal to 0. Suppose 1078 some time later the PMTU decreases to 1492. For simplicity, let us 1079 suppose that the Path-MTU has decreased because the MTU of the link 1080 between R2 and R3 has decreased from 1500 to 1492. Figure 3 1081 illustrates how the counter-measure would work in this scenario. 1083 Host 1 Host 2 1085 1. (Path-MTU decreases) 1086 2. --> --> 1087 3. <--- ICMP "Packet Too Big" MTU=1492, TCPseq#=100 <--- R2 1088 4. (Segment times out) 1089 5. --> --> 1090 6. <-- <-- 1092 Figure 3: Operation during Path-MTU changes 1094 In line 1, the Path-MTU for this connection decreases from 1500 to 1095 1492. In line 2, the TCP at H1, without being aware of the Path-MTU 1096 change, sends a 1500-byte packet to H2. When the packet reaches R2, 1097 it elicits an ICMP "Packet Too Big" error message. 1099 In line 3, H1 receives the ICMP error message, which reports a Next- 1100 Hop MTU of 1492 octets. After performing the TCP sequence number 1101 check, the Next-Hop MTU reported by the ICMP error message 1102 (claimedmtu) is compared with maxsizesent. As claimedmtu is smaller 1103 than maxsizesent, it is then compared with maxsizeacked. As 1104 claimedmtu is smaller than maxsizeacked (full-sized packets were 1105 getting to the remote end-point), this packet is assumed to be 1106 performing Path-MTU Update. And a "pending error" condition is 1107 recorded. 1109 In line 4, the segment times out. Thus, nsegrto is incremented by 1. 1110 As nsegrto is greater than or equal to MAXSEGRTO, the assumed Path- 1111 MTU is updated. nsegrto is reset to 0, and maxsizeacked is set to 1112 claimedmtu, and maxsizesent is set to the minimum MTU of the internet 1113 protocol in use. 1115 In line 5, H1 retransmits the data using the updated PMTU, and thus 1116 maxsizesent is set to 1492. The resulting packet reaches H2, where 1117 it elicits an acknowledgement (ACK) segment. 1119 In line 6, H1 finally gets the acknowledgement for the data segment. 1120 At this point TCP has discovered the new Path-MTU for this TCP 1121 connection. 1123 7.3.3. Idle connection being attacked 1125 Let us suppose a TCP connection between H1 and H2 has already been 1126 established, and the PMTU for the connection has already been 1127 discovered to be 1500. Figure 4 shows a sample time-line diagram 1128 that illustrates an idle connection being attacked. 1130 Host 1 Host 2 1132 1. --> --> 1133 2. <-- <-- 1134 3. <--- ICMP "Packet Too Big" MTU=68, TCPseq#=100 <--- 1135 4. <--- ICMP "Packet Too Big" MTU=68, TCPseq#=100 <--- 1136 5. <--- ICMP "Packet Too Big" MTU=68, TCPseq#=100 <--- 1138 Figure 4: Idle connection being attacked 1140 In line 1, H1 sends its last bunch of data. At line 2, H2 1141 acknowledges the receipt of these data. Then the connection becomes 1142 idle. In lines 3, 4, and 5, an attacker sends forged ICMP "Packet 1143 Too Big" error messages to H1. Regardless of how many packets it 1144 sends and the TCP sequence number each ICMP packet includes, none of 1145 these ICMP error messages will pass the TCP sequence number check 1146 described in Section 4.1, as H1 has no unacknowledged data in flight 1147 to H2. Therefore, the attack does not succeed. 1149 7.3.4. Active connection being attacked after discovery of the Path-MTU 1151 Let us suppose an attacker attacks a TCP connection for which the 1152 PMTU has already been discovered. In this case, as illustrated in 1153 Figure 1, the PMTU would be found to be 1500 bytes. Figure 5 shows a 1154 possible packet exchange. 1156 Host 1 Host 2 1158 1. --> --> 1159 2. --> --> 1160 3. --> --> 1161 4. --> --> 1162 5. <--- ICMP "Packet Too Big" MTU=68, TCPseq#=100 <--- 1163 6. <-- <-- 1165 Figure 5: Active connection being attacked after discovery of PMTU 1167 As we assume the PMTU has already been discovered, we also assume 1168 both maxsizesent and maxsizeacked are equal to 1500. We assume 1169 nsegrto is equal to zero, as there have been no segment timeouts. 1171 In lines 1, 2, 3, and 4, H1 sends four data segments to H2. In line 1172 5, an attacker sends a forged ICMP packet to H1. We assume the 1173 attacker is lucky enough to guess both the four-tuple that identifies 1174 the connection and a valid TCP sequence number. As the Next-Hop MTU 1175 claimed in the ICMP "Packet Too Big" message (claimedmtu) is smaller 1176 than maxsizeacked, this packet is assumed to be performing Path-MTU 1177 Update. Thus, the error message is recorded. 1179 In line 6, H1 receives an acknowledgement for the segment sent in 1180 line 1, before it times out. At this point, the "pending error" 1181 condition is cleared, and the recorded ICMP "Packet Too Big" error 1182 message is ignored. Therefore, the attack does not succeed. 1184 7.3.5. TCP peer attacked when sending small packets just after the 1185 three-way handshake 1187 This section analyzes an scenario in which a TCP peer that is sending 1188 small segments just after the connection has been established, is 1189 attacked. The connection could be being used by protocols such as 1190 SMTP [RFC5321] and HTTP [RFC2616], for example, which usually behave 1191 like this. 1193 Figure 6 shows a possible packet exchange for such scenario. 1195 Host 1 Host 2 1197 1. --> --> 1198 2. <-- <-- 1199 3. --> --> 1200 4. --> --> 1201 5. <-- <-- 1202 6. --> --> 1203 7. --> --> 1204 8. <--- ICMP "Packet Too Big" MTU=150, TCPseq#=101 <--- 1206 Figure 6: TCP peer attacked when sending small packets just after the 1207 three-way handshake 1209 nsegrto is initialized to zero. Both maxsizesent and maxsizeacked 1210 are initialized to the minimum MTU for the internet protocol being 1211 used (68 for IPv4, and 1280 for IPv6). 1213 In lines 1 to 3 the three-way handshake takes place, and the 1214 connection is established. At this point, the assumed Path-MTU for 1215 this connection is 4464. In line 4, H1 sends a small segment (which 1216 results in a 140-byte packet) to H2. maxsizesent is thus set to 140. 1217 In line 5 this segment is acknowledged, and thus maxsizeacked is set 1218 to 140. 1220 In lines 6 and 7, H1 sends two small segments to H2. In line 8, 1221 while the segments from lines 6 and 7 are still in flight to H2, an 1222 attacker sends a forged ICMP "Packet Too Big" error message to H1. 1223 Assuming the attacker is lucky enough to guess a valid TCP sequence 1224 number, this ICMP message will pass the TCP sequence number check. 1225 The Next-Hop MTU reported by the ICMP error message (claimedmtu) is 1226 then compared with maxsizesent. As claimedmtu is larger than 1227 maxsizesent, the ICMP error message is silently discarded. 1228 Therefore, the attack does not succeed. 1230 7.4. Pseudo-code for the counter-measure for the blind performance- 1231 degrading attack 1233 This section contains a pseudo-code version of the counter-measure 1234 described in Section 7.2 for the blind performance-degrading attack 1235 described in Section 7. It is meant as guidance for developers on 1236 how to implement this counter-measure. 1238 The pseudo-code makes use of the following variables, constants, and 1239 functions: 1241 ack 1242 Variable holding the acknowledgement number contained in the TCP 1243 segment that has just been received. 1245 acked_packet_size 1246 Variable holding the packet size (data, plus headers) the ACK that 1247 has just been received is acknowledging. 1249 adjust_mtu() 1250 Function that adjusts the MTU for this connection, according to 1251 the ICMP "Packet Too Big" that was last received. 1253 claimedmtu 1254 Variable holding the Next-Hop MTU advertised by the ICMP "Packet 1255 Too Big" error message. 1257 claimedtcpseq 1258 Variable holding the TCP sequence number contained in the payload 1259 of the ICMP "Packet Too Big" message that has just been received 1260 or was last recorded. 1262 current_mtu 1263 Variable holding the assumed Path-MTU for this connection. 1265 drop_message() 1266 Function that performs the necessary actions to drop the ICMP 1267 message being processed. 1269 initial_mtu 1270 Variable holding the MTU for new connections, as explained in 1271 [RFC1191] and [RFC1981]. 1273 maxsizeacked 1274 Variable holding the largest packet size (data, plus headers) that 1275 has so far been acked for this connection, as explained in 1276 Section 7.2. 1278 maxsizesent 1279 Variable holding the largest packet size (data, plus headers) that 1280 has so far been sent for this connection, as explained in 1281 Section 7.2. 1283 nsegrto 1284 Variable holding the number of times this segment has timed out, 1285 as explained in Section 7.2. 1287 packet_size 1288 Variable holding the size of the IP datagram being sent. 1290 pending_message 1291 Variable (flag) that indicates whether there is a pending ICMP 1292 "Packet Too Big" message to be processed. 1294 save_message() 1295 Function that records the ICMP "Packet Too Big" message that has 1296 just been received. 1298 MINIMUM_MTU 1299 Constant holding the minimum MTU for the internet protocol in use 1300 (68 for IPv4, and 1280 for IPv6). 1302 MAXSEGRTO 1303 Constant holding the number of times a given segment must timeout 1304 before an ICMP "Packet Too Big" error message can be honored. 1306 EVENT: New TCP connection 1308 current_mtu = initial_mtu; 1309 maxsizesent = MINIMUM_MTU; 1310 maxsizeacked = MINIMUM_MTU; 1311 nsegrto = 0; 1312 pending_message = 0; 1314 EVENT: Segment is sent 1315 if (packet_size > maxsizesent) 1316 maxsizesent = packet_size; 1318 EVENT: Segment is received 1320 if (acked_packet_size > maxsizeacked) 1321 maxsizeacked = acked_packet_size; 1323 if (pending_message) 1324 if (ack > claimedtcpseq){ 1325 pending_message = 0; 1326 nsegrto = 0; 1327 } 1329 EVENT: ICMP "Packet Too Big" message is received 1331 if (claimedmtu <= MINIMUM_MTU) 1332 drop_message(); 1334 if (claimedtcpseq < SND.UNA || claimed_TCP_SEQ >= SND.NXT){ 1335 drop_message(); 1336 } 1338 else { 1339 if (claimedmtu > maxsizesent || claimedmtu >= current_mtu) 1340 drop_message(); 1342 else { 1343 if (claimedmtu > maxsizeacked){ 1344 adjust_mtu(); 1345 current_mtu = claimedmtu; 1346 maxsizesent = MINIMUM_MTU; 1347 } 1349 else { 1350 pending_message = 1; 1351 save_message(); 1352 } 1353 } 1354 } 1356 EVENT: Segment times out 1358 nsegrto++; 1359 if (pending_message && nsegrto >= MAXSEGRTO){ 1360 adjust_mtu(); 1361 nsegrto = 0; 1362 pending_message = 0; 1363 maxsizeacked = claimedmtu; 1364 maxsizesent = MINIMUM_MTU; 1365 current_mtu = claimedmtu; 1366 } 1368 Notes: 1369 All comparisons between sequence numbers must be performed using 1370 sequence number arithmetic. 1371 The pseudo-code implements the mechanism described in Section 7.2, 1372 the TCP sequence number checking described in Section 4.1, and the 1373 validation check on the advertised Next-Hop MTU described in 1374 [RFC1191] and [RFC1981]. 1376 8. Security Considerations 1378 This document describes the use of ICMP error messages to perform a 1379 number of attacks against the TCP protocol, and describes a number of 1380 widely-implemented counter-measures that either eliminate or reduce 1381 the impact of these attacks when they are performed by off-path 1382 attackers. 1384 Section 4.1 describes a validation check that could be enforced on 1385 ICMP error messages, such that TCP reacts only to those ICMP error 1386 messages that appear to relate to segments currently "in-flight" to 1387 the destination system. This requires more effort on the side of an 1388 off-path attacker at the expense of possible reduced responsiveness 1389 to network errors. 1391 Section 4.2 describes how obfuscation of TCP ephemeral ports require 1392 more effort on the side of the attacker to successfully exploit any 1393 of the attacks described in this document. 1395 Section 4.3 describes how ICMP error messages could possibly be 1396 filtered based on their payload, to prevent users of the local 1397 network from successfully performing attacks against third-party 1398 connections. This is analogous to ingress filtering and egress 1399 filtering of IP packets [IP-filtering]. 1401 Section 5.2 describes an attack-specific counter-measure for the 1402 blind connection-reset attack. It describes the processing of ICMP 1403 "hard errors" as "soft errors" when they are received for connections 1404 in any of the synchronized states. This countermeasure eliminates 1405 the aforementioned vulnerability in synchronized connections at the 1406 expense of a possible reduced responsiveness in some network 1407 scenarios. 1409 Section 6.2 describes an attack-specific counter-measure for the 1410 blind throughput-reduction attack. It suggests that the 1411 aforementioned vulnerability can be eliminated by ignoring ICMP 1412 Source Quench messages meant for TCP connections. This is in 1413 accordance with research results that indicate that ICMP Source 1414 Quench messages are ineffective and unfair antidote for congestion. 1416 Finally, Section 7.2 describes an attack-specific countermeasure for 1417 the blind performance-degrading attack. It consists of the 1418 validation check described in Section 4.1, with a modification that 1419 makes TCP react to ICMP "Packet Too Big" error messages such that 1420 they are processed when an outstanding TCP segment times out. This 1421 countermeasures parallels the Packetization Layer Path MTU Discovery 1422 (PLPMTUD) mechanism [RFC4821]. 1424 A discussion of these and other attack vectors for performing similar 1425 attacks against TCP (along with possible counter-measures) can be 1426 found in [CPNI-TCP] and [I-D.ietf-tcpm-tcp-security]. 1428 9. IANA Considerations 1430 This document has no actions for IANA. The RFC-Editor can remove 1431 this section before publication of this document as an RFC. 1433 10. Acknowledgements 1435 This document was inspired by Mika Liljeberg, while discussing some 1436 issues related to [RFC5461] by private e-mail. The author would like 1437 to thank (in alphabetical order): Bora Akyol, Mark Allman, Ran 1438 Atkinson, James Carlson, Alan Cox, Theo de Raadt, Wesley Eddy, Lars 1439 Eggert, Ted Faber, Juan Fraschini, Markus Friedl, Guillermo Gont, 1440 John Heffner, Alfred Hoenes, Vivek Kakkar, Michael Kerrisk, Mika 1441 Liljeberg, Matt Mathis, David Miller, Toby Moncaster, Miles Nordin, 1442 Eloy Paris, Kacheong Poon, Andrew Powell, Pekka Savola, Donald Smith, 1443 Pyda Srisuresh, Fred Templin, and Joe Touch for contributing many 1444 valuable comments. 1446 Juan Fraschini and the author of this document implemented freely- 1447 available audit tools to help vendors audit their systems by 1448 reproducing the attacks discussed in this document. This tools are 1449 available at http://www.gont.com.ar/tools/index.html . 1451 Markus Friedl, Chad Loder, and the author of this document, produced 1452 and tested in OpenBSD [OpenBSD] the first implementation of the 1453 counter-measure described in Section 7.2. This first implementation 1454 helped to test the effectiveness of the ideas introduced in this 1455 document, and has served as a reference implementation for other 1456 operating systems. 1458 The author would like to thank the UK's Centre for the Protection of 1459 National Infrastructure (CPNI) -- formerly National Infrastructure 1460 Security Co-ordination Centre (NISCC) -- for coordinating the 1461 disclosure of these issues with a large number of vendors and CSIRTs 1462 (Computer Security Incident Response Teams). 1464 The author wishes to express deep and heartfelt gratitude to Jorge 1465 Oscar Gont and Nelida Garcia, for their precious motivation and 1466 guidance. 1468 11. References 1470 11.1. Normative References 1472 [RFC0791] Postel, J., "Internet Protocol", STD 5, RFC 791, 1473 September 1981. 1475 [RFC0792] Postel, J., "Internet Control Message Protocol", STD 5, 1476 RFC 792, September 1981. 1478 [RFC0793] Postel, J., "Transmission Control Protocol", STD 7, 1479 RFC 793, September 1981. 1481 [RFC1122] Braden, R., "Requirements for Internet Hosts - 1482 Communication Layers", STD 3, RFC 1122, October 1989. 1484 [RFC1191] Mogul, J. and S. Deering, "Path MTU discovery", RFC 1191, 1485 November 1990. 1487 [RFC1812] Baker, F., "Requirements for IP Version 4 Routers", 1488 RFC 1812, June 1995. 1490 [RFC1981] McCann, J., Deering, S., and J. Mogul, "Path MTU Discovery 1491 for IP version 6", RFC 1981, August 1996. 1493 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1494 Requirement Levels", BCP 14, RFC 2119, March 1997. 1496 [RFC2460] Deering, S. and R. Hinden, "Internet Protocol, Version 6 1497 (IPv6) Specification", RFC 2460, December 1998. 1499 [RFC4301] Kent, S. and K. Seo, "Security Architecture for the 1500 Internet Protocol", RFC 4301, December 2005. 1502 [RFC4443] Conta, A., Deering, S., and M. Gupta, "Internet Control 1503 Message Protocol (ICMPv6) for the Internet Protocol 1504 Version 6 (IPv6) Specification", RFC 4443, March 2006. 1506 [RFC4884] Bonica, R., Gan, D., Tappan, D., and C. Pignataro, 1507 "Extended ICMP to Support Multi-Part Messages", RFC 4884, 1508 April 2007. 1510 11.2. Informative References 1512 [CPNI-TCP] 1513 CPNI, "Security Assessment of the Transmission Control 1514 Protocol (TCP)", http://www.cpni.gov.uk/Docs/ 1515 tn-03-09-security-assessment-TCP.pdf, 2009. 1517 [DClark] Clark, D., "The Design Philosophy of the DARPA Internet 1518 Protocols", Computer Communication Review Vol. 18, No. 4, 1519 1988. 1521 [FreeBSD] The FreeBSD Project, "http://www.freebsd.org". 1523 [I-D.ietf-tcpm-tcp-auth-opt] 1524 Touch, J., Mankin, A., and R. Bonica, "The TCP 1525 Authentication Option", draft-ietf-tcpm-tcp-auth-opt-08 1526 (work in progress), October 2009. 1528 [I-D.ietf-tcpm-tcp-security] 1529 Gont, F., "Security Assessment of the Transmission Control 1530 Protocol (TCP)", draft-ietf-tcpm-tcp-security-00 (work in 1531 progress), August 2009. 1533 [I-D.ietf-tcpm-tcpsecure] 1534 Ramaiah, A., Stewart, R., and M. Dalal, "Improving TCP's 1535 Robustness to Blind In-Window Attacks", 1536 draft-ietf-tcpm-tcpsecure-12 (work in progress), 1537 September 2009. 1539 [I-D.ietf-tsvwg-port-randomization] 1540 Larsen, M. and F. Gont, "Port Randomization", 1541 draft-ietf-tsvwg-port-randomization-05 (work in progress), 1542 November 2009. 1544 [ICMP-Filtering] 1545 Gont, F., "Filtering of ICMP error messages", http:// 1546 www.gont.com.ar/papers/ 1547 filtering-of-icmp-error-messages.pdf. 1549 [IP-filtering] 1550 NISCC, "NISCC Technical Note 01/2006: Egress and Ingress 1551 Filtering", http://www.niscc.gov.uk/niscc/docs/ 1552 re-20060420-00294.pdf?lang=en, 2006. 1554 [Linux] The Linux Project, "http://www.kernel.org". 1556 [McKusick] 1557 McKusick, M., Bostic, K., Karels, M., and J. Quarterman, 1558 "The Design and Implementation of the 4.4BSD Operating 1559 System", Addison-Wesley , 1996. 1561 [NISCC] NISCC, "NISCC Vulnerability Advisory 532967/NISCC/ICMP: 1562 Vulnerability Issues in ICMP packets with TCP payloads", 1563 http://www.niscc.gov.uk/niscc/docs/ 1564 al-20050412-00308.html?lang=en, 2005. 1566 [NetBSD] The NetBSD Project, "http://www.netbsd.org". 1568 [OpenBSD] The OpenBSD Project, "http://www.openbsd.org". 1570 [OpenBSD-PF] 1571 The OpenBSD Packet Filter, 1572 "http://www.openbsd.org/faq/pf/". 1574 [RFC0816] Clark, D., "Fault isolation and recovery", RFC 816, 1575 July 1982. 1577 [RFC1321] Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321, 1578 April 1992. 1580 [RFC1323] Jacobson, V., Braden, B., and D. Borman, "TCP Extensions 1581 for High Performance", RFC 1323, May 1992. 1583 [RFC2385] Heffernan, A., "Protection of BGP Sessions via the TCP MD5 1584 Signature Option", RFC 2385, August 1998. 1586 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., 1587 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext 1588 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. 1590 [RFC2923] Lahey, K., "TCP Problems with Path MTU Discovery", 1591 RFC 2923, September 2000. 1593 [RFC3168] Ramakrishnan, K., Floyd, S., and D. Black, "The Addition 1594 of Explicit Congestion Notification (ECN) to IP", 1595 RFC 3168, September 2001. 1597 [RFC3390] Allman, M., Floyd, S., and C. Partridge, "Increasing TCP's 1598 Initial Window", RFC 3390, October 2002. 1600 [RFC4271] Rekhter, Y., Li, T., and S. Hares, "A Border Gateway 1601 Protocol 4 (BGP-4)", RFC 4271, January 2006. 1603 [RFC4821] Mathis, M. and J. Heffner, "Packetization Layer Path MTU 1604 Discovery", RFC 4821, March 2007. 1606 [RFC4907] Aboba, B., "Architectural Implications of Link 1607 Indications", RFC 4907, June 2007. 1609 [RFC4953] Touch, J., "Defending TCP Against Spoofing Attacks", 1610 RFC 4953, July 2007. 1612 [RFC5321] Klensin, J., "Simple Mail Transfer Protocol", RFC 5321, 1613 October 2008. 1615 [RFC5461] Gont, F., "TCP's Reaction to Soft Errors", RFC 5461, 1616 February 2009. 1618 [RFC5681] Allman, M., Paxson, V., and E. Blanton, "TCP Congestion 1619 Control", RFC 5681, September 2009. 1621 [US-CERT] US-CERT, "US-CERT Vulnerability Note VU#222750: TCP/IP 1622 Implementations do not adequately validate ICMP error 1623 messages", http://www.kb.cert.org/vuls/id/222750, 2005. 1625 [Watson] Watson, P., "Slipping in the Window: TCP Reset Attacks", 1626 2004 CanSecWest Conference , 2004. 1628 [Wright] Wright, G. and W. Stevens, "TCP/IP Illustrated, Volume 2: 1629 The Implementation", Addison-Wesley , 1994. 1631 Appendix A. Changes from previous versions of the draft (to be removed 1632 by the RFC Editor before publishing this document as an 1633 RFC) 1635 A.1. Changes from draft-ietf-tcpm-icmp-attacks-09 1637 o Addresses AD review comments by Lars Eggert (hopefully :-) ). 1639 A.2. Changes from draft-ietf-tcpm-icmp-attacks-08 1641 o Fixes a couple of nits found by... Alfred!. Thanks! (again, and 1642 again, and again....). 1644 A.3. Changes from draft-ietf-tcpm-icmp-attacks-07 1646 o Addresses some remaining WGLC feedback sent off-list by Donald 1647 Smith and Guillermo Gont. 1649 A.4. Changes from draft-ietf-tcpm-icmp-attacks-06 1651 o Addresses WGLC feedback by Joe Touch and Donald Smith. 1653 A.5. Changes from draft-ietf-tcpm-icmp-attacks-05 1655 o Addresses feedback submitted by Wes Eddy 1656 (http://www.ietf.org/mail-archive/web/tcpm/current/msg04573.html 1657 and 1658 http://www.ietf.org/mail-archive/web/tcpm/current/msg04574.html) 1659 and Joe Touch (on June 8th... couldn't find online ref, sorry) on 1660 the TCPM WG mailing-list. 1662 A.6. Changes from draft-ietf-tcpm-icmp-attacks-04 1664 o The draft had expired and thus is resubmitted with no further 1665 changes. Currently working on a rev of the document (Please send 1666 feedback!). 1668 A.7. Changes from draft-ietf-tcpm-icmp-attacks-03 1670 o The draft had expired and thus is resubmitted with no further 1671 changes. 1673 A.8. Changes from draft-ietf-tcpm-icmp-attacks-02 1675 o Added a disclaimer to indicate that this document does not update 1676 the current specifications. 1678 o Addresses feedback sent off-list by Alfred Hoenes. 1680 o The text (particularly that which describes the counter-measures) 1681 was reworded to document what current implementations are doing, 1682 rather than "proposing" the implementation of the counter- 1683 measures. 1685 o Some text has been removed: we're just documenting the problem, 1686 and what existing implementations have done. 1688 o Miscellaneous editorial changes. 1690 A.9. Changes from draft-ietf-tcpm-icmp-attacks-01 1692 o Fixed references to the antispoof documents (were hardcoded and 1693 missing in the References Section). 1695 o The draft had expired and thus is resubmitted with only a minor 1696 editorial change. 1698 A.10. Changes from draft-ietf-tcpm-icmp-attacks-00 1700 o Added references to the specific sections of each of the 1701 referenced specifications 1703 o Corrected the threat analysis 1705 o Added clarification about whether the counter-measures violate the 1706 current specifications or not. 1708 o Changed text so that the document fits better in the Informational 1709 path 1711 o Added a specific section on IPsec (Section 2.3) 1713 o Added clarification and references on the use of ICMP filtering 1714 based on the ICMP payload 1716 o Updated references to obsoleted RFCs 1718 o Added a discussion of multipath scenarios, and possible lose in 1719 responsiveness resulting from the reaction to hard errors as soft 1720 errors 1722 o Miscellaneous editorial changes 1724 A.11. Changes from draft-gont-tcpm-icmp-attacks-05 1726 o Removed RFC 2119 wording to make the draft suitable for 1727 publication as an Informational RFC. 1729 o Added additional checks that should be performed on ICMP error 1730 messages (checksum of the IP header in the ICMP payload, and 1731 others). 1733 o Added clarification of the rationale behind each the TCP SEQ check 1734 o Miscellaneous editorial changes 1736 A.12. Changes from draft-gont-tcpm-icmp-attacks-04 1738 o Added section on additional considerations for validating ICMP 1739 error messages 1741 o Added reference to (draft) [RFC4907] 1743 o Added stress on the fact that ICMP error messages are unreliable 1745 o Miscellaneous editorial changes 1747 A.13. Changes from draft-gont-tcpm-icmp-attacks-03 1749 o Added references to existing implementations of the described 1750 counter-measures 1752 o The discussion in Section 4 was improved 1754 o The discussion of the blind connection-reset vulnerability was 1755 expanded and improved 1757 o The counter-measure for the attack against the PMTUD was improved 1758 and simplified 1760 o Section 7.4 was added 1762 o Miscellaneous editorial changes 1764 A.14. Changes from draft-gont-tcpm-icmp-attacks-02 1766 o Fixed errors in in the discussion of the blind connection-reset 1767 attack 1769 o The counter-measure for the attack against the PMTUD mechanism was 1770 refined to allow quick discovery of the Path-MTU 1772 o Section 7.3 was added so as to clarify the operation of the 1773 counter-measure for the attack against the PMTUD mechanism 1775 o Added CPNI contact information. 1777 o Miscellaneous editorial changes 1779 A.15. Changes from draft-gont-tcpm-icmp-attacks-01 1781 o The document was restructured for easier reading 1783 o A discussion of ICMPv6 was added in several sections of the 1784 document 1786 o Added Section on Acknowledgement number checking 1788 o Added Section 4.3 1790 o Added Section 7 1792 o Fixed typo in the ICMP types, in several places 1794 o Fixed typo in the TCP sequence number check formula 1796 o Miscellaneous editorial changes 1798 A.16. Changes from draft-gont-tcpm-icmp-attacks-00 1800 o Added a proposal to change the handling of the so-called ICMP hard 1801 errors during the synchronized states 1803 o Added a summary of the relevant RFCs in several sections 1805 o Miscellaneous editorial changes 1807 Author's Address 1809 Fernando Gont 1810 Universidad Tecnologica Nacional / Facultad Regional Haedo 1811 Evaristo Carriego 2644 1812 Haedo, Provincia de Buenos Aires 1706 1813 Argentina 1815 Phone: +54 11 4650 8472 1816 Email: fernando@gont.com.ar 1817 URI: http://www.gont.com.ar