idnits 2.17.1 draft-ietf-v6ops-tunnel-loops-00.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 (September 12, 2010) is 4969 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 ---------------------------------------------------------------------------- No issues found here. Summary: 0 errors (**), 0 flaws (~~), 1 warning (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group G. Nakibly 3 Internet-Draft National EW Research & 4 Intended status: Informational Simulation Center 5 Expires: March 16, 2011 F. Templin 6 Boeing Research & Technology 7 September 12, 2010 9 Routing Loop Attack using IPv6 Automatic Tunnels: Problem Statement and 10 Proposed Mitigations 11 draft-ietf-v6ops-tunnel-loops-00.txt 13 Abstract 15 This document is concerned with security vulnerabilities in IPv6-in- 16 IPv4 automatic tunnels. These vulnerabilities allow an attacker to 17 take advantage of inconsistencies between the IPv4 routing state and 18 the IPv6 routing state. The attack forms a routing loop which can be 19 abused as a vehicle for traffic amplification to facilitate DoS 20 attacks. The first aim of this document is to inform on this attack 21 and its root causes. The second aim is to present some possible 22 mitigation measures. 24 Status of this Memo 26 This Internet-Draft is submitted in full conformance with the 27 provisions of BCP 78 and BCP 79. 29 Internet-Drafts are working documents of the Internet Engineering 30 Task Force (IETF). Note that other groups may also distribute 31 working documents as Internet-Drafts. The list of current Internet- 32 Drafts is at http://datatracker.ietf.org/drafts/current/. 34 Internet-Drafts are draft documents valid for a maximum of six months 35 and may be updated, replaced, or obsoleted by other documents at any 36 time. It is inappropriate to use Internet-Drafts as reference 37 material or to cite them other than as "work in progress." 39 This Internet-Draft will expire on March 16, 2011. 41 Copyright Notice 43 Copyright (c) 2010 IETF Trust and the persons identified as the 44 document authors. All rights reserved. 46 This document is subject to BCP 78 and the IETF Trust's Legal 47 Provisions Relating to IETF Documents 48 (http://trustee.ietf.org/license-info) in effect on the date of 49 publication of this document. Please review these documents 50 carefully, as they describe your rights and restrictions with respect 51 to this document. Code Components extracted from this document must 52 include Simplified BSD License text as described in Section 4.e of 53 the Trust Legal Provisions and are provided without warranty as 54 described in the Simplified BSD License. 56 Table of Contents 58 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 59 2. A Detailed Description of the Attack . . . . . . . . . . . . . 3 60 3. Proposed Mitigation Measures . . . . . . . . . . . . . . . . . 6 61 3.1. Destination and Source Address Checks . . . . . . . . . . 6 62 3.1.1. Known IPv6 Prefix Check . . . . . . . . . . . . . . . 7 63 3.2. Verification of end point existence . . . . . . . . . . . 8 64 3.2.1. Neighbor Cache Check . . . . . . . . . . . . . . . . . 8 65 3.2.2. Known IPv4 Address Check . . . . . . . . . . . . . . . 9 66 3.2.3. Neighbor Reachability Check . . . . . . . . . . . . . 9 67 3.3. Operational Measures . . . . . . . . . . . . . . . . . . . 10 68 3.3.1. Avoiding a Shared IPv4 Link . . . . . . . . . . . . . 10 69 3.3.2. A Single Border Router . . . . . . . . . . . . . . . . 10 70 4. Recommendations . . . . . . . . . . . . . . . . . . . . . . . 11 71 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 11 72 6. Security Considerations . . . . . . . . . . . . . . . . . . . 11 73 7. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 12 74 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 12 75 8.1. Normative References . . . . . . . . . . . . . . . . . . . 12 76 8.2. Informative References . . . . . . . . . . . . . . . . . . 12 77 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 12 79 1. Introduction 81 IPv6-in-IPv4 tunnels are an essential part of many migration plans 82 for IPv6. They allow two IPv6 nodes to communicate over an IPv4-only 83 network. Automatic tunnels form a category of tunnels in which a 84 packet's egress node's IPv4 address is embedded within the 85 destination IPv6 address of the packet. A tunnel's router is a 86 router that encapsulates and decapsulates the IPv6 packets into and 87 out of the tunnel, respectively. Ref. [USENIX09] pointed out the 88 existence of a vulnerability in the design of IPv6 automatic tunnels. 89 Tunnel routers operate on the implicit assumption that the 90 destination address of an incoming IPv6 packet is always an address 91 of a valid node that can be reached via the tunnel. This assumption 92 poses a security vulnerability since it may result in an 93 inconsistency between the IPv4 routing state and the IPv6 routing 94 state there by allowing a routing loop to be formed. 96 An attacker can exploit this vulnerability by crafting a packet which 97 is routed over a tunnel to a node that is not participating in that 98 tunnel. This node may forward the packet out of the tunnel to the 99 native IPv6 network. There the packet is routed back to the ingress 100 point that forwards it back into the tunnel. Consequently, the 101 packet loops in and out of the tunnel. The loop terminates only when 102 the Hop Limit field in the IPv6 header of the packet is decremented 103 to zero. 105 Unless proper security measures are in place all IPv6 automatic 106 tunnels that are based on protocol-41 encapsulation are vulnerable to 107 such an attack, in particular, ISATAP [RFC5214], 6to4 [RFC3056] and 108 6rd [RFC5569]. The aim of this document is to shed light on the 109 routing loop attack and present some possible mitigation measures 110 that should be considered by operators of current IPv6 automatic 111 tunnels and by designers of future ones. We note that tunnels may be 112 deployed in various operational environments, e.g. service provider 113 network, enterprise network, etc. Specific issues related to the 114 attack which are derived from the operational environment are not 115 considered in this document. 117 2. A Detailed Description of the Attack 119 In this section we shall denote an IPv6 address of a node reached via 120 a given tunnel by the prefix of the tunnel and an IPv4 address of the 121 tunnel end point, i.e., Addr(Prefix, IPv4). Note that the IPv4 122 address may or may not be part of the prefix (depending on the 123 specification of the tunnel's protocol). The IPv6 address may be 124 dependent on additional bits in the interface ID, however for our 125 discussion their exact value is not important. 127 The two victims of this attack are routers - R1 and R2 - of two 128 different tunnels - T1 and T2. Both routers have the capability to 129 forward IPv6 packets in and out of their respective tunnels. The two 130 tunnels need not be based on the same tunnel protocol. The only 131 condition is that the two tunnel protocols be based on protocol-41 132 encapsulation. The IPv4 address of R1 is IP1, while the prefix of 133 its tunnel is Prf1. IP2 and Prf2 are the respective values for R2. 134 We assume that IP1 and IP2 belong to the same address realm, i.e., 135 they are either both public, or both private and belong to the same 136 internal network. The following network diagram depicts the 137 locations of the two routers. 139 ####### 140 # R1 # 141 ####### 142 // \ 143 T1 // \ 144 interface // \ 145 _______________//_ __\________________ 146 | | | | 147 | IPv4 Network | | IPv6 Network | 148 |__________________| |___________________| 149 \\ / 150 \\ / 151 T2 \\ / 152 interface \\ / 153 ####### 154 # R2 # 155 ####### 157 Figure 1: The network setting of the attack 159 The attack is depicted in Figure 2. It is initiated by sending an 160 IPv6 packet (packet 0 in Figure 2) destined to a fictitious end point 161 that appears to be reached via T2 and has IP1 as its IPv4 address, 162 i.e., Addr(Prf2, IP1). The source address of the packet is a T1 163 address with Prf1 as the prefix and IP2 as the embedded IPv4 address, 164 i.e., Addr(Prf1, IP2). As the prefix of the destination address is 165 Prf2, the packet will be routed over the IPv6 network to T2. 167 We assume that R2 is the packet's entry point to T2. R2 receives the 168 packet through its IPv6 interface and forwards it over its T2 169 interface encapsulated with an IPv4 header having a destination 170 address derived from the IPv6 destination, i.e., IP1. The source 171 address is the address of R2, i.e., IP2. The packet (packet 1 in 172 Figure 2.) is routed over the IPv4 network to R1, which receives the 173 packet on its IPv4 interface. It processes the packet as a packet 174 that originates from one of the end nodes of T1. 176 Since the IPv4 source address corresponds to the IPv6 source address, 177 R1 will decapsulate the packet. Since the packet's IPv6 destination 178 is outside of T1, R1 will forward the packet onto a native IPv6 179 interface. The forwarded packet (packet 2 in Figure 2) is identical 180 to the original attack packet. Hence, it is routed back to R2, in 181 which the loop starts again. Note that the packet may not 182 necessarily be transported from R1 over native IPv6 network. R1 may 183 be connected to the IPv6 network through another tunnel. 185 R1 R2 186 | | 0 187 | 1 |<------ 188 |<===============| 189 | 2 | 190 |--------------->| 191 | . | 192 | . | 194 1 - IPv4: IP2 --> IP1 195 IPv6: Addr(Prf1,IP2) --> Addr(Prf2,IP1) 196 0,2- IPv6: Addr(Prf1,IP2) --> Addr(Prf2,IP1) 198 Legend: ====> - tunneled IPv6, ---> - native IPv6 200 Figure 2: Routing loop attack between two tunnels' routers 202 The crux of the attack is as follows. The attacker exploits the fact 203 that R2 does not know that R1 does not take part of T2 and that R1 204 does not know that R2 does not take part of T1. The IPv4 network 205 acts as a shared link layer for the two tunnels. Hence, the packet 206 is repeatedly forwarded by both routers. It is noted that the attack 207 will fail when the IPv4 network can not transport packets between the 208 tunnels. For example, when the two routers belong to different IPv4 209 address realms or when ingress/egress filtering is exercised between 210 the routes. 212 The loop will stop when the Hop Limit field of the packet reaches 213 zero. After a single loop the Hop Limit field is decreased by the 214 number of IPv6 routers on path from R1 and R2. Therefore, the number 215 of loops is inversely proportional to the number of IPv6 hops between 216 R1 and R2. 218 The tunnel pair T1 and T2 may be any combination of automatic tunnel 219 types, e.g., ISATAP, 6to4 and 6rd. This has the exception that both 220 tunnels can not be of type 6to4, since two 6to4 routers can not 221 belong to different tunnels (there is only one 6to4 tunnel in the 222 Internet). For example, if the attack were to be launched on an 223 ISATAP router (R1) and 6to4 relay (R2), then the destination and 224 source addresses of the attack packet would be 2002:IP1:* and Prf1:: 225 0200:5EFE:IP2, respectively. 227 3. Proposed Mitigation Measures 229 This section presents some possible mitigation measures for the 230 attack described above. For each measure we shall discuss its 231 advantages and disadvantages. 233 The proposed measures fall under the following two categories: 235 o Destination and source addresses checks 237 o Verification of end point existence 239 o Operational measures 241 3.1. Destination and Source Address Checks 243 Tunnel routers can use a source address check mitigation when they 244 forward an IPv6 packet into a tunnel interface with an IPv6 source 245 address that embeds one of the router's configured IPv4 addresses. 246 Similarly, tunnel routers can use a destination address check 247 mitigation when they receive an IPv6 packet on a tunnel interface 248 with an IPv6 destination address that embeds one of the router's 249 configured IPv4 addresses. These checks should correspond to both 250 tunnels' IPv6 address formats, regardless of the type of tunnel the 251 router employs. 253 For example, if tunnel router R1 (of any tunnel protocol) forwards a 254 packet into a tunnel interface with an IPv6 source address that 255 matches the 6to4 prefix 2002:IP1::/48, the router discards the packet 256 if IP1 is one of its own IPv4 addresses. In a second example, if 257 tunnel router R2 receives an IPv6 packet on a tunnel interface with 258 an IPv6 destination address with an off-link prefix but with an 259 interface identifier that matches the ISATAP address suffix ::0200: 260 5EFE:IP2, the router discards the packet if IP2 is one of its own 261 IPv4 addresses. 263 Hence a tunnel router can avoid the attack by performing the 264 following checks: 266 o When the router forwards an IPv6 packet into a tunnel interface, 267 it discards the packet if the IPv6 source address has an off-link 268 prefix but embeds one of the router's configured IPv4 addresses. 270 o When the router receives an IPv6 packet on a tunnel interface, it 271 discards the packet if the IPv6 destination address has an off- 272 link prefix but embeds one of the router's configured IPv4 273 addresses. 275 This approach has the advantage that that no ancillary state is 276 required, since checking is through static lookup in the lists of 277 IPv4 and IPv6 addresses belonging to the router. However, this 278 approach has some inherit limitations: 280 o The checks incur an overhead which is proportional to the number 281 of IPv4 addresses assigned to the router. If a router is assigned 282 many addresses, the additional processing overhead for each packet 283 may be considerable. 285 o The checks should be performed for the IPv6 address formats of 286 every existing automatic IPv6 tunnel protocol (which uses 287 protocol-41 encapsulation). Hence, the checks must be updated as 288 new protocols are defined. 290 o Before the checks can be performed the format of the address must 291 be recognized. There is no guarantee that this can be generally 292 done. For example, one can not determine if an IPv6 address is a 293 6rd one, hence a configuration is needed at the router. 295 o The checks cannot be performed if the embedded IPv4 address is a 296 private one [RFC1918] since it is ambiguous in scope. Namely, the 297 private address may be legitimately allocated to another node in 298 another routing region. 300 The last limitation may be relieved if the router has some 301 information that allows it to unambiguously determine the scope of 302 the address. The check in the following subsection is one example 303 for this. 305 3.1.1. Known IPv6 Prefix Check 307 A router may be configured with the full list of IPv6 subnet prefixes 308 assigned to the tunnels attached to its current IPv4 routing region. 309 In such a case it can use the list to determine when static 310 destination and source address checks are possible. By keeping track 311 of the list of IPv6 prefixes assigned to the tunnels in the IPv4 312 routing region, a router can perform the following checks on an 313 address which embeds a private IPv4 address: 315 o When the router forwards an IPv6 packet into its tunnel with a 316 source address that embeds a private IPv4 address and matches an 317 IPv6 prefix in the prefix list, it determines whether the packet 318 should be discarded or forwarded by performing the source address 319 check specified in Section 3.1. Otherwise, the router forwards 320 the packet. 322 o When the router receives an IPv6 packet on its tunnel interface 323 with a destination address that embeds a private IPv4 address and 324 matches an IPv6 prefix in the prefix list, it determines whether 325 the packet should be discarded or forwarded by performing the 326 destination address check specified in Section 3.1. Otherwise, 327 the router forwards the packet. 329 The disadvantage of this approach is the administrative overhead for 330 maintaining the list of IPv6 subnet prefixes associated with an IPv4 331 routing region may become unwieldy should that list be long and/or 332 frequently updated. 334 3.2. Verification of end point existence 336 The routing loop attack relies on the fact that a router does not 337 know whether there is an end point that can reached via its tunnel 338 that has the source or destination address of the packet. This 339 category includes mitigation measures which aim to verify that there 340 is a node which participate in the tunnel and its address corresponds 341 to the packet's destination or source addresses, as appropriate. 343 3.2.1. Neighbor Cache Check 345 One way to verify that an end point exists in a tunnel is by checking 346 whether a valid entry exists for it in the Neighbor Cache of the 347 corresponding tunnel interface. A valid entry may exist in the 348 Neighbor Cache for legitimate end hosts if they generate traffic 349 towards the router upon startup. For example, an initial RS/RA 350 exchange to facilitate Stateless Address Auto configuration (as in 351 the ISATAP case). This allows the router to keep valid Neighbor 352 Cache entry for each legitimate end host in the tunnel. 354 By keeping track of the legitimate hosts in the tunnel via the 355 Neighbor Cache, a router can perform the following simple checks: 357 o When the router forwards a packet into the tunnel with an IPv6 358 destination address that matches an on-link prefix and that embeds 359 the IPv4 address IP1, it discards the packet if there is no 360 corresponding neighbor cache entry. 362 o When the router receives a packet on the tunnel's interface with 363 an IPv6 source address that matches an on-link prefix and that 364 embeds the IPv4 address IP2, it discards the packet if there is no 365 corresponding neighbor cache entry. 367 This approach is easy to implement, and naturally leverages the fact 368 that an end host must successively send RSs in order to refresh 369 configuration information as on-link prefix information. However, 370 this requires the router to retain entries for a duration that is at 371 least as long as the router's advertised prefix lifetimes. This may 372 require an implementation to adjust its garbage-collection interval 373 for stale neighbor cache entries. 375 Finally, this approach assumes that the neighbor cache will remain 376 coherent and not subject to malicious attack, which must be confirmed 377 based on specific deployment scenarios. One possible way for an 378 attacker to subvert the neighbor cache is to send false RS messages 379 with a spoofed source address. 381 3.2.2. Known IPv4 Address Check 383 Another approach that enables a router to verify that an end host 384 exists and can be reached via the tunnel is simply by pre-configuring 385 the router with the set of IPv4 addresses that are authorized to use 386 the tunnel. Upon this configuration the router can perform the 387 following simple checks: 389 o When the router forwards an IPv6 packet into the tunnel interface 390 with a destination address that matches an on-link prefix and that 391 embeds the IPv4 address IP1, it discards the packet if IP1 does 392 not belong to the configured list of IPv4 addresses. 394 o When the router receives an IPv6 packet on the tunnel's interface 395 with a source address that matches a on-link prefix and that 396 embeds the IPv4 address IP2, it discards the packet if IP2 does 397 not belong to the configured list of IPv4 addresses. 399 3.2.3. Neighbor Reachability Check 401 Yet another approach that allows a router to verify that an end host 402 exists and can be reached via the tunnel is by performing an initial 403 reachability confirmation, e.g., as specified in the second paragraph 404 of Section 8.4 of [RFC5214]. This procedure parallels the address 405 resolution specifications in Section 7.2 of [RFC4861], i.e., the 406 router maintains a small queue of packets waiting for reachability 407 confirmation to complete. If confirmation succeeds, the router 408 discovers that a legitimate neighbor responds to the address and 409 packets may be forwarded to it. Otherwise, the router returns ICMP 410 destination unreachable indications as specified in Section 7.2.2 of 411 [RFC4861]. 413 3.3. Operational Measures 415 The following measures can be taken by the network operator. Their 416 aim is to configure the network in such a way that the attacks can 417 not take place. 419 3.3.1. Avoiding a Shared IPv4 Link 421 As noted above, the attack relies on having an IPv4 network as a 422 shared link-layer between more than one tunnel. From this the 423 following two mitigation measures arise: 425 3.3.1.1. Filtering IPv4 Protocol-41 Packets 427 In this measure a tunnel router may drop all IPv4 protocol-41 packets 428 received or sent over interfaces that are attached to an untrusted 429 IPv4 network. This will cut-off any IPv4 network as a shared link. 430 This measure has the advantage of simplicity. However, such a 431 measure may not always be suitable for scenarios where IPv4 432 connectivity is essential on all interfaces. 434 3.3.1.2. Operational Avoidance of Multiple Tunnels 436 This measure mitigates the attack by simply allowing for a single 437 IPv6 tunnel to operate in a bounded IPv4 network (e.g., a small home 438 IPv4 network behind a residential gateway serving as a tunnel 439 router). In particular, if there are only one or a few tunnel 440 routers in the IPv4 network and all participate in the same tunnel 441 then there is no opportunity for perpetuating the loop. 443 This approach has the advantage that it avoids the attack profile 444 altogether without need for explicit mitigations. However, it 445 requires careful configuration management which may not be tenable in 446 large and/or unbounded IPv4 networks. 448 3.3.2. A Single Border Router 450 It is reasonable to assume that a tunnel router shall accept or 451 forward tunneled packets only over its tunnel interface. It is also 452 reasonable to assume that a tunnel router shall accept or forward 453 IPv6 packets only over its IPv6 interface. If these two interfaces 454 are physically different then the network operator can mitigate the 455 attack by ensuring that the following condition holds: there is no 456 path between these two interfaces that does not go through the tunnel 457 router. 459 The above condition ensures that an encapsulated packet which is 460 transmitted over the tunnel interface will not get to another tunnel 461 router and from there to the IPv6 interface of the first router. The 462 condition also ensures the reverse direction, i.e., an IPv6 packet 463 which is transmitted over the IPv6 interface will not get to another 464 tunnel router and from there to the tunnel interface of the first 465 router. This condition is essentially translated to a scenario in 466 which the tunnel router is the only border router between the IPv6 467 network and the IPv4 network to which it is attached. 469 4. Recommendations 471 In light of the mitigation measures proposed above we make the 472 following recommendations in decreasing order: 474 1. When possible, it is recommended that the attacks are 475 operationally eliminated (as per one of the measures proposed in 476 Section 3.3). 478 2. For tunnel routers that keep a coherent and trusted neighbor 479 cache which includes all legitimate end-points of the tunnel, we 480 recommend exercising the Neighbor Cache Check. 482 3. For tunnel routers that can implement the Neighbor Reachability 483 Check, we recommend exercising it. 485 4. For tunnels having small and static list of end-points we 486 recommend exercising Known IPv4 Address Check. 488 5. For all other cases we recommend the Destination and Source 489 Address Checks. 491 As noted earlier, tunnels may be deployed in various operational 492 environments. There is a possibility that other mitigation measures 493 may be allowed is specific deployment scenarios. The above 494 recommendations are general and do not attempt to cover such 495 scenarios. 497 5. IANA Considerations 499 This document has no IANA considerations. 501 6. Security Considerations 503 This document aims at presenting possible solutions to the routing 504 loop attack which involves automatic tunnels' routers. It contains 505 various checks that aim to recognize and drop specific packets that 506 have strong potential to cause a routing loop. These checks do not 507 introduce new security threats. 509 7. Acknowledgments 511 This work has benefited from discussions on the V6OPS, 6MAN and 512 SECDIR mailing lists. Remi Despres, Christian Huitema, Dmitry 513 Anipko, Dave Thaler and Fernando Gont are acknowledged for their 514 contributions. 516 8. References 518 8.1. Normative References 520 [RFC1918] Rekhter, Y., Moskowitz, R., Karrenberg, D., Groot, G., and 521 E. Lear, "Address Allocation for Private Internets", 522 BCP 5, RFC 1918, February 1996. 524 [RFC3056] Carpenter, B. and K. Moore, "Connection of IPv6 Domains 525 via IPv4 Clouds", RFC 3056, February 2001. 527 [RFC4861] Narten, T., Nordmark, E., Simpson, W., and H. Soliman, 528 "Neighbor Discovery for IP version 6 (IPv6)", RFC 4861, 529 September 2007. 531 [RFC5214] Templin, F., Gleeson, T., and D. Thaler, "Intra-Site 532 Automatic Tunnel Addressing Protocol (ISATAP)", RFC 5214, 533 March 2008. 535 [RFC5569] Despres, R., "IPv6 Rapid Deployment on IPv4 536 Infrastructures (6rd)", RFC 5569, January 2010. 538 8.2. Informative References 540 [USENIX09] 541 Nakibly, G. and M. Arov, "Routing Loop Attacks using IPv6 542 Tunnels", USENIX WOOT, August 2009. 544 Authors' Addresses 546 Gabi Nakibly 547 National EW Research & Simulation Center 548 P.O. Box 2250 (630) 549 Haifa 31021 550 Israel 552 Email: gnakibly@yahoo.com 554 Fred L. Templin 555 Boeing Research & Technology 556 P.O. Box 3707 MC 7L-49 557 Seattle, WA 98124 558 USA 560 Email: fltemplin@acm.org