idnits 2.17.1 draft-ietf-6man-predictable-fragment-id-02.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 : ---------------------------------------------------------------------------- ** The document seems to lack a both a reference to RFC 2119 and the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. RFC 2119 keyword, line 262: '...its of its value MUST be used for the ...' Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (December 19, 2014) is 3415 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-00 Summary: 4 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 December 19, 2014 5 Expires: June 22, 2015 7 Security Implications of Predictable Fragment Identification Values 8 draft-ietf-6man-predictable-fragment-id-02 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 at the receiving host. 18 The only requirement for setting the "Identification" value is that 19 it must be different than that employed for any other fragmented 20 packet sent recently with the same Source Address and Destination 21 Address. Some implementations use simple a global counter for 22 setting the Identification field, thus leading to predictable values. 23 This document analyzes the security implications of predictable 24 Identification values, and provides implementation guidance for 25 selecting the Identification field of the Fragment Header, such that 26 the aforementioned security implications are mitigated. 28 Status of This Memo 30 This Internet-Draft is submitted in full conformance with the 31 provisions of BCP 78 and BCP 79. 33 Internet-Drafts are working documents of the Internet Engineering 34 Task Force (IETF). Note that other groups may also distribute 35 working documents as Internet-Drafts. The list of current Internet- 36 Drafts is at http://datatracker.ietf.org/drafts/current/. 38 Internet-Drafts are draft documents valid for a maximum of six months 39 and may be updated, replaced, or obsoleted by other documents at any 40 time. It is inappropriate to use Internet-Drafts as reference 41 material or to cite them other than as "work in progress." 43 This Internet-Draft will expire on June 22, 2015. 45 Copyright Notice 47 Copyright (c) 2014 IETF Trust and the persons identified as the 48 document authors. All rights reserved. 50 This document is subject to BCP 78 and the IETF Trust's Legal 51 Provisions Relating to IETF Documents 52 (http://trustee.ietf.org/license-info) in effect on the date of 53 publication of this document. Please review these documents 54 carefully, as they describe your rights and restrictions with respect 55 to this document. Code Components extracted from this document must 56 include Simplified BSD License text as described in Section 4.e of 57 the Trust Legal Provisions and are provided without warranty as 58 described in the Simplified BSD License. 60 Table of Contents 62 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 63 2. Security Implications of Predictable Fragment Identification 64 values . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 65 3. Constraints for the selection of Fragment Identification 66 Values . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 67 4. Algorithms for Selecting Fragment Identification Values . . . 7 68 4.1. Per-destination counter (initialized to a random value) . 7 69 4.2. Randomized Identification values . . . . . . . . . . . . 8 70 4.3. Hash-based Fragment Identification selection algorithm . 8 71 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 10 72 6. Security Considerations . . . . . . . . . . . . . . . . . . . 10 73 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 11 74 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 11 75 8.1. Normative References . . . . . . . . . . . . . . . . . . 11 76 8.2. Informative References . . . . . . . . . . . . . . . . . 12 77 Appendix A. Information leakage produced by vulnerable 78 implementations . . . . . . . . . . . . . . . . . . 13 79 Appendix B. Survey of Fragment Identification selection 80 algorithms employed by popular IPv6 implementations 15 81 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 16 83 1. Introduction 85 IPv6 specifies the Fragment Header, which is employed for the 86 fragmentation and reassembly mechanisms. The Fragment Header 87 contains an "Identification" field which, together with the IPv6 88 Source Address and the IPv6 Destination Address of a packet, 89 identifies fragments that correspond to the same original datagram, 90 such that they can be reassembled together at the receiving host. 91 The only requirement for setting the "Identification" value is that 92 it must be different than that employed for any other fragmented 93 packet sent recently with the same Source Address and Destination 94 Address. 96 The most trivial algorithm to avoid reusing Fragment Identification 97 values too quickly is to maintain a global counter that is 98 incremented for each fragmented packet that is transmitted. However, 99 this trivial algorithm leads to predictable Identification values, 100 which can be leveraged to perform a variety of attacks. 102 Section 2 of this document analyzes the security implications of 103 predictable Identification values. Section 3 discusses constraints 104 in the possible algorithms for selecting Fragment Identification 105 values. Section 4 specifies a number of algorithms that could be 106 used for generating Identification values. Finally, Appendix B 107 contains a survey of the Fragment Identification algorithms employed 108 by popular IPv6 implementations. 110 2. Security Implications of Predictable Fragment Identification values 112 Predictable Identification values result in an information leakage 113 that can be exploited in a number of ways. Among others, they may 114 potentially be exploited to: 116 o determine the packet rate at which a given system is transmitting 117 information, 119 o perform stealth port scans to a third-party, 121 o uncover the rules of a number of firewalls, 123 o count the number of systems behind a middle-box, 125 o perform Denial of Service (DoS) attacks, or, 127 o perform data injection attacks against transport or application 128 protocols 130 [CPNI-IPv6] contains a detailed analysis of possible vulnerabilities 131 introduced by predictable Fragment Identification values. In 132 summary, their security implications are very similar to those of 133 predictable Identification values in IPv4. 135 [Sanfilippo1998a] originally pointed out how the IPv4 136 Identification field could be examined to determine the packet 137 rate at which a given system is transmitting information. Later, 138 [Sanfilippo1998b] described how a system with such an 139 implementation could be used to perform a stealth port scan to a 140 third (victim) host. [Sanfilippo1999] explains how to exploit 141 this implementation strategy to uncover the rules of a number of 142 firewalls. [Bellovin2002] explains how the IPv4 Identification 143 field can be exploited to count the number of systems behind a 144 NAT. [Fyodor2004] is an entire paper on most (if not all) the 145 ways to exploit the information provided by the Identification 146 field of the IPv4 header (and these results apply in a similar way 147 to IPv6). [Zalewski2003] originally envisioned the exploitation 148 of IP fragmentation/reassembly for performing data injection 149 attacks against upper-layer protocols. [Herzberg2013] explores 150 the use of IPv4/IPv6 fragmentation and predictable Identification 151 values for performing DNS cache poisoning attacks in great detail. 152 [RFC6274] covers the security implications of the IPv4 case in 153 detail. 155 One key difference between the IPv4 case and the IPv6 case is that in 156 IPv4 the Identification field is part of the fixed IPv4 header (and 157 thus usually set for all packets), while in IPv6 the Identification 158 field is present only in those packets that carry a Fragment Header. 159 As a result, successful exploitation of the IPv6 Fragment 160 Identification field depends on two different factors: 162 o vulnerable IPv6 Fragment Identification generators, and, 164 o the ability of an attacker to trigger the use of IPv6 165 fragmentation for packets sent from/to the victim node 167 As noted in the previous section, some implementations have been 168 known to use predictable Fragment Identification values. For 169 instance, Appendix B of this document shows that recent versions of a 170 number of popular IPv6 implementations have been employing 171 predictable values for the IPv6 Fragment Identification. 173 Additionally, we note that [RFC2460] states that when an ICMPv6 174 Packet Too Big error message advertising an MTU smaller than 1280 175 bytes is received, the receiving host is not required to reduce the 176 Path-MTU for the corresponding destination address, but must simply 177 include a Fragment Header in all subsequent packets sent to that 178 destination. This triggers the use of the so-called IPv6 "atomic 179 fragments" [RFC6946]: IPv6 fragments with a Fragment Offset equal to 180 0, and the "M" ("More fragments") bit clear. 181 [I-D.ietf-6man-deprecate-atomfrag-generation] aims at deprecating the 182 generation of IPv6 atomic fragments. 184 Thus, an attacker can usually cause a victim host to "fragment" its 185 outgoing packets by sending it a forged ICMPv6 'Packet Too Big' (PTB) 186 error message that advertises a Next-Hop MTU smaller than 1280 bytes. 188 There are a number of aspects that should be considered, though: 190 o All the implementations the author is aware of record the Path-MTU 191 information on a per-destination basis. Thus, an attacker can 192 only cause the victim to enable fragmentation for those packets 193 sent to the Source Address of IPv6 packet embedded in the payload 194 of the ICMPv6 PTB message. However, we note that Section 5.2 of 195 [RFC1981] notes that an implementation could maintain a single 196 system-wide PMTU value to be used for all packets sent to that 197 node. Clearly, such an implementations would exacerbate the 198 problem of any attacks based on PMTUD [RFC5927] or IPv6 199 fragmentation. 201 o If the victim node implements some of the counter-measures for 202 ICMP attacks described in RFC 5927 [RFC5927], it might be 203 difficult for an attacker to cause the victim node to use 204 fragmentation for its outgoing packets. However, many current 205 implementations fail to enforce these validation checks. For 206 example, Linux 2.6.38-8 does not even require received ICMPv6 207 error messages to correspond to an ongoing communication instance. 209 Implementations that employ predictable Identification values and 210 also fail to enforce validation checks on ICMPv6 error messages 211 become vulnerable to the same type of attacks that can be exploited 212 with IPv4 fragmentation, discussed earlier in this section. 214 One possible way in which predictable Identification values could be 215 leveraged for performing a Denial of Service (DoS) attack is as 216 follows: Let us assume that Host A is communicating with Host B, and 217 that an attacker wants to DoS such communication. The attacker would 218 learn the the Identification value currently in use by Host A, 219 possibly by sending any packet that would elicit a fragmented 220 response (e.g., an ICPMv6 echo request with a large payload). The 221 attacker would then send a forged ICMPv6 Packet Too Big error message 222 to Host A (with the IPv6 Destination Address of the embedded IPv6 223 packet set to the IPv6 address of a Host B), such that any subsequent 224 packets sent by Host A to Host B include a Fragment Header. Finally, 225 the attacker would send forged IPv6 fragments to Host B, with their 226 IPv6 Source Address set to that of Host A, and Identification values 227 that would result in collisions with the Identification values 228 employed for the legitimate traffic sent by Host A to Host B. If 229 Host B discards fragments that result in collisions of Identification 230 values (e.g., such fragments overlap, and the host implements 231 [RFC5722]), the attacker could simply trash the Identification space 232 by sending multiple forged fragments with different Identification 233 values, such that any subsequent packets from Host A to Host B are 234 discarded at Host B as a result of the malicious fragments sent by 235 the attacker. 237 NOTES: 239 For example, Linux 2.6.38-10 is vulnerable to the aforementioned 240 issue. 242 [RFC6946] describes an improved processing of these packets that 243 would eliminate this specific attack vector, at least in the case 244 of TCP connections that employ the Path-MTU Discovery mechanism. 246 The previous attack scenario is simply included to illustrate the 247 problem of employing predictable fragment Identification values. We 248 note that regardless of the attacker's ability to cause a victim host 249 to employ fragmentation when communicating with third-parties, use of 250 predictable Identification values makes communication flows that 251 employ fragmentation vulnerable to any fragmentation-based attacks. 253 3. Constraints for the selection of Fragment Identification Values 255 The "Identification" field of the Fragmentation Header is 32-bits 256 long. However, when translators [RFC6145] are employed, the 257 "effective" length of the IPv6 Fragment Identification field is 16 258 bits. 260 NOTE: [RFC6145] notes that, when translating in the IPv6-to-IPv4 261 direction, "if there is a Fragment Header in the IPv6 packet, the 262 last 16 bits of its value MUST be used for the IPv4 identification 263 value". This means that the high-order 16 bits are effectively 264 ignored. 266 As a result, at least during the IPv6/IPv4 transition/co-existence 267 phase, it is probably safer to assume that only the low-order 16 bits 268 of the IPv6 Fragment Identification are of use to the destination 269 system. 271 Regarding the selection of Fragment Identification values, the only 272 requirement specified in [RFC2460] is that the Fragment 273 Identification must be different than that of any other fragmented 274 packet sent recently with the same Source Address and Destination 275 Address. Failure to comply with this requirement could lead to the 276 interoperability problems discussed in [RFC4963]. 278 From a security standpoint, unpredictable Identification values are 279 desirable. However, this is somewhat at odds with the "re-use" 280 requirements specified in [RFC2460]. 282 Finally, since Fragment Identification values need to be selected for 283 each outgoing datagram that requires fragmentation, the performance 284 impact should be considered when choosing an algorithm for the 285 selection of Fragment Identification values. 287 4. Algorithms for Selecting Fragment Identification Values 289 This section specifies a number of algorithms that may be used for 290 selecting Fragment Identification values. 292 4.1. Per-destination counter (initialized to a random value) 294 1. Whenever a packet must be sent with a Fragment Header, the 295 sending host should look-up in the Destinations Cache an entry 296 corresponding to the Destination Address of the packet. 298 2. If such an entry exists, it contains the last Fragment 299 Identification value used for that Destination Address. 300 Therefore, such value should be incremented by 1, and used for 301 setting the Fragment Identification value of the outgoing packet. 302 Additionally, the updated value should be recorded in the 303 corresponding entry of the Destination Cache. 305 3. If such an entry does not exist, it should be created, and the 306 "Identification" value for that destination should be initialized 307 with a random value (e.g., with a pseudorandom number generator), 308 and used for setting the Identification field of the Fragment 309 Header of the outgoing packet. 311 The advantages of this algorithm are: 313 o It is simple to implement, with the only complexity residing in 314 the Pseudo-Random Number Generator (PRNG) used to initialize the 315 "Identification" value contained in each entry of the Destinations 316 Cache. 318 o The "Identification" re-use frequency will typically be lower than 319 that achieved by a global counter (when sending traffic to 320 multiple destinations), since this algorithm uses per-destination 321 counters (rather than a single system-wide counter). 323 o It has good performance properties (once the corresponding entry 324 in the Destinations Cache has been created, each subsequent 325 "Identification" value simply involves the increment of a 326 counter). 328 The possible drawbacks of this algorithm are: 330 o If as a result of resource management an entry of the Destinations 331 Cache must be removed, the last Fragment Identification value used 332 for that Destination will be lost. Thus, subsequent traffic to 333 that destination would cause that entry to be re-created and re- 334 initialized to random value, thus possibly leading to Fragment 335 Identification "collisions". 337 o Since the Fragment Identification values are predictable by the 338 destination host, a vulnerable host might possibly leak to third- 339 parties the Fragment Identification values used by other hosts to 340 send traffic to it (i.e., Host B could leak to Host C the Fragment 341 Identification values that Host A is using to send packets to Host 342 B). Appendix A describes one possible scenario for such leakage 343 in detail. 345 4.2. Randomized Identification values 347 Clearly, use of a Pseudo-Random Number Generator for selecting the 348 Fragment Identification would be desirable from a security 349 standpoint. With such a scheme, the Fragment Identification of each 350 fragmented datagram would be selected as: 352 Identification = random() 354 where "random()" is the PRNG. 356 The specific properties of such scheme would clearly depend on the 357 specific PRNG algorithm used. For example, some PRNGs may result in 358 higher Fragment Identification reuse frequencies than others, in the 359 same way that some PRNGs may be more expensive (in terms of 360 processing requirements and/or implementation complexity) than 361 others. 363 Discussion of the properties of possible PRNGs is considered out of 364 the scope of this document. However, we do note that some PRNGs 365 employed in the past by some implementations have been found to be 366 predictable [Klein2007]. Please see [RFC4086] for randomness 367 requirements for security. 369 4.3. Hash-based Fragment Identification selection algorithm 371 Another alternative is to implement a hash-based algorithm similar to 372 that specified in [RFC6056] for the selection of transport port 373 numbers. With such a scheme, the Fragment Identification value of 374 each fragment datagram would be selected with the expression: 376 Identification = F(Src IP, Dst IP, secret1) + 377 counter[G(src IP, Dst Pref, secret2)] 379 where: 381 Identification: 383 Identification value to be used for the fragmented datagram 385 F(): 386 Hash function 388 Src IP: 389 IPv6 Source Address of the datagram to be fragmented 391 Dst IP: 392 IPv6 Destination Address of the datagram to be fragmented 394 secret1: 395 Secret data unknown to the attacker 397 counter[]: 398 System-wide array of 32-bit counters (e.g. with 8K elements or 399 more) 401 G(): 402 Hash function. May or may not be the same hash function as that 403 used for F() 405 Dst Pref: 406 IPv6 "Destination Prefix" of datagram to be fragmented (can be 407 assumed to be the first eight bytes of the Destination Address of 408 such packet). Note: the "Destination Prefix" (rather than 409 Destination Address) is used, such that the ability of an attacker 410 of searching the "increments" space by using multiple addresses of 411 the same subnet is reduced. 413 secret2: 414 Secret data unknown to the attacker 416 NOTE: counter[G(src IP, Dst Pref, secret2)] should be incremented by 417 one each time an Identification value is selected. 419 The advantages of this algorithm are: 421 o The "Identification" re-use frequency will typically be lower than 422 that achieved by a global counter (when sending traffic to 423 multiple destinations), since this algorithm uses multiple system- 424 wide counters (rather than a single system-wide counter). The 425 extent to which the re-use frequency will be lower will depend on 426 the number of elements in counter[], and the number of other 427 active flows that result in the same value of G() (and hence cause 428 the same counter to be incremented for each fragmented datagram 429 that is sent). 431 o It is possible to implement the algorithm such that good 432 performance is achieved. For example, the result of F() could be 433 stored in the Destinations Cache (such that it need not be 434 recomputed for each packet that must be sent) along with the 435 computed "index"/argument for counter[]. 437 NOTE: If this implementation approach is followed, and an entry 438 of the Destinations Cache must be removed as a result of 439 resource management, the last Fragment Identification value 440 used for that Destination will *not* be lost. This is an 441 improvement over the algorithm specified in Section 4.1. 443 The possible drawbacks of this algorithm are: 445 o Since the Fragment Identification values are predictable by the 446 destination host, a vulnerable host could possibly leak to third- 447 parties the Fragment Identification values used by other hosts to 448 send traffic to it (i.e., Host B could leak to Host C the Fragment 449 Identification values that Host A is using to send packets to Host 450 B). Appendix A describes a possible scenario in which that 451 information leakage could take place. We note, however, that this 452 algorithm makes the aforementioned attack less reliable for the 453 attacker, since each counter could be possibly shared by multiple 454 traffic flows (i.e., packets destined to other destinations might 455 cause the same counter to be incremented). 457 This algorithm might be preferable (over the one specified in 458 Section 4.1) in those scenarios in which a node is expected to 459 communicate with a large number of destinations, and thus it is 460 desirable to limit the amount of information to be maintained in 461 memory. 463 NOTE: In such scenarios, if the algorithm specified in Section 4.1 464 were implemented, entries from the Destinations Cache might need 465 to be pruned frequently, thus increasing the risk of fragment 466 Identification collisions. 468 5. IANA Considerations 470 There are no IANA registries within this document. The RFC-Editor 471 can remove this section before publication of this document as an 472 RFC. 474 6. Security Considerations 476 This document discusses the security implications of predictable 477 Fragment Identification values, and provides implementation guidance 478 such that the aforementioned security implications can be mitigated. 480 A number of possible algorithms are described, to provide some 481 implementation alternatives to implementers. We note that the 482 selection of such an algorithm usually implies a number of trade-offs 483 (security, performance, implementation complexity, interoperability 484 properties, etc.). 486 7. Acknowledgements 488 The author would like to thank Ivan Arce for proposing the attack 489 scenario described in Appendix A. 491 The author would like to thank Ivan Arce, Ron Bonica, Tassos 492 Chatzithomaoglou, Brian Haberman, Bob Hinden, Tatuya Jinmei, Merike 493 Kaeo, Will Liu, Juan Antonio Matos, Simon Perreault, Hosnieh Rafiee, 494 Mark Smith, and Dave Thaler for providing valuable comments on 495 earlier versions of this document. 497 This document is based on the technical report "Security Assessment 498 of the Internet Protocol version 6 (IPv6)" [CPNI-IPv6] authored by 499 Fernando Gont on behalf of the UK Centre for the Protection of 500 National Infrastructure (CPNI). 502 8. References 504 8.1. Normative References 506 [RFC1981] McCann, J., Deering, S., and J. Mogul, "Path MTU Discovery 507 for IP version 6", RFC 1981, August 1996. 509 [RFC2460] Deering, S. and R. Hinden, "Internet Protocol, Version 6 510 (IPv6) Specification", RFC 2460, December 1998. 512 [RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 513 Requirements for Security", BCP 106, RFC 4086, June 2005. 515 [RFC5722] Krishnan, S., "Handling of Overlapping IPv6 Fragments", 516 RFC 5722, December 2009. 518 [RFC6056] Larsen, M. and F. Gont, "Recommendations for Transport- 519 Protocol Port Randomization", BCP 156, RFC 6056, January 520 2011. 522 [RFC6145] Li, X., Bao, C., and F. Baker, "IP/ICMP Translation 523 Algorithm", RFC 6145, April 2011. 525 [RFC6946] Gont, F., "Processing of IPv6 "Atomic" Fragments", RFC 526 6946, May 2013. 528 8.2. Informative References 530 [RFC4963] Heffner, J., Mathis, M., and B. Chandler, "IPv4 Reassembly 531 Errors at High Data Rates", RFC 4963, July 2007. 533 [RFC5927] Gont, F., "ICMP Attacks against TCP", RFC 5927, July 2010. 535 [RFC6274] Gont, F., "Security Assessment of the Internet Protocol 536 Version 4", RFC 6274, July 2011. 538 [I-D.ietf-6man-deprecate-atomfrag-generation] 539 Gont, F., Will, W., and t. tore, "Deprecating the 540 Generation of IPv6 Atomic Fragments", draft-ietf-6man- 541 deprecate-atomfrag-generation-00 (work in progress), 542 November 2014. 544 [Bellovin2002] 545 Bellovin, S., "A Technique for Counting NATted Hosts", 546 IMW'02 Nov. 6-8, 2002, Marseille, France, 2002. 548 [CPNI-IPv6] 549 Gont, F., "Security Assessment of the Internet Protocol 550 version 6 (IPv6)", UK Centre for the Protection of 551 National Infrastructure, (available on request). 553 [Fyodor2004] 554 Fyodor, , "Idle scanning and related IP ID games", 2004, 555 . 557 [Herzberg2013] 558 Herzberg, A. and H. Shulman, "Fragmentation Considered 559 Poisonous", Technical Report 13-03, March 2013, 560 . 562 [Klein2007] 563 Klein, A., "OpenBSD DNS Cache Poisoning and Multiple O/S 564 Predictable IP ID Vulnerability", 2007, 565 . 568 [Sanfilippo1998a] 569 Sanfilippo, S., "about the ip header id", Post to Bugtraq 570 mailing-list, Mon Dec 14 1998, 571 . 573 [Sanfilippo1998b] 574 Sanfilippo, S., "Idle scan", Post to Bugtraq mailing-list, 575 1998, . 577 [Sanfilippo1999] 578 Sanfilippo, S., "more ip id", Post to Bugtraq mailing- 579 list, 1999, 580 . 582 [SI6-IPv6] 583 "SI6 Networks' IPv6 toolkit", 584 . 586 [Zalewski2003] 587 Zalewski, M., "A new TCP/IP blind data injection 588 technique?", Post to Bugtraq mailing-list, Thu, 11 Dec 589 2003 00:28:28 +0100 (CET), 2003, 590 . 592 Appendix A. Information leakage produced by vulnerable implementations 594 Section 2 provides a number of references describing a number of ways 595 in which a vulnerable implementation may reveal the Fragment 596 Identification values to be used in subsequent packets, thus opening 597 the door to a number of attacks. In all of those scenarios, a 598 vulnerable implementation leaks/reveals its own Identification 599 number. 601 This section presents a attack scenario, in which a vulnerable 602 implementation leaks/reveals the Identification number of a non- 603 vulnerable implementation. That is, a vulnerable implementation 604 (Host A) leaks the current Fragment Identification value in use by a 605 third-party host (Host B) to send fragmented datagrams from Host B to 606 Host A. 608 For the most part, this section is included to illustrate how a 609 vulnerable implementation might be leveraged to leak-out the 610 Fragment Identification value of an otherwise non-vulnerable 611 implementation. 613 The following scenarios assume: 615 Host A: 616 Is an IPv6 host that implements the the algorithm specified in 617 Section 4.1, implements [RFC5722], but does not implement 618 [RFC6946]. 620 Host B: 621 Victim node. Selects the Fragment Identification values from a 622 global counter. 624 Host C: 626 Attacker. Can forge the IPv6 Source Address of his packets at 627 will. 629 In the following scenarios, large ICMPv6 Echo Request packets are 630 employed to "sample" the Fragment Identification value of a host. We 631 note that while the figures show only one packet for the ICMPv6 Echo 632 Request and the ICMPv6 Echo Response, each of those packets will 633 typically comprise two fragments, such that the corresponding 634 unfragmented datagram is larger than the MTU of the networks to which 635 Host B and Host C are attached. 637 In lines #1-#2 (and lines #8-#9), the attacker samples the current 638 Fragment Identification value. In line #3, the attacker sends a 639 forged TCP SYN segment to Host A. If corresponding TCP port is 640 closed, and the attacker fails when trying to produce a collision of 641 Fragment Identifications (see line #4), the following packet exchange 642 might take place: 644 A B C 646 #1 <------ Echo Req #1 ----------- 647 #2 --- Echo Resp #1, FID=5000 ---> 648 #3 <------------------- SYN #1, src= B ----------------------- 649 #4 <--- SYN/ACK, FID=42 src = A--- 650 #5 ---- SYN/ACK, FID=9000 ---> 651 #6 <----- RST, FID= 5001 ----- 652 #7 <----- RST, FID= 5002 ----- 653 #8 <-------- Echo Req #2 --------- 654 #9 --- Echo Resp #2, FID=5003 ---> 656 The two RST segments are elicited by the SYN/ACK segment from line 657 #4, and the (illegitimately elicited by the SYN in line #3) SYN/ACK 658 segment from line #5. On the other hand, if the attacker succeeds to 659 produce a collision of Fragment Identification values, the following 660 packet exchange could take place: 662 A B C 664 #1 <------- Echo Req #1 ---------- 665 #2 --- Echo Resp #1, FID=5000 ---> 666 #3 <------------------- SYN #1, src= B ----------------------- 667 #4 <-- SYN/ACK, FID=9000 src=A --- 668 #5 ---- SYN/ACK, FID=9000 ---> 669 ... (RFC5722) ... 670 #6 <------- Echo Req #2 ---------- 671 #7 ---- Echo Resp #2, FID=5001 --> 672 Clearly, the Fragment Identification value sampled from the second 673 ICMPv6 Echo Response packet ("Echo Resp #2") implicitly indicates 674 whether the Fragment Identification in the forged SYN/ACK (see line 675 #4 in both figures) was the current Fragment Identification in use by 676 Host A. 678 As a result, the attacker could employ this technique to learn the 679 current Fragment Identification value used by host A to send packets 680 to host B, even when Host A itself has a non-vulnerable 681 implementation. 683 Appendix B. Survey of Fragment Identification selection algorithms 684 employed by popular IPv6 implementations 686 This section includes a survey of the Fragment Identification 687 selection algorithms employed in some popular operating systems. 689 The survey was produced with the SI6 Networks IPv6 toolkit 690 [SI6-IPv6]. 692 +-----------------------+-------------------------------------------+ 693 | Operating System | Algorithm | 694 +-----------------------+-------------------------------------------+ 695 | FreeBSD 9.0 | Unpredictable (Random) | 696 +-----------------------+-------------------------------------------+ 697 | Linux 3.0.0-15 | Predictable (Global Counter, Init=0, | 698 | | Incr=1) | 699 +-----------------------+-------------------------------------------+ 700 | Linux-current | Unpredictable (Per-dest Counter, | 701 | | Init=random, Incr=1) | 702 +-----------------------+-------------------------------------------+ 703 | NetBSD 5.1 | Unpredictable (Random) | 704 +-----------------------+-------------------------------------------+ 705 | OpenBSD-current | Random (SKIP32) | 706 +-----------------------+-------------------------------------------+ 707 | Solaris 10 | Predictable (Per-dst Counter, Init=0, | 708 | | Incr=1) | 709 +-----------------------+-------------------------------------------+ 710 | Windows XP SP2 | Predictable (Global Counter, Init=0, | 711 | | Incr=2) | 712 +-----------------------+-------------------------------------------+ 713 | Windows Vista (Build | Predictable (Global Counter, Init=0, | 714 | 6000) | Incr=2) | 715 +-----------------------+-------------------------------------------+ 716 | Windows 7 Home | Predictable (Global Counter, Init=0, | 717 | Premium | Incr=2) | 718 +-----------------------+-------------------------------------------+ 720 Table 1: Fragment Identification algorithms employed by different 721 OSes 723 In the text above, "predictable" should be taken as "easily 724 guessable by an off-path attacker, by sending a few probe 725 packets". 727 Author's Address 729 Fernando Gont 730 SI6 Networks / UTN-FRH 731 Evaristo Carriego 2644 732 Haedo, Provincia de Buenos Aires 1706 733 Argentina 735 Phone: +54 11 4650 8472 736 Email: fgont@si6networks.com 737 URI: http://www.si6networks.com