idnits 2.17.1 draft-ietf-6man-predictable-fragment-id-08.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 (June 9, 2015) is 3236 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-01 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 June 9, 2015 5 Expires: December 11, 2015 7 Security Implications of Predictable Fragment Identification Values 8 draft-ietf-6man-predictable-fragment-id-08 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 December 11, 2015. 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 . . . . . . . . . . . . 8 72 5.3. Hash-based Fragment Identification selection algorithm . 9 73 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 11 74 7. Security Considerations . . . . . . . . . . . . . . . . . . . 11 75 8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 11 76 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 12 77 9.1. Normative References . . . . . . . . . . . . . . . . . . 12 78 9.2. Informative References . . . . . . . . . . . . . . . . . 12 79 Appendix A. Information leakage produced by vulnerable 80 implementations . . . . . . . . . . . . . . . . . . 14 81 Appendix B. Survey of Fragment Identification selection 82 algorithms employed by popular IPv6 implementations 16 83 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 17 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 285 "effective" length of the IPv6 Fragment Identification field is 16 286 bits. 288 NOTE: [RFC6145] notes that, when translating in the IPv6-to-IPv4 289 direction, "if there is a Fragment Header in the IPv6 packet, the 290 last 16 bits of its value MUST be used for the IPv4 identification 291 value". This means that the high-order 16 bits are effectively 292 ignored. 294 As a result, at least during the IPv6/IPv4 transition/co-existence 295 phase, it is probably safer to assume that only the low-order 16 bits 296 of the IPv6 Fragment Identification are of use to the destination 297 system. 299 Regarding the selection of Fragment Identification values, the only 300 requirement specified in [RFC2460] is that the Fragment 301 Identification must be different than that of any other fragmented 302 packet sent recently with the same Source Address and Destination 303 Address. Failure to comply with this requirement could lead to the 304 interoperability problems discussed in [RFC4963]. 306 From a security standpoint, unpredictable Identification values are 307 desirable. However, this is somewhat at odds with the "re-use" 308 requirements specified in [RFC2460], that specifies that an 309 Identification value must be different than that of any other 310 fragment sent recently. 312 Finally, since Fragment Identification values need to be selected for 313 each outgoing datagram that requires fragmentation, the performance 314 impact should be considered when choosing an algorithm for the 315 selection of Fragment Identification values. 317 5. Algorithms for Selecting Fragment Identification Values 319 This section specifies a number of algorithms that may be used for 320 selecting Fragment Identification values. 322 5.1. Per-destination counter (initialized to a random value) 324 1. Whenever a packet must be sent with a Fragment Header, the 325 sending host should look-up in the Destinations Cache an entry 326 corresponding to the Destination Address of the packet. 328 2. If such an entry exists, it contains the last Fragment 329 Identification value used for that Destination Address. 330 Therefore, such value should be incremented by 1, and used for 331 setting the Fragment Identification value of the outgoing packet. 333 Additionally, the updated value should be recorded in the 334 corresponding entry of the Destination Cache [RFC4861]. 336 3. If such an entry does not exist, it should be created, and the 337 "Identification" value for that destination should be initialized 338 with a random value (e.g., with a pseudorandom number generator), 339 and used for setting the Identification field of the Fragment 340 Header of the outgoing fragmented datagram. 342 The advantages of this algorithm are: 344 o It is simple to implement, with the only complexity residing in 345 the Pseudo-Random Number Generator (PRNG) used to initialize the 346 "Identification" value contained in each entry of the Destinations 347 Cache. 349 o The "Identification" re-use frequency will typically be lower than 350 that achieved by a global counter (when sending traffic to 351 multiple destinations), since this algorithm uses per-destination 352 counters (rather than a single system-wide counter). 354 o It has good performance properties (once the corresponding entry 355 in the Destinations Cache has been created and initialized, each 356 subsequent "Identification" value simply involves the increment of 357 a counter). 359 The possible drawbacks of this algorithm are: 361 o If, as a result of resource management, an entry of the 362 Destinations Cache must be removed, the last Fragment 363 Identification value used for that Destination will be lost. 364 Thus, subsequent traffic to that destination would cause that 365 entry to be re-created and re-initialized to random value, thus 366 possibly leading to Fragment Identification "collisions". 368 o Since the Fragment Identification values are predictable by the 369 destination host, a vulnerable host might possibly leak to third- 370 parties the Fragment Identification values used by other hosts to 371 send traffic to it (i.e., Host B could leak to Host C the Fragment 372 Identification values that Host A is using to send packets to Host 373 B). Appendix A describes one possible scenario for such leakage 374 in detail. 376 5.2. Randomized Identification values 378 Clearly, use of a Pseudo-Random Number Generator for selecting the 379 Fragment Identification would be desirable from a security 380 standpoint. With such a scheme, the Fragment Identification of each 381 fragmented datagram would be selected as: 383 Identification = random() 385 where "random()" is the PRNG. 387 The specific properties of such scheme would clearly depend on the 388 specific PRNG employed. For example, some PRNGs may result in higher 389 Fragment Identification reuse frequencies than others, in the same 390 way that some PRNGs may be more expensive (in terms of processing 391 requirements and/or implementation complexity) than others. 393 Discussion of the properties of possible PRNGs is considered out of 394 the scope of this document. However, we do note that some PRNGs 395 employed in the past by some implementations have been found to be 396 predictable [Klein2007]. Please see [RFC4086] for randomness 397 requirements for security. 399 5.3. Hash-based Fragment Identification selection algorithm 401 Another alternative is to implement a hash-based algorithm similar to 402 that specified in [RFC6056] for the selection of transport port 403 numbers. With such a scheme, the Fragment Identification value of 404 each fragment datagram would be selected with the expression: 406 Identification = F(Src IP, Dst IP, secret1) + 407 counter[G(src IP, Dst Pref, secret2)] 409 where: 411 Identification: 412 Identification value to be used for the fragmented datagram 414 F(): 415 Hash function 417 Src IP: 418 IPv6 Source Address of the datagram to be fragmented 420 Dst IP: 421 IPv6 Destination Address of the datagram to be fragmented 423 secret1: 424 Secret data unknown to the attacker 426 counter[]: 428 System-wide array of 32-bit counters (e.g. with 8K elements or 429 more) 431 G(): 432 Hash function. May or may not be the same hash function as that 433 used for F() 435 Dst Pref: 436 IPv6 "Destination Prefix" of datagram to be fragmented (can be 437 assumed to be the first eight bytes of the Destination Address of 438 such packet). Note: the "Destination Prefix" (rather than 439 Destination Address) is used, such that the ability of an attacker 440 of searching the "increments" space by using multiple addresses of 441 the same subnet is reduced. 443 secret2: 444 Secret data unknown to the attacker 446 NOTE: counter[G(src IP, Dst Pref, secret2)] should be incremented by 447 one each time an Identification value is selected. 449 The advantages of this algorithm are: 451 o The "Identification" re-use frequency will typically be lower than 452 that achieved by a global counter (when sending traffic to 453 multiple destinations), since this algorithm uses multiple system- 454 wide counters (rather than a single system-wide counter). The 455 extent to which the re-use frequency will be lower will depend on 456 the number of elements in counter[], and the number of other 457 active flows that result in the same value of G() (and hence cause 458 the same counter to be incremented for each fragmented datagram 459 that is sent). 461 o It is possible to implement the algorithm such that good 462 performance is achieved. For example, the result of F() could be 463 stored in the Destinations Cache (such that it need not be 464 recomputed for each packet that must be sent) along with the 465 computed index/argument for counter[]. 467 NOTE: If this implementation approach is followed, and an entry 468 of the Destinations Cache must be removed as a result of 469 resource management, the last Fragment Identification value 470 used for that Destination will *not* be lost. This is an 471 improvement over the algorithm specified in Section 5.1. 473 The possible drawbacks of this algorithm are: 475 o Since the Fragment Identification values are predictable by the 476 destination host, a vulnerable host could possibly leak to third- 477 parties the Fragment Identification values used by other hosts to 478 send traffic to it (i.e., Host B could leak to Host C the Fragment 479 Identification values that Host A is using to send packets to Host 480 B). Appendix A describes a possible scenario in which that 481 information leakage could take place. We note, however, that this 482 algorithm makes the aforementioned attack less reliable for the 483 attacker, since each counter could be possibly shared by multiple 484 traffic flows (i.e., packets destined to other destinations might 485 cause the same counter to be incremented). 487 This algorithm might be preferable (over the one specified in 488 Section 5.1) in those scenarios in which a node is expected to 489 communicate with a large number of destinations, and thus it is 490 desirable to limit the amount of information to be maintained in 491 memory. 493 NOTE: In such scenarios, if the algorithm specified in Section 5.1 494 were implemented, entries from the Destinations Cache might need 495 to be pruned frequently, thus increasing the risk of Fragment 496 Identification "collisions". 498 6. IANA Considerations 500 There are no IANA registries within this document. The RFC-Editor 501 can remove this section before publication of this document as an 502 RFC. 504 7. Security Considerations 506 This document discusses the security implications of predictable 507 Fragment Identification values, and provides implementation guidance 508 such that the aforementioned security implications can be mitigated. 510 A number of possible algorithms are described, to provide some 511 implementation alternatives to implementers. We note that the 512 selection of such an algorithm usually implies a number of trade-offs 513 (security, performance, implementation complexity, interoperability 514 properties, etc.). 516 8. Acknowledgements 518 The author would like to thank Ivan Arce for proposing the attack 519 scenario described in Appendix A. 521 The author would like to thank Ivan Arce, Stephen Bensley, Ron 522 Bonica, Tassos Chatzithomaoglou, Brian Haberman, Bob Hinden, Tatuya 523 Jinmei, Merike Kaeo, Will Liu, Juan Antonio Matos, Simon Perreault, 524 Hosnieh Rafiee, Mark Smith, and Dave Thaler for providing valuable 525 comments on earlier versions of this document. 527 This document is based on work performed by Fernando Gont on behalf 528 of the UK Centre for the Protection of National Infrastructure 529 (CPNI). 531 9. References 533 9.1. Normative References 535 [RFC1981] McCann, J., Deering, S., and J. Mogul, "Path MTU Discovery 536 for IP version 6", RFC 1981, August 1996. 538 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 539 Requirement Levels", BCP 14, RFC 2119, March 1997. 541 [RFC2460] Deering, S. and R. Hinden, "Internet Protocol, Version 6 542 (IPv6) Specification", RFC 2460, December 1998. 544 [RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 545 Requirements for Security", BCP 106, RFC 4086, June 2005. 547 [RFC4861] Narten, T., Nordmark, E., Simpson, W., and H. Soliman, 548 "Neighbor Discovery for IP version 6 (IPv6)", RFC 4861, 549 September 2007. 551 [RFC5722] Krishnan, S., "Handling of Overlapping IPv6 Fragments", 552 RFC 5722, December 2009. 554 [RFC6056] Larsen, M. and F. Gont, "Recommendations for Transport- 555 Protocol Port Randomization", BCP 156, RFC 6056, January 556 2011. 558 [RFC6145] Li, X., Bao, C., and F. Baker, "IP/ICMP Translation 559 Algorithm", RFC 6145, April 2011. 561 [RFC6946] Gont, F., "Processing of IPv6 "Atomic" Fragments", RFC 562 6946, May 2013. 564 9.2. Informative References 566 [RFC4963] Heffner, J., Mathis, M., and B. Chandler, "IPv4 Reassembly 567 Errors at High Data Rates", RFC 4963, July 2007. 569 [RFC5927] Gont, F., "ICMP Attacks against TCP", RFC 5927, July 2010. 571 [RFC6274] Gont, F., "Security Assessment of the Internet Protocol 572 Version 4", RFC 6274, July 2011. 574 [I-D.ietf-6man-deprecate-atomfrag-generation] 575 Gont, F., LIU, S., and T. Anderson, "Deprecating the 576 Generation of IPv6 Atomic Fragments", draft-ietf-6man- 577 deprecate-atomfrag-generation-01 (work in progress), April 578 2015. 580 [Bellovin2002] 581 Bellovin, S., "A Technique for Counting NATted Hosts", 582 IMW'02 Nov. 6-8, 2002, Marseille, France, 2002. 584 [Fyodor2004] 585 Fyodor, , "Idle scanning and related IP ID games", 2004, 586 . 588 [Herzberg2013] 589 Herzberg, A. and H. Shulman, "Fragmentation Considered 590 Poisonous", Technical Report 13-03, March 2013, 591 . 593 [Klein2007] 594 Klein, A., "OpenBSD DNS Cache Poisoning and Multiple O/S 595 Predictable IP ID Vulnerability", 2007, 596 . 599 [Sanfilippo1998a] 600 Sanfilippo, S., "about the ip header id", Post to Bugtraq 601 mailing-list, Mon Dec 14 1998, 602 . 604 [Sanfilippo1998b] 605 Sanfilippo, S., "Idle scan", Post to Bugtraq mailing-list, 606 1998, . 608 [Sanfilippo1999] 609 Sanfilippo, S., "more ip id", Post to Bugtraq mailing- 610 list, 1999, 611 . 613 [SI6-IPv6] 614 "SI6 Networks' IPv6 toolkit", 615 . 617 [Zalewski2003] 618 Zalewski, M., "A new TCP/IP blind data injection 619 technique?", Post to Bugtraq mailing-list, Thu, 11 Dec 620 2003 00:28:28 +0100 (CET), 2003, 621 . 623 Appendix A. Information leakage produced by vulnerable implementations 625 Section 3 provides a number of references describing a number of ways 626 in which a vulnerable implementation may reveal the Fragment 627 Identification values to be used in subsequent packets, thus opening 628 the door to a number of attacks. In all of those scenarios, a 629 vulnerable implementation leaks/reveals its own Identification 630 number. 632 This section presents a different attack scenario, in which a 633 vulnerable implementation leaks/reveals the Identification number of 634 a non-vulnerable implementation. That is, a vulnerable 635 implementation (Host A) leaks the current Fragment Identification 636 value in use by a third-party host (Host B) to send fragmented 637 datagrams from Host B to Host A. 639 For the most part, this section is included to illustrate how a 640 vulnerable implementation might be leveraged to leak-out the 641 Fragment Identification value of an otherwise non-vulnerable 642 implementation. 644 The following scenarios assume: 646 Host A: 647 An IPv6 host that implements the the algorithm specified in 648 Section 5.1, implements [RFC5722], but does not implement 649 [RFC6946]. 651 Host B: 652 Victim node. Selects the Fragment Identification values from a 653 global counter. 655 Host C: 656 Attacker. Can forge the IPv6 Source Address of his packets at 657 will. 659 In the following scenarios, large ICMPv6 Echo Request packets are 660 employed to "sample" the Fragment Identification value of a host. We 661 note that while the figures show only one packet for the ICMPv6 Echo 662 Request and the ICMPv6 Echo Response, each of those packets will 663 typically comprise two fragments, such that the corresponding 664 unfragmented datagram is larger than the MTU of the networks to which 665 Host B and Host C are attached. Additionally, the following 666 scenarios assume that Host A employs a fragment header when sending 667 traffic to Host B (typically the so-called "IPv6 atomic fragments" 668 [RFC6946]): this behavior may be triggered by forged ICMPv6 PTB 669 messages that advertise an MTU smaller than 1280 bytes (assumming the 670 victim does not implement 671 [I-D.ietf-6man-deprecate-atomfrag-generation]). 673 In lines #1-#2 (and lines #8-#9), the attacker samples the current 674 Fragment Identification value at Host B. In line #3, the attacker 675 sends a forged TCP SYN segment to Host A. If corresponding TCP port 676 is closed, and the attacker fails when trying to produce a collision 677 of Fragment Identifications (see line #4), the following packet 678 exchange might take place: 680 A B C 682 #1 <------ Echo Req #1 ----------- 683 #2 --- Echo Resp #1, FID=5000 ---> 684 #3 <------------------- SYN #1, src= B ----------------------- 685 #4 <--- SYN/ACK, FID=42 src=A ---- 686 #5 ---- SYN/ACK, FID=9000 ---> 687 #6 <----- RST, FID= 5001 ----- 688 #7 <----- RST, FID= 5002 ----- 689 #8 <-------- Echo Req #2 --------- 690 #9 --- Echo Resp #2, FID=5003 ---> 692 The two RST segments are elicited by the SYN/ACK segment from line 693 #4, and the (illegitimately elicited by the SYN in line #3) SYN/ACK 694 segment from line #5. 696 On the other hand, if the attacker succeeds to produce a collision of 697 Fragment Identification values, the following packet exchange could 698 take place: 700 A B C 702 #1 <------- Echo Req #1 ---------- 703 #2 --- Echo Resp #1, FID=5000 ---> 704 #3 <------------------- SYN #1, src= B ----------------------- 705 #4 <-- SYN/ACK, FID=9000 src=A --- 706 #5 ---- SYN/ACK, FID=9000 ---> 707 ... (RFC5722) ... 708 #6 <------- Echo Req #2 ---------- 709 #7 ---- Echo Resp #2, FID=5001 --> 711 Clearly, the Fragment Identification value sampled from the second 712 ICMPv6 Echo Response packet ("Echo Resp #2") implicitly indicates 713 whether the Fragment Identification in the forged SYN/ACK (see line 714 #4 in both figures) was the current Fragment Identification in use by 715 Host A. 717 As a result, the attacker could employ this technique to learn the 718 current Fragment Identification value used by host A to send packets 719 to host B, even when Host A itself has a non-vulnerable 720 implementation. 722 Appendix B. Survey of Fragment Identification selection algorithms 723 employed by popular IPv6 implementations 725 This section includes a survey of the Fragment Identification 726 selection algorithms employed in some popular operating systems. 728 The survey was produced with the SI6 Networks' IPv6 toolkit 729 [SI6-IPv6]. 731 +------------------------------+------------------------------------+ 732 | Operating System | Algorithm | 733 +------------------------------+------------------------------------+ 734 | Cisco IOS 15.3 | Predictable (Global Counter, | 735 | | Init=0, Incr=1) | 736 +------------------------------+------------------------------------+ 737 | FreeBSD 9.0 | Unpredictable (Random) | 738 +------------------------------+------------------------------------+ 739 | Linux 3.0.0-15 | Predictable (Global Counter, | 740 | | Init=0, Incr=1) | 741 +------------------------------+------------------------------------+ 742 | Linux-current | Unpredictable (Per-dest Counter, | 743 | | Init=random, Incr=1) | 744 +------------------------------+------------------------------------+ 745 | NetBSD 5.1 | Unpredictable (Random) | 746 +------------------------------+------------------------------------+ 747 | OpenBSD-current | Random (SKIP32) | 748 +------------------------------+------------------------------------+ 749 | Solaris 10 | Predictable (Per-dst Counter, | 750 | | Init=0, Incr=1) | 751 +------------------------------+------------------------------------+ 752 | Windows XP SP2 | Predictable (Global Counter, | 753 | | Init=0, Incr=2) | 754 +------------------------------+------------------------------------+ 755 | Windows XP Professional | Predictable (Global Counter, | 756 | 32bit, SP3 | Init=0, Incr=2) | 757 +------------------------------+------------------------------------+ 758 | Windows Vista (Build 6000) | Predictable (Global Counter, | 759 | | Init=0, Incr=2) | 760 +------------------------------+------------------------------------+ 761 | Windows Vista Business | Predictable (Global Counter, | 762 | 64bit, SP1 | Init=0, Incr=2) | 763 +------------------------------+------------------------------------+ 764 | Windows 7 Home Premium | Predictable (Global Counter, | 765 | | Init=0, Incr=2) | 766 +------------------------------+------------------------------------+ 767 | Windows Server 2003 R2 | Predictable (Global Counter, | 768 | Standard 64bit, SP2 | Init=0, Incr=2) | 769 +------------------------------+------------------------------------+ 770 | Windows Server 2008 Standard | Predictable (Global Counter, | 771 | 32bit, SP1 | Init=0, Incr=2) | 772 +------------------------------+------------------------------------+ 773 | Windows Server 2008 R2 | Predictable (Global Counter, | 774 | Standard 64bit, SP1 | Init=0, Incr=2) | 775 +------------------------------+------------------------------------+ 776 | Windows Server 2012 Standard | Predictable (Global Counter, | 777 | 64bit | Init=0, Incr=2) | 778 +------------------------------+------------------------------------+ 779 | Windows 7 Home Premium | Predictable (Global Counter, | 780 | 32bit, SP1 | Init=0, Incr=2) | 781 +------------------------------+------------------------------------+ 782 | Windows 7 Ultimate 32bit, | Predictable (Global Counter, | 783 | SP1 | Init=0, Incr=2) | 784 +------------------------------+------------------------------------+ 785 | Windows 8 Enterprise 32 bit | Unpredictable (Alg. from Section | 786 | | 5.3) | 787 +------------------------------+------------------------------------+ 789 Table 1: Fragment Identification algorithms employed by different 790 OSes 792 In the text above, "predictable" should be taken as "easily 793 guessable by an off-path attacker, by sending a few probe 794 packets". 796 Author's Address 798 Fernando Gont 799 SI6 Networks / UTN-FRH 800 Evaristo Carriego 2644 801 Haedo, Provincia de Buenos Aires 1706 802 Argentina 804 Phone: +54 11 4650 8472 805 Email: fgont@si6networks.com 806 URI: http://www.si6networks.com