idnits 2.17.1 draft-ietf-6man-predictable-fragment-id-09.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (August 25, 2015) is 3165 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Informational ---------------------------------------------------------------------------- ** Obsolete normative reference: RFC 1981 (Obsoleted by RFC 8201) ** Obsolete normative reference: RFC 2460 (Obsoleted by RFC 8200) ** Obsolete normative reference: RFC 6145 (Obsoleted by RFC 7915) == Outdated reference: A later version (-08) exists of draft-ietf-6man-deprecate-atomfrag-generation-03 Summary: 3 errors (**), 0 flaws (~~), 2 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 IPv6 maintenance Working Group (6man) F. Gont 3 Internet-Draft SI6 Networks / UTN-FRH 4 Intended status: Informational August 25, 2015 5 Expires: February 26, 2016 7 Security Implications of Predictable Fragment Identification Values 8 draft-ietf-6man-predictable-fragment-id-09 10 Abstract 12 IPv6 specifies the Fragment Header, which is employed for the 13 fragmentation and reassembly mechanisms. The Fragment Header 14 contains an "Identification" field which, together with the IPv6 15 Source Address and the IPv6 Destination Address of a packet, 16 identifies fragments that correspond to the same original datagram, 17 such that they can be reassembled together by the receiving host. 18 The only requirement for setting the "Identification" field is that 19 the corresponding value must be different than that employed for any 20 other fragmented packet sent recently with the same Source Address 21 and Destination Address. Some implementations use a simple global 22 counter for setting the Identification field, thus leading to 23 predictable Identification values. This document analyzes the 24 security implications of predictable Identification values, and 25 provides implementation guidance for selecting the Identification 26 field of the Fragment Header, such that the aforementioned security 27 implications are mitigated. 29 Status of This Memo 31 This Internet-Draft is submitted in full conformance with the 32 provisions of BCP 78 and BCP 79. 34 Internet-Drafts are working documents of the Internet Engineering 35 Task Force (IETF). Note that other groups may also distribute 36 working documents as Internet-Drafts. The list of current Internet- 37 Drafts is at http://datatracker.ietf.org/drafts/current/. 39 Internet-Drafts are draft documents valid for a maximum of six months 40 and may be updated, replaced, or obsoleted by other documents at any 41 time. It is inappropriate to use Internet-Drafts as reference 42 material or to cite them other than as "work in progress." 44 This Internet-Draft will expire on February 26, 2016. 46 Copyright Notice 48 Copyright (c) 2015 IETF Trust and the persons identified as the 49 document authors. All rights reserved. 51 This document is subject to BCP 78 and the IETF Trust's Legal 52 Provisions Relating to IETF Documents 53 (http://trustee.ietf.org/license-info) in effect on the date of 54 publication of this document. Please review these documents 55 carefully, as they describe your rights and restrictions with respect 56 to this document. Code Components extracted from this document must 57 include Simplified BSD License text as described in Section 4.e of 58 the Trust Legal Provisions and are provided without warranty as 59 described in the Simplified BSD License. 61 Table of Contents 63 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 64 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 65 3. Security Implications of Predictable Fragment Identification 66 values . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 67 4. Constraints for the selection of Fragment Identification 68 Values . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 69 5. Algorithms for Selecting Fragment Identification Values . . . 7 70 5.1. Per-destination counter (initialized to a random value) . 7 71 5.2. Randomized Identification values . . . . . . . . . . . . 9 72 5.3. Hash-based Fragment Identification selection algorithm . 9 73 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 12 74 7. Security Considerations . . . . . . . . . . . . . . . . . . . 12 75 8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 12 76 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 12 77 9.1. Normative References . . . . . . . . . . . . . . . . . . 12 78 9.2. Informative References . . . . . . . . . . . . . . . . . 13 79 Appendix A. Information leakage produced by vulnerable 80 implementations . . . . . . . . . . . . . . . . . . 15 81 Appendix B. Survey of Fragment Identification selection 82 algorithms employed by popular IPv6 implementations 17 83 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 18 85 1. Introduction 87 IPv6 specifies the Fragment Header, which is employed for the 88 fragmentation and reassembly mechanisms. The Fragment Header 89 contains an "Identification" field which, together with the IPv6 90 Source Address and the IPv6 Destination Address of a packet, 91 identifies fragments that correspond to the same original datagram, 92 such that they can be reassembled together at the receiving host. 93 The only requirement for setting the "Identification" value is that 94 it must be different than that employed for any other fragmented 95 packet sent recently with the same Source Address and Destination 96 Address. 98 The most trivial algorithm to avoid reusing Fragment Identification 99 values too quickly is to maintain a global counter that is 100 incremented for each fragmented packet that is transmitted. However, 101 this trivial algorithm leads to predictable Identification values, 102 which can be leveraged to perform a variety of attacks. 104 Section 3 of this document analyzes the security implications of 105 predictable Identification values. Section 4 discusses constraints 106 in the possible algorithms for selecting Fragment Identification 107 values. Section 5 specifies a number of algorithms that could be 108 used for generating Identification values. Finally, Appendix B 109 contains a survey of the Fragment Identification algorithms employed 110 by popular IPv6 implementations. 112 2. Terminology 114 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 115 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 116 document are to be interpreted as described in RFC 2119 [RFC2119]. 118 3. Security Implications of Predictable Fragment Identification values 120 Predictable Identification values result in an information leakage 121 that can be exploited in a number of ways. Among others, they may 122 potentially be exploited to: 124 o determine the packet rate at which a given system is transmitting 125 information, 127 o perform stealth port scans to a third-party, 129 o uncover the rules of a number of firewalls, 131 o count the number of systems behind a middle-box, 133 o perform Denial of Service (DoS) attacks, or, 135 o perform data injection attacks against transport or application 136 protocols 138 The security implications introduced by predictable Fragment 139 Identification values are very similar to those of predictable 140 Identification values in IPv4. 142 [Sanfilippo1998a] originally pointed out how the IPv4 143 Identification field could be examined to determine the packet 144 rate at which a given system is transmitting information. Later, 145 [Sanfilippo1998b] described how a system with such an 146 implementation could be used to perform a stealth port scan to a 147 third (victim) host. [Sanfilippo1999] explains how to exploit 148 this implementation strategy to uncover the rules of a number of 149 firewalls. [Bellovin2002] explains how the IPv4 Identification 150 field can be exploited to count the number of systems behind a 151 NAT. [Fyodor2004] is an entire paper on most (if not all) the 152 ways to exploit the information provided by the Identification 153 field of the IPv4 header (and these results apply in a similar way 154 to IPv6). [Zalewski2003] originally envisioned the exploitation 155 of IP fragmentation/reassembly for performing data injection 156 attacks against upper-layer protocols. [Herzberg2013] explores 157 the use of IPv4/IPv6 fragmentation and predictable Identification 158 values for performing DNS cache poisoning attacks in great detail. 159 [RFC6274] covers the security implications of the IPv4 case in 160 detail. 162 One key difference between the IPv4 case and the IPv6 case is that in 163 IPv4 the Identification field is part of the fixed IPv4 header (and 164 thus usually set for all packets), while in IPv6 the Identification 165 field is present only in those packets that carry a Fragment Header. 166 As a result, successful exploitation of the IPv6 Fragment 167 Identification field depends on two different factors: 169 o vulnerable IPv6 Fragment Identification generators, and, 171 o the ability of an attacker to trigger the use of IPv6 172 fragmentation for packets sent from/to the victim node 174 The scenarios in which an attacker may successfully perform the 175 aforementioned attacks depend on the specific attack type. For 176 example, in order to DoS communications between two hosts, an 177 attacker would need to know the IPv6 addresses employed by the 178 aforementioned two nodes. Such knowledge may be readily available if 179 the target of the attack is the communication between two specific 180 BGP peers, two specific SMTP servers, or one specific primary DNS 181 server and one of its secondary DNS servers, but may not be easily 182 available if goal of the attack is to DoS all communications between 183 arbitrary IPv6 hosts (e.g. the goal was to DoS all communications 184 involving one specific node with arbitrary/unknown hosts). Other 185 attacks, such as performing stealth port scans to a third-party or 186 determining the packet rate at which a given system is transmitting 187 information, only require the attacker to know the IPv6 address of a 188 vulnerable implementation. 190 As noted in the previous section, some implementations have been 191 known to use predictable Fragment Identification values. For 192 instance, Appendix B of this document shows that recent versions of a 193 number of popular IPv6 implementations employ predictable values for 194 the IPv6 Fragment Identification. 196 Additionally, we note that [RFC2460] states that when an ICMPv6 197 Packet Too Big error message advertising an MTU smaller than 1280 198 bytes is received, the receiving host is not required to reduce the 199 Path-MTU for the corresponding destination address, but must simply 200 include a Fragment Header in all subsequent packets sent to that 201 destination. This triggers the use of the so-called IPv6 "atomic 202 fragments" [RFC6946]: IPv6 fragments with a Fragment Offset equal to 203 0, and the "M" ("More fragments") bit clear. 204 [I-D.ietf-6man-deprecate-atomfrag-generation] aims at deprecating the 205 generation of IPv6 atomic fragments. 207 Thus, an attacker can usually cause a victim host to "fragment" its 208 outgoing packets by sending it a forged ICMPv6 'Packet Too Big' (PTB) 209 error message that advertises an MTU smaller than 1280 bytes. 211 There are a number of aspects that should be considered, though: 213 o All the implementations the author is aware of record the Path-MTU 214 information on a per-destination basis. Thus, an attacker can 215 only cause the victim to enable fragmentation for those packets 216 sent to the Source Address of IPv6 packet embedded in the payload 217 of the ICMPv6 PTB message. However, we note that Section 5.2 of 218 [RFC1981] notes that an implementation could maintain a single 219 system-wide PMTU value to be used for all packets sent to that 220 node. Clearly, such implementations would exacerbate the problem 221 of any attacks based on PMTUD [RFC5927] or IPv6 fragmentation. 223 o If the victim node implements some of the counter-measures for 224 ICMP attacks described in RFC 5927 [RFC5927], it might be 225 difficult for an attacker to cause the victim node to employ 226 fragmentation for its outgoing packets. However, many current 227 implementations fail to enforce these validation checks. For 228 example, Linux 2.6.38-8 does not even require received ICMPv6 229 error messages to correspond to an ongoing communication instance. 231 o Some implementations (notably Linux) have already been updated 232 according to [I-D.ietf-6man-deprecate-atomfrag-generation] such 233 that ICMPv6 PTB messages do not result in the generation of IPv6 234 atomic fragments. 236 Implementations that employ predictable Identification values and 237 also fail to enforce validation checks on ICMPv6 error messages 238 become vulnerable to the same type of attacks that can be exploited 239 with IPv4 fragmentation, discussed earlier in this section. 241 One possible way in which predictable Identification values could be 242 leveraged for performing a Denial of Service (DoS) attack is as 243 follows: Let us assume that Host A is communicating with Host B, and 244 that an attacker wants to DoS attack such communication. The 245 attacker would learn the the Identification value currently in use by 246 Host A, possibly by sending any packet that would elicit a fragmented 247 response (e.g., an ICPMv6 echo request with a large payload). The 248 attacker would then send a forged ICMPv6 Packet Too Big error message 249 to Host A (with the IPv6 Destination Address of the embedded IPv6 250 packet set to the IPv6 address of a Host B), such that any subsequent 251 packets sent by Host A to Host B include a Fragment Header. Finally, 252 the attacker would send forged IPv6 fragments to Host B, with their 253 IPv6 Source Address set to that of Host A, and Identification values 254 that would result in collisions with the Identification values 255 employed for the legitimate traffic sent by Host A to Host B. If 256 Host B discards fragments that result in collisions of Identification 257 values (e.g., such fragments overlap, and the host implements 258 [RFC5722]), the attacker could simply trash the Identification space 259 by sending multiple forged fragments with different Identification 260 values, such that any subsequent packets from Host A to Host B are 261 discarded at Host B as a result of the malicious fragments sent by 262 the attacker. 264 NOTES: 266 For example, Linux 2.6.38-10 is vulnerable to the aforementioned 267 issue. 269 [RFC6946] describes an improved processing of these packets that 270 would eliminate this specific attack vector, at least in the case 271 of TCP connections that employ the Path-MTU Discovery mechanism. 273 The aforementioned attack scenario is simply included to illustrate 274 the problem of employing predictable fragment Identification values. 275 We note that regardless of the attacker's ability to cause a victim 276 host to employ fragmentation when communicating with third-parties, 277 use of predictable Identification values makes communication flows 278 that employ fragmentation vulnerable to any fragmentation-based 279 attacks. 281 4. Constraints for the selection of Fragment Identification Values 283 The "Identification" field of the Fragmentation Header is 32-bits 284 long. However, when translators [RFC6145] are employed, the high- 285 order 16 bits of the Identification field are effectively ignored. 287 NOTES: [RFC6145] notes that, when translating in the IPv6-to-IPv4 288 direction, "if there is a Fragment Header in the IPv6 packet, the 289 last 16 bits of its value MUST be used for the IPv4 identification 290 value". 292 Additionally, Section 3.3 of [RFC6052] encourages operators to use 293 a Network-Specific Prefix (NSP) that maps the IPv4 address space 294 into IPv6. Thus, when an NSP is being used, IPv6 addresses 295 representing IPv4 nodes (reached through a stateless translator) 296 are indistinguishable from native IPv6 addresses. 298 Thus, when translators are employed, the "effective" length of the 299 IPv6 Fragment Identification field is 16 bits and, as a result, at 300 least during the IPv6/IPv4 transition/co-existence phase, it is 301 probably safer to assume that only the low-order 16 bits of the IPv6 302 Fragment Identification are of use to the destination system. 304 Regarding the selection of Fragment Identification values, the only 305 requirement specified in [RFC2460] is that the Fragment 306 Identification must be different than that of any other fragmented 307 packet sent recently with the same Source Address and Destination 308 Address. Failure to comply with this requirement could lead to the 309 interoperability problems discussed in [RFC4963]. 311 From a security standpoint, unpredictable Identification values are 312 desirable. However, this is somewhat at odds with the "re-use" 313 requirements specified in [RFC2460], that specifies that an 314 Identification value must be different than that of any other 315 fragment sent recently. 317 Finally, since Fragment Identification values need to be selected for 318 each outgoing datagram that requires fragmentation, the performance 319 impact should be considered when choosing an algorithm for the 320 selection of Fragment Identification values. 322 5. Algorithms for Selecting Fragment Identification Values 324 This section specifies a number of algorithms that may be used for 325 selecting Fragment Identification values. 327 5.1. Per-destination counter (initialized to a random value) 329 1. Whenever a packet must be sent with a Fragment Header, the 330 sending host should look-up in the Destinations Cache an entry 331 corresponding to the Destination Address of the packet. 333 2. If such an entry exists, it contains the last Fragment 334 Identification value used for that Destination Address. 336 Therefore, such value should be incremented by 1, and used for 337 setting the Fragment Identification value of the outgoing packet. 338 Additionally, the updated value should be recorded in the 339 corresponding entry of the Destination Cache [RFC4861]. 341 3. If such an entry does not exist, it should be created, and the 342 "Identification" value for that destination should be initialized 343 with a random value (e.g., with a pseudorandom number generator), 344 and used for setting the Identification field of the Fragment 345 Header of the outgoing fragmented datagram. 347 The advantages of this algorithm are: 349 o It is simple to implement, with the only complexity residing in 350 the Pseudo-Random Number Generator (PRNG) used to initialize the 351 "Identification" value contained in each entry of the Destinations 352 Cache. 354 o The "Identification" re-use frequency will typically be lower than 355 that achieved by a global counter (when sending traffic to 356 multiple destinations), since this algorithm uses per-destination 357 counters (rather than a single system-wide counter). 359 o It has good performance properties (once the corresponding entry 360 in the Destinations Cache has been created and initialized, each 361 subsequent "Identification" value simply involves the increment of 362 a counter). 364 The possible drawbacks of this algorithm are: 366 o If, as a result of resource management, an entry of the 367 Destinations Cache must be removed, the last Fragment 368 Identification value used for that Destination will be lost. 369 Thus, subsequent traffic to that destination would cause that 370 entry to be re-created and re-initialized to random value, thus 371 possibly leading to Fragment Identification "collisions". 373 o Since the Fragment Identification values are predictable by the 374 destination host, a vulnerable host might possibly leak to third- 375 parties the Fragment Identification values used by other hosts to 376 send traffic to it (i.e., Host B could leak to Host C the Fragment 377 Identification values that Host A is using to send packets to Host 378 B). Appendix A describes one possible scenario for such leakage 379 in detail. 381 5.2. Randomized Identification values 383 Clearly, use of a Pseudo-Random Number Generator for selecting the 384 Fragment Identification would be desirable from a security 385 standpoint. With such a scheme, the Fragment Identification of each 386 fragmented datagram would be selected as: 388 Identification = random() 390 where "random()" is the PRNG. 392 The specific properties of such scheme would clearly depend on the 393 specific PRNG employed. For example, some PRNGs may result in higher 394 Fragment Identification reuse frequencies than others, in the same 395 way that some PRNGs may be more expensive (in terms of processing 396 requirements and/or implementation complexity) than others. 398 Discussion of the properties of possible PRNGs is considered out of 399 the scope of this document. However, we do note that some PRNGs 400 employed in the past by some implementations have been found to be 401 predictable [Klein2007]. Please see [RFC4086] for randomness 402 requirements for security. 404 5.3. Hash-based Fragment Identification selection algorithm 406 Another alternative is to implement a hash-based algorithm similar to 407 that specified in [RFC6056] for the selection of transport port 408 numbers. With such a scheme, the Fragment Identification value of 409 each fragment datagram would be selected with the expression: 411 Identification = F(Src IP, Dst IP, secret1) + 412 counter[G(Src IP, Dst Pref, secret2)] 414 where: 416 Identification: 417 Identification value to be used for the fragmented datagram 419 F(): 420 Hash function 422 Src IP: 423 IPv6 Source Address of the datagram to be fragmented 425 Dst IP: 426 IPv6 Destination Address of the datagram to be fragmented 428 secret1: 430 Secret data unknown to the attacker. This value can be 431 initialized to a pseudo-random value during the system 432 bootstrapping sequence. It should remain constant at least while 433 there could be previously-sent fragments still in the network or 434 at the fragment reassembly buffer of the corresponding destination 435 system(s). 437 counter[]: 438 System-wide array of 32-bit counters (e.g. with 8K elements or 439 more). Each counter should be initialized to a pseudo-random 440 value during the system bootstrapping sequence. 442 G(): 443 Hash function. May or may not be the same hash function as that 444 used for F() 446 Dst Pref: 447 IPv6 "Destination Prefix" of datagram to be fragmented (can be 448 assumed to be the first eight bytes of the Destination Address of 449 such packet). Note: the "Destination Prefix" (rather than 450 Destination Address) is used, such that the ability of an attacker 451 of searching the "increments" space by using multiple addresses of 452 the same subnet is reduced. 454 secret2: 455 Secret data unknown to the attacker. This value can be 456 initialized to a pseudo-random value during the system 457 bootstrapping sequence. It should remain constant at least while 458 there could be previously-sent fragments still in the network or 459 at the fragment reassembly buffer of the corresponding destination 460 system(s). 462 NOTE: counter[G(src IP, Dst Pref, secret2)] should be incremented by 463 one each time an Identification value is selected. 465 The output of F() will be constant for each (Src IP, Dst IP) pair. 466 Similarly, the output of G() will be constant for each (Src IP, Dst 467 Pref) pair. Thus, the resulting "Identification" value will be the 468 result of a random offset plus a linear function (provided by 469 counter[]), therefore resulting in a monotonically-increasing 470 sequence of "Identification" values for each (src IP, Dst IP) pair. 472 NOTE: 473 F() essentially provides the unpredictability (by off-path 474 attackers) of the resulting "Identification" values, while 475 counter[] provides a linear function such that the 476 "Identification" values are different for each fragmented packet 477 while the "Identification" reuse frequency is minimized. 479 The advantages of this algorithm are: 481 o The "Identification" re-use frequency will typically be lower than 482 that achieved by a global counter (when sending traffic to 483 multiple destinations), since this algorithm uses multiple system- 484 wide counters (rather than a single system-wide counter). The 485 extent to which the re-use frequency will be lower will depend on 486 the number of elements in counter[], and the number of other 487 active flows that result in the same value of G() (and hence cause 488 the same counter to be incremented for each fragmented datagram 489 that is sent). 491 o It is possible to implement the algorithm such that good 492 performance is achieved. For example, the result of F() could be 493 stored in the Destinations Cache (such that it need not be 494 recomputed for each packet that must be sent) along with the 495 computed index/argument for counter[]. 497 NOTE: 498 If this implementation approach is followed, and an entry of 499 the Destinations Cache must be removed as a result of resource 500 management, the last Fragment Identification value used for 501 that Destination will *not* be lost. This is an improvement 502 over the algorithm specified in Section 5.1. 504 The possible drawbacks of this algorithm are: 506 o Since the Fragment Identification values are predictable by the 507 destination host, a vulnerable host could possibly leak to third- 508 parties the Fragment Identification values used by other hosts to 509 send traffic to it (i.e., Host B could leak to Host C the Fragment 510 Identification values that Host A is using to send packets to Host 511 B). Appendix A describes a possible scenario in which that 512 information leakage could take place. We note, however, that this 513 algorithm makes the aforementioned attack less reliable for the 514 attacker, since each counter could be possibly shared by multiple 515 traffic flows (i.e., packets destined to other destinations might 516 cause the same counter to be incremented). 518 This algorithm might be preferable (over the one specified in 519 Section 5.1) in those scenarios in which a node is expected to 520 communicate with a large number of destinations, and thus it is 521 desirable to limit the amount of information to be maintained in 522 memory. 524 NOTE: In such scenarios, if the algorithm specified in Section 5.1 525 were implemented, entries from the Destinations Cache might need 526 to be pruned frequently, thus increasing the risk of Fragment 527 Identification "collisions". 529 6. IANA Considerations 531 There are no IANA registries within this document. The RFC-Editor 532 can remove this section before publication of this document as an 533 RFC. 535 7. Security Considerations 537 This document discusses the security implications of predictable 538 Fragment Identification values, and provides implementation guidance 539 such that the aforementioned security implications can be mitigated. 541 A number of possible algorithms are described, to provide some 542 implementation alternatives to implementers. We note that the 543 selection of such an algorithm usually implies a number of trade-offs 544 (security, performance, implementation complexity, interoperability 545 properties, etc.). 547 8. Acknowledgements 549 The author would like to thank Ivan Arce for proposing the attack 550 scenario described in Appendix A. 552 The author would like to thank Ivan Arce, Stephen Bensley, Ron 553 Bonica, Tassos Chatzithomaoglou, Brian Haberman, Bob Hinden, Tatuya 554 Jinmei, Merike Kaeo, Will Liu, Juan Antonio Matos, Simon Perreault, 555 Hosnieh Rafiee, Mark Smith, and Dave Thaler for providing valuable 556 comments on earlier versions of this document. 558 This document is based on work performed by Fernando Gont on behalf 559 of the UK Centre for the Protection of National Infrastructure 560 (CPNI). 562 9. References 564 9.1. Normative References 566 [RFC1981] McCann, J., Deering, S., and J. Mogul, "Path MTU Discovery 567 for IP version 6", RFC 1981, DOI 10.17487/RFC1981, August 568 1996, . 570 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 571 Requirement Levels", BCP 14, RFC 2119, 572 DOI 10.17487/RFC2119, March 1997, 573 . 575 [RFC2460] Deering, S. and R. Hinden, "Internet Protocol, Version 6 576 (IPv6) Specification", RFC 2460, DOI 10.17487/RFC2460, 577 December 1998, . 579 [RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker, 580 "Randomness Requirements for Security", BCP 106, RFC 4086, 581 DOI 10.17487/RFC4086, June 2005, 582 . 584 [RFC4861] Narten, T., Nordmark, E., Simpson, W., and H. Soliman, 585 "Neighbor Discovery for IP version 6 (IPv6)", RFC 4861, 586 DOI 10.17487/RFC4861, September 2007, 587 . 589 [RFC5722] Krishnan, S., "Handling of Overlapping IPv6 Fragments", 590 RFC 5722, DOI 10.17487/RFC5722, December 2009, 591 . 593 [RFC6052] Bao, C., Huitema, C., Bagnulo, M., Boucadair, M., and X. 594 Li, "IPv6 Addressing of IPv4/IPv6 Translators", RFC 6052, 595 DOI 10.17487/RFC6052, October 2010, 596 . 598 [RFC6056] Larsen, M. and F. Gont, "Recommendations for Transport- 599 Protocol Port Randomization", BCP 156, RFC 6056, 600 DOI 10.17487/RFC6056, January 2011, 601 . 603 [RFC6145] Li, X., Bao, C., and F. Baker, "IP/ICMP Translation 604 Algorithm", RFC 6145, DOI 10.17487/RFC6145, April 2011, 605 . 607 [RFC6946] Gont, F., "Processing of IPv6 "Atomic" Fragments", 608 RFC 6946, DOI 10.17487/RFC6946, May 2013, 609 . 611 9.2. Informative References 613 [RFC4963] Heffner, J., Mathis, M., and B. Chandler, "IPv4 Reassembly 614 Errors at High Data Rates", RFC 4963, 615 DOI 10.17487/RFC4963, July 2007, 616 . 618 [RFC5927] Gont, F., "ICMP Attacks against TCP", RFC 5927, 619 DOI 10.17487/RFC5927, July 2010, 620 . 622 [RFC6274] Gont, F., "Security Assessment of the Internet Protocol 623 Version 4", RFC 6274, DOI 10.17487/RFC6274, July 2011, 624 . 626 [I-D.ietf-6man-deprecate-atomfrag-generation] 627 Gont, F., LIU, S., and T. Anderson, "Deprecating the 628 Generation of IPv6 Atomic Fragments", draft-ietf-6man- 629 deprecate-atomfrag-generation-03 (work in progress), July 630 2015. 632 [Bellovin2002] 633 Bellovin, S., "A Technique for Counting NATted Hosts", 634 IMW'02 Nov. 6-8, 2002, Marseille, France, 2002. 636 [Fyodor2004] 637 Fyodor, , "Idle scanning and related IP ID games", 2004, 638 . 640 [Herzberg2013] 641 Herzberg, A. and H. Shulman, "Fragmentation Considered 642 Poisonous", Technical Report 13-03, March 2013, 643 . 645 [Klein2007] 646 Klein, A., "OpenBSD DNS Cache Poisoning and Multiple O/S 647 Predictable IP ID Vulnerability", 2007, 648 . 651 [Sanfilippo1998a] 652 Sanfilippo, S., "about the ip header id", Post to Bugtraq 653 mailing-list, Mon Dec 14 1998, 654 . 656 [Sanfilippo1998b] 657 Sanfilippo, S., "Idle scan", Post to Bugtraq mailing-list, 658 1998, . 660 [Sanfilippo1999] 661 Sanfilippo, S., "more ip id", Post to Bugtraq mailing- 662 list, 1999, 663 . 665 [SI6-IPv6] 666 "SI6 Networks' IPv6 toolkit", 667 . 669 [Zalewski2003] 670 Zalewski, M., "A new TCP/IP blind data injection 671 technique?", Post to Bugtraq mailing-list, Thu, 11 Dec 672 2003 00:28:28 +0100 (CET), 2003, 673 . 675 Appendix A. Information leakage produced by vulnerable implementations 677 Section 3 provides a number of references describing a number of ways 678 in which a vulnerable implementation may reveal the Fragment 679 Identification values to be used in subsequent packets, thus opening 680 the door to a number of attacks. In all of those scenarios, a 681 vulnerable implementation leaks/reveals its own Identification 682 number. 684 This section presents a different attack scenario, in which a 685 vulnerable implementation leaks/reveals the Identification number of 686 a non-vulnerable implementation. That is, a vulnerable 687 implementation (Host A) leaks the current Fragment Identification 688 value in use by a third-party host (Host B) to send fragmented 689 datagrams from Host B to Host A. 691 For the most part, this section is included to illustrate how a 692 vulnerable implementation might be leveraged to leak-out the 693 Fragment Identification value of an otherwise non-vulnerable 694 implementation. 696 The following scenarios assume: 698 Host A: 699 An IPv6 host that implements the the algorithm specified in 700 Section 5.1, implements [RFC5722], but does not implement 701 [RFC6946]. 703 Host B: 704 Victim node. Selects the Fragment Identification values from a 705 global counter. 707 Host C: 708 Attacker. Can forge the IPv6 Source Address of his packets at 709 will. 711 In the following scenarios, large ICMPv6 Echo Request packets are 712 employed to "sample" the Fragment Identification value of a host. We 713 note that while the figures show only one packet for the ICMPv6 Echo 714 Request and the ICMPv6 Echo Response, each of those packets will 715 typically comprise two fragments, such that the corresponding 716 unfragmented datagram is larger than the MTU of the networks to which 717 Host B and Host C are attached. Additionally, the following 718 scenarios assume that Host A employs a fragment header when sending 719 traffic to Host B (typically the so-called "IPv6 atomic fragments" 720 [RFC6946]): this behavior may be triggered by forged ICMPv6 PTB 721 messages that advertise an MTU smaller than 1280 bytes (assumming the 722 victim does not implement 723 [I-D.ietf-6man-deprecate-atomfrag-generation]). 725 In lines #1-#2 (and lines #8-#9), the attacker samples the current 726 Fragment Identification value at Host B. In line #3, the attacker 727 sends a forged TCP SYN segment to Host A. If corresponding TCP port 728 is closed, and the attacker fails when trying to produce a collision 729 of Fragment Identifications (see line #4), the following packet 730 exchange might take place: 732 A B C 734 #1 <------ Echo Req #1 ----------- 735 #2 --- Echo Resp #1, FID=5000 ---> 736 #3 <------------------- SYN #1, src= B ----------------------- 737 #4 <--- SYN/ACK, FID=42 src=A ---- 738 #5 ---- SYN/ACK, FID=9000 ---> 739 #6 <----- RST, FID= 5001 ----- 740 #7 <----- RST, FID= 5002 ----- 741 #8 <-------- Echo Req #2 --------- 742 #9 --- Echo Resp #2, FID=5003 ---> 744 The two RST segments are elicited by the SYN/ACK segment from line 745 #4, and the (illegitimately elicited by the SYN in line #3) SYN/ACK 746 segment from line #5. 748 On the other hand, if the attacker succeeds to produce a collision of 749 Fragment Identification values, the following packet exchange could 750 take place: 752 A B C 754 #1 <------- Echo Req #1 ---------- 755 #2 --- Echo Resp #1, FID=5000 ---> 756 #3 <------------------- SYN #1, src= B ----------------------- 757 #4 <-- SYN/ACK, FID=9000 src=A --- 758 #5 ---- SYN/ACK, FID=9000 ---> 759 ... (RFC5722) ... 760 #6 <------- Echo Req #2 ---------- 761 #7 ---- Echo Resp #2, FID=5001 --> 763 Clearly, the Fragment Identification value sampled from the second 764 ICMPv6 Echo Response packet ("Echo Resp #2") implicitly indicates 765 whether the Fragment Identification in the forged SYN/ACK (see line 766 #4 in both figures) was the current Fragment Identification in use by 767 Host A. 769 As a result, the attacker could employ this technique to learn the 770 current Fragment Identification value used by host A to send packets 771 to host B, even when Host A itself has a non-vulnerable 772 implementation. 774 Appendix B. Survey of Fragment Identification selection algorithms 775 employed by popular IPv6 implementations 777 This section includes a survey of the Fragment Identification 778 selection algorithms employed in some popular operating systems. 780 The survey was produced with the SI6 Networks' IPv6 toolkit 781 [SI6-IPv6]. 783 +------------------------------+------------------------------------+ 784 | Operating System | Algorithm | 785 +------------------------------+------------------------------------+ 786 | Cisco IOS 15.3 | Predictable (Global Counter, | 787 | | Init=0, Incr=1) | 788 +------------------------------+------------------------------------+ 789 | FreeBSD 9.0 | Unpredictable (Random) | 790 +------------------------------+------------------------------------+ 791 | Linux 3.0.0-15 | Predictable (Global Counter, | 792 | | Init=0, Incr=1) | 793 +------------------------------+------------------------------------+ 794 | Linux-current | Unpredictable (Per-dest Counter, | 795 | | Init=random, Incr=1) | 796 +------------------------------+------------------------------------+ 797 | NetBSD 5.1 | Unpredictable (Random) | 798 +------------------------------+------------------------------------+ 799 | OpenBSD-current | Random (SKIP32) | 800 +------------------------------+------------------------------------+ 801 | Solaris 10 | Predictable (Per-dst Counter, | 802 | | Init=0, Incr=1) | 803 +------------------------------+------------------------------------+ 804 | Windows XP SP2 | Predictable (Global Counter, | 805 | | Init=0, Incr=2) | 806 +------------------------------+------------------------------------+ 807 | Windows XP Professional | Predictable (Global Counter, | 808 | 32bit, SP3 | Init=0, Incr=2) | 809 +------------------------------+------------------------------------+ 810 | Windows Vista (Build 6000) | Predictable (Global Counter, | 811 | | Init=0, Incr=2) | 812 +------------------------------+------------------------------------+ 813 | Windows Vista Business | Predictable (Global Counter, | 814 | 64bit, SP1 | Init=0, Incr=2) | 815 +------------------------------+------------------------------------+ 816 | Windows 7 Home Premium | Predictable (Global Counter, | 817 | | Init=0, Incr=2) | 818 +------------------------------+------------------------------------+ 819 | Windows Server 2003 R2 | Predictable (Global Counter, | 820 | Standard 64bit, SP2 | Init=0, Incr=2) | 821 +------------------------------+------------------------------------+ 822 | Windows Server 2008 Standard | Predictable (Global Counter, | 823 | 32bit, SP1 | Init=0, Incr=2) | 824 +------------------------------+------------------------------------+ 825 | Windows Server 2008 R2 | Predictable (Global Counter, | 826 | Standard 64bit, SP1 | Init=0, Incr=2) | 827 +------------------------------+------------------------------------+ 828 | Windows Server 2012 Standard | Predictable (Global Counter, | 829 | 64bit | Init=0, Incr=2) | 830 +------------------------------+------------------------------------+ 831 | Windows 7 Home Premium | Predictable (Global Counter, | 832 | 32bit, SP1 | Init=0, Incr=2) | 833 +------------------------------+------------------------------------+ 834 | Windows 7 Ultimate 32bit, | Predictable (Global Counter, | 835 | SP1 | Init=0, Incr=2) | 836 +------------------------------+------------------------------------+ 837 | Windows 8 Enterprise 32 bit | Unpredictable (Alg. from Section | 838 | | 5.3) | 839 +------------------------------+------------------------------------+ 841 Table 1: Fragment Identification algorithms employed by different 842 OSes 844 In the text above, "predictable" should be taken as "easily 845 guessable by an off-path attacker, by sending a few probe 846 packets". 848 Author's Address 850 Fernando Gont 851 SI6 Networks / UTN-FRH 852 Evaristo Carriego 2644 853 Haedo, Provincia de Buenos Aires 1706 854 Argentina 856 Phone: +54 11 4650 8472 857 Email: fgont@si6networks.com 858 URI: http://www.si6networks.com