idnits 2.17.1 draft-ietf-v6ops-tunnel-loops-01.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 (November 9, 2010) is 4916 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: May 13, 2011 F. Templin 6 Boeing Research & Technology 7 November 9, 2010 9 Routing Loop Attack using IPv6 Automatic Tunnels: Problem Statement and 10 Proposed Mitigations 11 draft-ietf-v6ops-tunnel-loops-01.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 May 13, 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 . . . . . . . . . . . . . . . . . . . . . 12 72 6. Security Considerations . . . . . . . . . . . . . . . . . . . 12 73 7. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 12 74 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 12 75 8.1. Normative References . . . . . . . . . . . . . . . . . . . 12 76 8.2. Informative References . . . . . . . . . . . . . . . . . . 12 77 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 13 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 that use stateless address mapping 84 (hereafter called "automatic tunnels") are a category of tunnels in 85 which a tunneled packet's egress IPv4 address is embedded within the 86 destination IPv6 address of the packet. An automatic tunnel's router 87 is a router that respectively encapsulates and decapsulates the IPv6 88 packets into and out of the tunnel. 90 Ref. [USENIX09] pointed out the existence of a vulnerability in the 91 design of IPv6 automatic tunnels. Tunnel routers operate on the 92 implicit assumption that the destination address of an incoming IPv6 93 packet is always an address of a valid node that can be reached via 94 the tunnel. The assumption of path validity poses a denial of 95 service risk as inconsistency between the IPv4 routing state and the 96 IPv6 routing state allows a routing loop to be formed. 98 An attacker can exploit this vulnerability by crafting a packet which 99 is routed over a tunnel to a node that is not participating in that 100 tunnel. This node may forward the packet out of the tunnel to the 101 native IPv6 network. There the packet is routed back to the ingress 102 point that forwards it back into the tunnel. Consequently, the 103 packet loops in and out of the tunnel. The loop terminates only when 104 the Hop Limit field in the IPv6 header of the packet is decremented 105 to zero. 107 Without compensating security measures in place, all IPv6 automatic 108 tunnels that are based on protocol-41 encapsulation are vulnerable to 109 such an attack including ISATAP [RFC5214], 6to4 [RFC3056] and 6rd 110 [RFC5569]. 112 The aim of this document is to shed light on the routing loop attack 113 and describe possible mitigation measures that should be considered 114 by operators of current IPv6 automatic tunnels and by designers of 115 future ones. We note that tunnels may be deployed in various 116 operational environments, e.g. service provider network, enterprise 117 network, etc. Specific issues related to the attack which are 118 derived from the operational environment are not considered in this 119 document. 121 2. A Detailed Description of the Attack 123 In this section we shall denote an IPv6 address of a node reached via 124 a given tunnel by the prefix of the tunnel and an IPv4 address of the 125 tunnel end point, i.e., Addr(Prefix, IPv4). Note that the IPv4 126 address may or may not be part of the prefix (depending on the 127 specification of the tunnel's protocol). The IPv6 address may be 128 dependent on additional bits in the interface ID, however for our 129 discussion their exact value is not important. 131 The two victims of this attack are routers - R1 and R2 - of two 132 different tunnels - T1 and T2. Both routers have the capability to 133 forward IPv6 packets in and out of their respective tunnels. The two 134 tunnels need not be based on the same tunnel protocol. The only 135 condition is that the two tunnel protocols be based on protocol-41 136 encapsulation. The IPv4 address of R1 is IP1, while the prefix of 137 its tunnel is Prf1. IP2 and Prf2 are the respective values for R2. 138 We assume that IP1 and IP2 belong to the same address realm, i.e., 139 they are either both public, or both private and belong to the same 140 internal network. The following network diagram depicts the 141 locations of the two routers. 143 ####### 144 # R1 # 145 ####### 146 // \ 147 T1 // \ 148 interface // \ 149 _______________//_ __\________________ 150 | | | | 151 | IPv4 Network | | IPv6 Network | 152 |__________________| |___________________| 153 \\ / 154 \\ / 155 T2 \\ / 156 interface \\ / 157 ####### 158 # R2 # 159 ####### 161 Figure 1: The network setting of the attack 163 The attack is depicted in Figure 2. It is initiated by sending an 164 IPv6 packet (packet 0 in Figure 2) destined to a fictitious end point 165 that appears to be reached via T2 and has IP1 as its IPv4 address, 166 i.e., Addr(Prf2, IP1). The source address of the packet is a T1 167 address with Prf1 as the prefix and IP2 as the embedded IPv4 address, 168 i.e., Addr(Prf1, IP2). As the prefix of the destination address is 169 Prf2, the packet will be routed over the IPv6 network to T2. 171 We assume that R2 is the packet's entry point to T2. R2 receives the 172 packet through its IPv6 interface and forwards it over its T2 173 interface encapsulated with an IPv4 header having a destination 174 address derived from the IPv6 destination, i.e., IP1. The source 175 address is the address of R2, i.e., IP2. The packet (packet 1 in 176 Figure 2.) is routed over the IPv4 network to R1, which receives the 177 packet on its IPv4 interface. It processes the packet as a packet 178 that originates from one of the end nodes of T1. 180 Since the IPv4 source address corresponds to the IPv6 source address, 181 R1 will decapsulate the packet. Since the packet's IPv6 destination 182 is outside of T1, R1 will forward the packet onto a native IPv6 183 interface. The forwarded packet (packet 2 in Figure 2) is identical 184 to the original attack packet. Hence, it is routed back to R2, in 185 which the loop starts again. Note that the packet may not 186 necessarily be transported from R1 over native IPv6 network. R1 may 187 be connected to the IPv6 network through another tunnel. 189 R1 R2 190 | | 0 191 | 1 |<------ 192 |<===============| 193 | 2 | 194 |--------------->| 195 | . | 196 | . | 198 1 - IPv4: IP2 --> IP1 199 IPv6: Addr(Prf1,IP2) --> Addr(Prf2,IP1) 200 0,2- IPv6: Addr(Prf1,IP2) --> Addr(Prf2,IP1) 202 Legend: ====> - tunneled IPv6, ---> - native IPv6 204 Figure 2: Routing loop attack between two tunnels' routers 206 The crux of the attack is as follows. The attacker exploits the fact 207 that R2 does not know that R1 does not take part of T2 and that R1 208 does not know that R2 does not take part of T1. The IPv4 network 209 acts as a shared link layer for the two tunnels. Hence, the packet 210 is repeatedly forwarded by both routers. It is noted that the attack 211 will fail when the IPv4 network can not transport packets between the 212 tunnels. For example, when the two routers belong to different IPv4 213 address realms or when ingress/egress filtering is exercised between 214 the routes. 216 The loop will stop when the Hop Limit field of the packet reaches 217 zero. After a single loop the Hop Limit field is decreased by the 218 number of IPv6 routers on path from R1 and R2. Therefore, the number 219 of loops is inversely proportional to the number of IPv6 hops between 220 R1 and R2. 222 The tunnel pair T1 and T2 may be any combination of automatic tunnel 223 types, e.g., ISATAP, 6to4 and 6rd. This has the exception that both 224 tunnels can not be of type 6to4, since two 6to4 routers can not 225 belong to different tunnels (there is only one 6to4 tunnel in the 226 Internet). For example, if the attack were to be launched on an 227 ISATAP router (R1) and 6to4 relay (R2), then the destination and 228 source addresses of the attack packet would be 2002:IP1:* and Prf1:: 229 0200:5EFE:IP2, respectively. 231 3. Proposed Mitigation Measures 233 This section presents some possible mitigation measures for the 234 attack described above. For each measure we shall discuss its 235 advantages and disadvantages. 237 The proposed measures fall under the following two categories: 239 o Destination and source addresses checks 241 o Verification of end point existence 243 o Operational measures 245 3.1. Destination and Source Address Checks 247 Tunnel routers can use a source address check mitigation when they 248 forward an IPv6 packet into a tunnel interface with an IPv6 source 249 address that embeds one of the router's configured IPv4 addresses. 250 Similarly, tunnel routers can use a destination address check 251 mitigation when they receive an IPv6 packet on a tunnel interface 252 with an IPv6 destination address that embeds one of the router's 253 configured IPv4 addresses. These checks should correspond to both 254 tunnels' IPv6 address formats, regardless of the type of tunnel the 255 router employs. 257 For example, if tunnel router R1 (of any tunnel protocol) forwards a 258 packet into a tunnel interface with an IPv6 source address that 259 matches the 6to4 prefix 2002:IP1::/48, the router discards the packet 260 if IP1 is one of its own IPv4 addresses. In a second example, if 261 tunnel router R2 receives an IPv6 packet on a tunnel interface with 262 an IPv6 destination address with an off-link prefix but with an 263 interface identifier that matches the ISATAP address suffix ::0200: 264 5EFE:IP2, the router discards the packet if IP2 is one of its own 265 IPv4 addresses. 267 Hence a tunnel router can avoid the attack by performing the 268 following checks: 270 o When the router forwards an IPv6 packet into a tunnel interface, 271 it discards the packet if the IPv6 source address has an off-link 272 prefix but embeds one of the router's configured IPv4 addresses. 274 o When the router receives an IPv6 packet on a tunnel interface, it 275 discards the packet if the IPv6 destination address has an off- 276 link prefix but embeds one of the router's configured IPv4 277 addresses. 279 This approach has the advantage that that no ancillary state is 280 required, since checking is through static lookup in the lists of 281 IPv4 and IPv6 addresses belonging to the router. However, this 282 approach has some inherit limitations: 284 o The checks incur an overhead which is proportional to the number 285 of IPv4 addresses assigned to the router. If a router is assigned 286 many addresses, the additional processing overhead for each packet 287 may be considerable. 289 o The checks should be performed for the IPv6 address formats of 290 every existing automatic IPv6 tunnel protocol (which uses 291 protocol-41 encapsulation). Hence, the checks must be updated as 292 new protocols are defined. 294 o Before the checks can be performed the format of the address must 295 be recognized. There is no guarantee that this can be generally 296 done. For example, one can not determine if an IPv6 address is a 297 6rd one, hence a configuration is needed at the router. 299 o The checks cannot be performed if the embedded IPv4 address is a 300 private one [RFC1918] since it is ambiguous in scope. Namely, the 301 private address may be legitimately allocated to another node in 302 another routing region. 304 The last limitation may be relieved if the router has some 305 information that allows it to unambiguously determine the scope of 306 the address. The check in the following subsection is one example 307 for this. 309 3.1.1. Known IPv6 Prefix Check 311 A router may be configured with the full list of IPv6 subnet prefixes 312 assigned to the tunnels attached to its current IPv4 routing region. 313 In such a case it can use the list to determine when static 314 destination and source address checks are possible. By keeping track 315 of the list of IPv6 prefixes assigned to the tunnels in the IPv4 316 routing region, a router can perform the following checks on an 317 address which embeds a private IPv4 address: 319 o When the router forwards an IPv6 packet into its tunnel with a 320 source address that embeds a private IPv4 address and matches an 321 IPv6 prefix in the prefix list, it determines whether the packet 322 should be discarded or forwarded by performing the source address 323 check specified in Section 3.1. Otherwise, the router forwards 324 the packet. 326 o When the router receives an IPv6 packet on its tunnel interface 327 with a destination address that embeds a private IPv4 address and 328 matches an IPv6 prefix in the prefix list, it determines whether 329 the packet should be discarded or forwarded by performing the 330 destination address check specified in Section 3.1. Otherwise, 331 the router forwards the packet. 333 The disadvantage of this approach is the administrative overhead for 334 maintaining the list of IPv6 subnet prefixes associated with an IPv4 335 routing region may become unwieldy should that list be long and/or 336 frequently updated. 338 3.2. Verification of end point existence 340 The routing loop attack relies on the fact that a router does not 341 know whether there is an end point that can reached via its tunnel 342 that has the source or destination address of the packet. This 343 category includes mitigation measures which aim to verify that there 344 is a node which participate in the tunnel and its address corresponds 345 to the packet's destination or source addresses, as appropriate. 347 3.2.1. Neighbor Cache Check 349 One way to verify that an end point exists in a tunnel is by checking 350 whether a valid entry exists for it in the Neighbor Cache of the 351 corresponding tunnel interface. A valid entry may exist in the 352 Neighbor Cache for legitimate end hosts if they generate traffic 353 towards the router upon startup. For example, an initial RS/RA 354 exchange to facilitate Stateless Address Auto configuration (as in 355 the ISATAP case). This allows the router to keep valid Neighbor 356 Cache entry for each legitimate end host in the tunnel. 358 By keeping track of the legitimate hosts in the tunnel via the 359 Neighbor Cache, a router can perform the following simple checks: 361 o When the router forwards a packet into the tunnel with an IPv6 362 destination address that matches an on-link prefix and that embeds 363 the IPv4 address IP1, it discards the packet if there is no 364 corresponding neighbor cache entry. 366 o When the router receives a packet on the tunnel's interface with 367 an IPv6 source address that matches an on-link prefix and that 368 embeds the IPv4 address IP2, it discards the packet if there is no 369 corresponding neighbor cache entry. 371 This approach is easy to implement, and naturally leverages the fact 372 that an end host must successively send RSs in order to refresh 373 configuration information as on-link prefix information. However, 374 this requires the router to retain entries for a duration that is at 375 least as long as the router's advertised prefix lifetimes. This may 376 require an implementation to adjust its garbage-collection interval 377 for stale neighbor cache entries. 379 Finally, this approach assumes that the neighbor cache will remain 380 coherent and not subject to malicious attack, which must be confirmed 381 based on specific deployment scenarios. One possible way for an 382 attacker to subvert the neighbor cache is to send false RS messages 383 with a spoofed source address. 385 3.2.2. Known IPv4 Address Check 387 Another approach that enables a router to verify that an end host 388 exists and can be reached via the tunnel is simply by pre-configuring 389 the router with the set of IPv4 addresses that are authorized to use 390 the tunnel. Upon this configuration the router can perform the 391 following simple checks: 393 o When the router forwards an IPv6 packet into the tunnel interface 394 with a destination address that matches an on-link prefix and that 395 embeds the IPv4 address IP1, it discards the packet if IP1 does 396 not belong to the configured list of IPv4 addresses. 398 o When the router receives an IPv6 packet on the tunnel's interface 399 with a source address that matches a on-link prefix and that 400 embeds the IPv4 address IP2, it discards the packet if IP2 does 401 not belong to the configured list of IPv4 addresses. 403 3.2.3. Neighbor Reachability Check 405 Yet another approach that allows a router to verify that an end host 406 exists and can be reached via the tunnel is by performing an initial 407 reachability confirmation, e.g., as specified in the second paragraph 408 of Section 8.4 of [RFC5214]. This procedure parallels the address 409 resolution specifications in Section 7.2 of [RFC4861], i.e., the 410 router maintains a small queue of packets waiting for reachability 411 confirmation to complete. If confirmation succeeds, the router 412 discovers that a legitimate neighbor responds to the address and 413 packets may be forwarded to it. Otherwise, the router returns ICMP 414 destination unreachable indications as specified in Section 7.2.2 of 415 [RFC4861]. 417 3.3. Operational Measures 419 The following measures can be taken by the network operator. Their 420 aim is to configure the network in such a way that the attacks can 421 not take place. 423 3.3.1. Avoiding a Shared IPv4 Link 425 As noted above, the attack relies on having an IPv4 network as a 426 shared link-layer between more than one tunnel. From this the 427 following two mitigation measures arise: 429 3.3.1.1. Filtering IPv4 Protocol-41 Packets 431 In this measure a tunnel router may drop all IPv4 protocol-41 packets 432 received or sent over interfaces that are attached to an untrusted 433 IPv4 network. This will cut-off any IPv4 network as a shared link. 434 This measure has the advantage of simplicity. However, such a 435 measure may not always be suitable for scenarios where IPv4 436 connectivity is essential on all interfaces. 438 3.3.1.2. Operational Avoidance of Multiple Tunnels 440 This measure mitigates the attack by simply allowing for a single 441 IPv6 tunnel to operate in a bounded IPv4 network (e.g., a small home 442 IPv4 network behind a residential gateway serving as a tunnel 443 router). In particular, if there are only one or a few tunnel 444 routers in the IPv4 network and all participate in the same tunnel 445 then there is no opportunity for perpetuating the loop. 447 This approach has the advantage that it avoids the attack profile 448 altogether without need for explicit mitigations. However, it 449 requires careful configuration management which may not be tenable in 450 large and/or unbounded IPv4 networks. 452 3.3.2. A Single Border Router 454 It is reasonable to assume that a tunnel router shall accept or 455 forward tunneled packets only over its tunnel interface. It is also 456 reasonable to assume that a tunnel router shall accept or forward 457 IPv6 packets only over its IPv6 interface. If these two interfaces 458 are physically different then the network operator can mitigate the 459 attack by ensuring that the following condition holds: there is no 460 path between these two interfaces that does not go through the tunnel 461 router. 463 The above condition ensures that an encapsulated packet which is 464 transmitted over the tunnel interface will not get to another tunnel 465 router and from there to the IPv6 interface of the first router. The 466 condition also ensures the reverse direction, i.e., an IPv6 packet 467 which is transmitted over the IPv6 interface will not get to another 468 tunnel router and from there to the tunnel interface of the first 469 router. This condition is essentially translated to a scenario in 470 which the tunnel router is the only border router between the IPv6 471 network and the IPv4 network to which it is attached. 473 4. Recommendations 475 In light of the mitigation measures proposed above we make the 476 following recommendations in decreasing order: 478 1. When possible, it is recommended that the attacks are 479 operationally eliminated (as per one of the measures proposed in 480 Section 3.3). 482 2. For tunnel routers that keep a coherent and trusted neighbor 483 cache which includes all legitimate end-points of the tunnel, we 484 recommend exercising the Neighbor Cache Check. 486 3. For tunnel routers that can implement the Neighbor Reachability 487 Check, we recommend exercising it. 489 4. For tunnels having small and static list of end-points we 490 recommend exercising Known IPv4 Address Check. 492 5. For all other cases we recommend the Destination and Source 493 Address Checks. 495 As noted earlier, tunnels may be deployed in various operational 496 environments. There is a possibility that other mitigation measures 497 may be allowed is specific deployment scenarios. The above 498 recommendations are general and do not attempt to cover such 499 scenarios. 501 5. IANA Considerations 503 This document has no IANA considerations. 505 6. Security Considerations 507 This document aims at presenting possible solutions to the routing 508 loop attack which involves automatic tunnels' routers. It contains 509 various checks that aim to recognize and drop specific packets that 510 have strong potential to cause a routing loop. These checks do not 511 introduce new security threats. 513 7. Acknowledgments 515 This work has benefited from discussions on the V6OPS, 6MAN and 516 SECDIR mailing lists. Remi Despres, Christian Huitema, Dmitry 517 Anipko, Dave Thaler and Fernando Gont are acknowledged for their 518 contributions. 520 8. References 522 8.1. Normative References 524 [RFC1918] Rekhter, Y., Moskowitz, R., Karrenberg, D., Groot, G., and 525 E. Lear, "Address Allocation for Private Internets", 526 BCP 5, RFC 1918, February 1996. 528 [RFC3056] Carpenter, B. and K. Moore, "Connection of IPv6 Domains 529 via IPv4 Clouds", RFC 3056, February 2001. 531 [RFC4861] Narten, T., Nordmark, E., Simpson, W., and H. Soliman, 532 "Neighbor Discovery for IP version 6 (IPv6)", RFC 4861, 533 September 2007. 535 [RFC5214] Templin, F., Gleeson, T., and D. Thaler, "Intra-Site 536 Automatic Tunnel Addressing Protocol (ISATAP)", RFC 5214, 537 March 2008. 539 [RFC5569] Despres, R., "IPv6 Rapid Deployment on IPv4 540 Infrastructures (6rd)", RFC 5569, January 2010. 542 8.2. Informative References 544 [USENIX09] 545 Nakibly, G. and M. Arov, "Routing Loop Attacks using IPv6 546 Tunnels", USENIX WOOT, August 2009. 548 Authors' Addresses 550 Gabi Nakibly 551 National EW Research & Simulation Center 552 P.O. Box 2250 (630) 553 Haifa 31021 554 Israel 556 Email: gnakibly@yahoo.com 558 Fred L. Templin 559 Boeing Research & Technology 560 P.O. Box 3707 MC 7L-49 561 Seattle, WA 98124 562 USA 564 Email: fltemplin@acm.org