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