idnits 2.17.1 draft-ietf-v6ops-tunnel-loops-05.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 (March 14, 2011) is 4791 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 3315 (Obsoleted by RFC 8415) ** Obsolete normative reference: RFC 3633 (Obsoleted by RFC 8415) == Outdated reference: A later version (-40) exists of draft-templin-intarea-vet-23 Summary: 2 errors (**), 0 flaws (~~), 2 warnings (==), 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: September 15, 2011 F. Templin 6 Boeing Research & Technology 7 March 14, 2011 9 Routing Loop Attack using IPv6 Automatic Tunnels: Problem Statement and 10 Proposed Mitigations 11 draft-ietf-v6ops-tunnel-loops-05.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 September 15, 2011. 41 Copyright Notice 43 Copyright (c) 2011 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 . . . . . . . . . . . . . 4 60 3. Proposed Mitigation Measures . . . . . . . . . . . . . . . . . 6 61 3.1. Verification of end point existence . . . . . . . . . . . 6 62 3.1.1. Neighbor Cache Check . . . . . . . . . . . . . . . . . 6 63 3.1.2. Known IPv4 Address Check . . . . . . . . . . . . . . . 7 64 3.2. Operational Measures . . . . . . . . . . . . . . . . . . . 7 65 3.2.1. Avoiding a Shared IPv4 Link . . . . . . . . . . . . . 8 66 3.2.2. A Single Border Router . . . . . . . . . . . . . . . . 8 67 3.2.3. A Comprehensive List of Tunnel Routers . . . . . . . . 9 68 3.2.4. Avoidance of On-link Prefixes . . . . . . . . . . . . 9 69 3.3. Destination and Source Address Checks . . . . . . . . . . 15 70 3.3.1. Known IPv6 Prefix Check . . . . . . . . . . . . . . . 16 71 4. Recommendations . . . . . . . . . . . . . . . . . . . . . . . 17 72 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 17 73 6. Security Considerations . . . . . . . . . . . . . . . . . . . 17 74 7. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 18 75 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 18 76 8.1. Normative References . . . . . . . . . . . . . . . . . . . 18 77 8.2. Informative References . . . . . . . . . . . . . . . . . . 18 78 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 19 80 1. Introduction 82 IPv6-in-IPv4 tunnels are an essential part of many migration plans 83 for IPv6. They allow two IPv6 nodes to communicate over an IPv4-only 84 network. Automatic tunnels that assign non-link-local IPv6 prefixes 85 with stateless address mapping properties (hereafter called 86 "automatic tunnels") are a category of tunnels in which a tunneled 87 packet's egress IPv4 address is embedded within the destination IPv6 88 address of the packet. An automatic tunnel's router is a router that 89 respectively encapsulates and decapsulates the IPv6 packets into and 90 out of the tunnel. 92 Ref. [USENIX09] pointed out the existence of a vulnerability in the 93 design of IPv6 automatic tunnels. Tunnel routers operate on the 94 implicit assumption that the destination address of an incoming IPv6 95 packet is always an address of a valid node that can be reached via 96 the tunnel. The assumption of path validity poses a denial of 97 service risk as inconsistency between the IPv4 routing state and the 98 IPv6 routing state allows a routing loop to be formed. 100 An attacker can exploit this vulnerability by crafting a packet which 101 is routed over a tunnel to a node that is not participating in that 102 tunnel. This node may forward the packet out of the tunnel to the 103 native IPv6 network. There the packet is routed back to the ingress 104 point that forwards it back into the tunnel. Consequently, the 105 packet loops in and out of the tunnel. The loop terminates only when 106 the Hop Limit field in the IPv6 header of the packet is decremented 107 to zero. This vulnerability can be abused as a vehicle for traffic 108 amplification to facilitate DoS attacks [RFC4732]. 110 Without compensating security measures in place, all IPv6 automatic 111 tunnels that are based on protocol-41 encapsulation [RFC4213] are 112 vulnerable to such an attack including ISATAP [RFC5214], 6to4 113 [RFC3056] and 6rd [RFC5969]. It should be noted that this document 114 does not consider non-protocol-41 encapsulation attacks. In 115 particular, we do not address the Teredo [RFC4380] attacks described 116 in [USENIX09]. These attacks are considered in 117 [I-D.gont-6man-teredo-loops]. 119 The aim of this document is to shed light on the routing loop attack 120 and describe possible mitigation measures that should be considered 121 by operators of current IPv6 automatic tunnels and by designers of 122 future ones. We note that tunnels may be deployed in various 123 operational environments, e.g. service provider network, enterprise 124 network, etc. Specific issues related to the attack which are 125 derived from the operational environment are not considered in this 126 document. 128 2. A Detailed Description of the Attack 130 In this section we shall denote an IPv6 address of a node reached via 131 a given tunnel by the prefix of the tunnel and an IPv4 address of the 132 tunnel end point, i.e., Addr(Prefix, IPv4). Note that the IPv4 133 address may or may not be part of the prefix (depending on the 134 specification of the tunnel's protocol). The IPv6 address may be 135 dependent on additional bits in the interface ID, however for our 136 discussion their exact value is not important. 138 The two victims of this attack are routers - R1 and R2 - of two 139 different tunnels - T1 and T2. Both routers have the capability to 140 forward IPv6 packets in and out of their respective tunnels. The two 141 tunnels need not be based on the same tunnel protocol. The only 142 condition is that the two tunnel protocols be based on protocol-41 143 encapsulation. The IPv4 address of R1 is IP1, while the prefix of 144 its tunnel is Prf1. IP2 and Prf2 are the respective values for R2. 145 We assume that IP1 and IP2 belong to the same address realm, i.e., 146 they are either both public, or both private and belong to the same 147 internal network. The following network diagram depicts the 148 locations of the two routers. The numbers indicate the packets of 149 the attack and the path they traverse as described below. 151 ####### 152 # R1 # 153 ####### 154 // \ 155 T1 // 2 \ 1 156 interface // \ 157 _______________//_ __\________________ 158 | | | | 159 | IPv4 Network | | IPv6 Network | 160 |__________________| |___________________| 161 \\ / 162 \\ / 163 T2 \\ 2 / 0,1 164 interface \\ / 165 ####### 166 # R2 # 167 ####### 169 Figure 1: The network setting of the attack 171 The attack is depicted in Figure 2. It is initiated by sending an 172 IPv6 packet (packet 0 in Figure 2) destined to a fictitious end point 173 that appears to be reached via T2 and has IP1 as its IPv4 address, 174 i.e., Addr(Prf2, IP1). The source address of the packet is a T1 175 address with Prf1 as the prefix and IP2 as the embedded IPv4 address, 176 i.e., Addr(Prf1, IP2). As the prefix of the destination address is 177 Prf2, the packet will be routed over the IPv6 network to T2. 179 We assume that R2 is the packet's entry point to T2. R2 receives the 180 packet through its IPv6 interface and forwards it over its T2 181 interface encapsulated with an IPv4 header having a destination 182 address derived from the IPv6 destination, i.e., IP1. The source 183 address is the address of R2, i.e., IP2. The packet (packet 1 in 184 Figure 2.) is routed over the IPv4 network to R1, which receives the 185 packet on its IPv4 interface. It processes the packet as a packet 186 that originates from one of the end nodes of T1. 188 Since the IPv4 source address corresponds to the IPv6 source address, 189 R1 will decapsulate the packet. Since the packet's IPv6 destination 190 is outside of T1, R1 will forward the packet onto a native IPv6 191 interface. The forwarded packet (packet 2 in Figure 2) is identical 192 to the original attack packet. Hence, it is routed back to R2, in 193 which the loop starts again. Note that the packet may not 194 necessarily be transported from R1 over native IPv6 network. R1 may 195 be connected to the IPv6 network through another tunnel. 197 R1 R2 198 | | 0 199 | 1 |<------ 200 |<===============| 201 | 2 | 202 |--------------->| 203 | . | 204 | . | 206 1 - IPv4: IP2 --> IP1 207 IPv6: Addr(Prf1,IP2) --> Addr(Prf2,IP1) 208 0,2- IPv6: Addr(Prf1,IP2) --> Addr(Prf2,IP1) 210 Legend: ====> - tunneled IPv6, ---> - native IPv6 212 Figure 2: Routing loop attack between two tunnels' routers 214 The crux of the attack is as follows. The attacker exploits the fact 215 that R2 does not know that R1 does not take part of T2 and that R1 216 does not know that R2 does not take part of T1. The IPv4 network 217 acts as a shared link layer for the two tunnels. Hence, the packet 218 is repeatedly forwarded by both routers. It is noted that the attack 219 will fail when the IPv4 network can not transport packets between the 220 tunnels. For example, when the two routers belong to different IPv4 221 address realms or when ingress/egress filtering is exercised between 222 the routes. 224 The loop will stop when the Hop Limit field of the packet reaches 225 zero. After a single loop the Hop Limit field is decreased by the 226 number of IPv6 routers on path from R1 and R2. Therefore, the number 227 of loops is inversely proportional to the number of IPv6 hops between 228 R1 and R2. 230 The tunnel pair T1 and T2 may be any combination of automatic tunnel 231 types, e.g., ISATAP, 6to4 and 6rd. This has the exception that both 232 tunnels can not be of type 6to4, since two 6to4 routers can not 233 belong to different tunnels (there is only one 6to4 tunnel in the 234 Internet). For example, if the attack were to be launched on an 235 ISATAP router (R1) and 6to4 relay (R2), then the destination and 236 source addresses of the attack packet would be 2002:IP1:* and Prf1:: 237 0200:5EFE:IP2, respectively. 239 3. Proposed Mitigation Measures 241 This section presents some possible mitigation measures for the 242 attack described above. For each measure we shall discuss its 243 advantages and disadvantages. 245 The proposed measures fall under the following three categories: 247 o Verification of end point existence 249 o Operational measures 251 o Destination and source addresses checks 253 3.1. Verification of end point existence 255 The routing loop attack relies on the fact that a router does not 256 know whether there is an end point that can reached via its tunnel 257 that has the source or destination address of the packet. This 258 category includes mitigation measures which aim to verify that there 259 is a node which participate in the tunnel and its address corresponds 260 to the packet's destination or source addresses, as appropriate. 262 3.1.1. Neighbor Cache Check 264 One way that the router can verify that an end host exists and can be 265 reached via the tunnel is by checking whether a valid entry exists 266 for it in the neighbor cache of the corresponding tunnel interface. 267 The neighbor cache entry can be populated through, e.g., an initial 268 reachability check, receipt of neighbor discovery messages, 269 administrative configuration, etc. 271 When the router has a packet to send to a potential tunnel host for 272 which there is no neighbor cache entry, it can perform an initial 273 reachability check on the packet's destination address, e.g., as 274 specified in the second paragraph of Section 8.4 of [RFC5214]. (The 275 router can similarly perform a "reverse reachability" check on the 276 packet's source address when it receives a packet from a potential 277 tunnel host for which there is no neighbor cache entry.) This 278 reachability check parallels the address resolution specifications in 279 Section 7.2 of [RFC4861], i.e., the router maintains a small queue of 280 packets waiting for reachability confirmation to complete. If 281 confirmation succeeds, the router discovers that a legitimate tunnel 282 host responds to the address. Otherwise, the router discards 283 subsequent packets and returns ICMP destination unreachable 284 indications as specified in Section 7.2.2 of [RFC4861]. 286 Note that this approach assumes that the neighbor cache will remain 287 coherent and not subject to malicious attack, which must be confirmed 288 based on specific deployment scenarios. One possible way for an 289 attacker to subvert the neighbor cache is to send false neighbor 290 discovery messages with a spoofed source address. 292 3.1.2. Known IPv4 Address Check 294 Another approach that enables a router to verify that an end host 295 exists and can be reached via the tunnel is simply by pre-configuring 296 the router with the set of IPv4 addresses that are authorized to use 297 the tunnel. Upon this configuration the router can perform the 298 following simple checks: 300 o When the router forwards an IPv6 packet into the tunnel interface 301 with a destination address that matches an on-link prefix and that 302 embeds the IPv4 address IP1, it discards the packet if IP1 does 303 not belong to the configured list of IPv4 addresses. 305 o When the router receives an IPv6 packet on the tunnel's interface 306 with a source address that matches a on-link prefix and that 307 embeds the IPv4 address IP2, it discards the packet if IP2 does 308 not belong to the configured list of IPv4 addresses. 310 3.2. Operational Measures 312 The following measures can be taken by the network operator. Their 313 aim is to configure the network in such a way that the attacks can 314 not take place. 316 3.2.1. Avoiding a Shared IPv4 Link 318 As noted above, the attack relies on having an IPv4 network as a 319 shared link-layer between more than one tunnel. From this the 320 following two mitigation measures arise: 322 3.2.1.1. Filtering IPv4 Protocol-41 Packets 324 In this measure a tunnel router may drop all IPv4 protocol-41 packets 325 received or sent over interfaces that are attached to an untrusted 326 IPv4 network. This will cut-off any IPv4 network as a shared link. 327 This measure has the advantage of simplicity. However, such a 328 measure may not always be suitable for scenarios where IPv4 329 connectivity is essential on all interfaces. 331 3.2.1.2. Operational Avoidance of Multiple Tunnels 333 This measure mitigates the attack by simply allowing for a single 334 IPv6 tunnel to operate in a bounded IPv4 network. For example, the 335 attack can not take place in broadband home networks. In such cases 336 there is a small home network having a single residential gateway 337 which serves as a tunnel router. A tunnel router is vulnerable to 338 the attack only if it has at least two interfaces with a path to the 339 Internet: a tunnel interface and a native IPv6 interface (as depicted 340 in Figure 1). However, a residential gateway usually has only a 341 single interface to the Internet, therefore the attack can not take 342 place. Moreover, if there are only one or a few tunnel routers in 343 the IPv4 network and all participate in the same tunnel then there is 344 no opportunity for perpetuating the loop. 346 This approach has the advantage that it avoids the attack profile 347 altogether without need for explicit mitigations. However, it 348 requires careful configuration management which may not be tenable in 349 large and/or unbounded IPv4 networks. 351 3.2.2. A Single Border Router 353 It is reasonable to assume that a tunnel router shall accept or 354 forward tunneled packets only over its tunnel interface. It is also 355 reasonable to assume that a tunnel router shall accept or forward 356 IPv6 packets only over its IPv6 interface. If these two interfaces 357 are physically different then the network operator can mitigate the 358 attack by ensuring that the following condition holds: there is no 359 path between these two interfaces that does not go through the tunnel 360 router. 362 The above condition ensures that an encapsulated packet which is 363 transmitted over the tunnel interface will not get to another tunnel 364 router and from there to the IPv6 interface of the first router. The 365 condition also ensures the reverse direction, i.e., an IPv6 packet 366 which is transmitted over the IPv6 interface will not get to another 367 tunnel router and from there to the tunnel interface of the first 368 router. This condition is essentially translated to a scenario in 369 which the tunnel router is the only border router between the IPv6 370 network and the IPv4 network to which it is attached (as in broadband 371 home network scenario mentioned above). 373 3.2.3. A Comprehensive List of Tunnel Routers 375 If a tunnel router can be configured with a comprehensive list of 376 IPv4 addresses of all other tunnel routers in the network, then the 377 router can use the list as a filter to discard any tunneled packets 378 coming from other routers. For example, a tunnel router can use the 379 network's ISATAP Potential Router List (PRL) [RFC5214] as a filter as 380 long as there is operational assurance that all ISATAP routers are 381 listed and that no other types of tunnel routers are present in the 382 network. 384 This measure parallels the one proposed for 6rd in [RFC5969] where 385 the 6rd BR filters all known relay addresses of other tunnels inside 386 the ISP's network. 388 This measure is especially useful for intra-site tunneling 389 mechanisms, such as ISATAP and 6rd, since filtering can be exercised 390 on well-defined site borders. 392 3.2.4. Avoidance of On-link Prefixes 394 The looping attack exploits the fact that a router is permitted to 395 assign non-link-local IPv6 prefixes on its tunnel interfaces, which 396 could cause it to send tunneled packets to other routers that do not 397 configure an address from the prefix. Therefore, if the router does 398 not assign non-link-local IPv6 prefixes on its tunnel interfaces 399 there is no opportunity for it to initiate the loop. If the router 400 further ensures that the routing state is consistent for the packets 401 it receives on its tunnel interfaces there is no opportunity for it 402 to propagate a loop initiated by a different router. 404 This mitigation is available only to ISATAP routers, since the ISATAP 405 stateless address mapping operates only on the Interface Identifier 406 portion of the IPv6 address, and not on the IPv6 prefix. . The 407 mitigation is also only applicable on ISATAP links on which IPv4 408 source address spoofing is disabled. The following sections discuss 409 the operational configurations necessary to implement the mitigation. 411 3.2.4.1. ISATAP Router Interface Types 413 ISATAP provides a Potential Router List (PRL) to further ensure a 414 loop-free topology. Routers that are members of the provider network 415 PRL configure their provider network ISATAP interfaces as advertising 416 router interfaces (see: [RFC4861], Section 6.2.2), and therefore may 417 send Router Advertisement (RA) messages that include non-zero Router 418 Lifetimes. Routers that are not members of the provider network PRL 419 configure their provider network ISATAP interfaces as non-advertising 420 router interfaces. 422 3.2.4.2. ISATAP Source Address Verification 424 ISATAP nodes employ the source address verification checks specified 425 in Section 7.3 of [RFC5214] as a prerequisite for decapsulation of 426 packets received on an ISATAP interface. To enable the on-link 427 prefix avoidance procedures outlined in this section, ISATAP nodes 428 must employ an additional source address verification check; namely, 429 the node also considers the outer IPv4 source address correct for the 430 inner IPv6 source address if: 432 o a forwarding table entry exists that lists the packet's IPv4 433 source address as the link-layer address corresponding to the 434 inner IPv6 source address via the ISATAP interface. 436 3.2.4.3. ISATAP Host Behavior 438 ISATAP hosts send Router Solicitation (RS) messages to obtain RA 439 messages from an advertising ISATAP router. Whether or not non-link- 440 local IPv6 prefixes are advertised, the host can acquire IPv6 441 addresses, e.g., through the use of DHCPv6 stateful address 442 autoconfiguration [RFC3315]. 444 To acquire addresses, the host performs standard DHCPv6 exchanges 445 while mapping the IPv6 "All_DHCP_Relay_Agents_and_Servers" link- 446 scoped multicast address to the IPv4 address of the advertising 447 router (hence, the advertising router must configure either a DHCPv6 448 relay or server function). The host should also use DHCPv6 449 Authentication in environments where authentication of the DHCPv6 450 exchanges is required. 452 After the host receives IPv6 addresses, it assigns them to its ISATAP 453 interface and forwards any of its outbound IPv6 packets via the 454 advertising router as a default router. The advertising router in 455 turn maintains IPv6 forwarding table entries that list the IPv4 456 address of the host as the link-layer address of the delegated IPv6 457 addresses. 459 3.2.4.4. ISATAP Router Behavior 461 In many use case scenarios (e.g., enterprise networks, MANETs, etc.), 462 advertising and non-advertising ISATAP routers can engage in a 463 proactive dynamic IPv6 routing protocol (e.g., OSPFv3, RIPng, etc.) 464 so that IPv6 routing/forwarding tables can be populated and standard 465 IPv6 forwarding between ISATAP routers can be used. In other 466 scenarios (e.g., large ISP networks, etc.), this might be impractical 467 dues to scaling issues. When a proactive dynamic routing protocol 468 cannot be used, non-advertising ISATAP routers send RS messages to 469 obtain RA messages from an advertising ISATAP router, i.e., they act 470 as "hosts" on their non-advertising ISATAP interfaces. 472 Non-advertising routers can also acquire IPv6 prefixes, e.g., through 473 the use of DHCPv6 Prefix Delegation [RFC3633] via an advertising 474 router in the same fashion as described above for host-based DHCPv6 475 stateful address autoconfiguration. The advertising router in turn 476 maintains IPv6 forwarding table entries that list the IPv4 address of 477 the non-advertising router as the link-layer address of the next hop 478 toward the delegated IPv6 prefixes. 480 After the non-advertising router acquires IPv6 prefixes, it can sub- 481 delegate them to routers and links within its attached IPv6 edge 482 networks, then can forward any outbound IPv6 packets coming from its 483 edge networks via other ISATAP nodes on the link. 485 3.2.4.5. Reference Operational Scenario 487 Figure 3 depicts a reference ISATAP network topology for operational 488 avoidance of on-link non-link-local IPv6 prefixes. The scenario 489 shows an advertising ISATAP router ('A'), two non-advertising ISATAP 490 routers ('B', 'D'), an ISATAP host ('F'), and three ordinary IPv6 491 hosts ('C', 'E', 'G') in a typical deployment configuration: 493 .-(::::::::) 2001:db8:3::1 494 .-(::: IPv6 :::)-. +-------------+ 495 (:::: Internet ::::) | IPv6 Host G | 496 `-(::::::::::::)-' +-------------+ 497 `-(::::::)-' 498 ,-. 499 ,-----+-/-+--' \+------. 500 / ,~~~~~~~~~~~~~~~~~, : 501 / |companion gateway| |. 502 ,-' '~~~~~~~~~~~~~~~~~' `. 503 ; +--------------+ ) 504 : | Router A | / fe80::5efe:192.0.2.4 505 : | (isatap) | ; 2001:db8:2::1 506 +- +--------------+ -+ +--------------+ 507 ; fe80::5efe:192.0.2.1 : | (isatap) | 508 | ; | Host F | 509 : IPv4 Provider Network -+-' +--------------+ 510 `-. (PRL: 192.0.2.1) .) 511 \ _) 512 `-----+--------)----+'----' 513 fe80::5efe:192.0.2.2 fe80::5efe:192.0.2.3 .-. 514 +--------------+ +--------------+ ,-( _)-. 515 | (isatap) | | (isatap) | .-(_ IPv6 )-. 516 | Router B | | Router D |--(__Edge Network ) 517 +--------------+ +--------------+ `-(______)-' 518 2001:db8::/48 2001:db8:1::/48 | 519 | 2001:db8:1::1 520 .-. +-------------+ 521 ,-( _)-. 2001:db8::1 | IPv6 Host E | 522 .-(_ IPv6 )-. +-------------+ +-------------+ 523 (__Edge Network )--| IPv6 Host C | 524 `-(______)-' +-------------+ 526 Figure 3: Reference ISATAP Network Topology 528 In Figure 3, advertising ISATAP router 'A' within the IPv4 provider 529 network connects to the IPv6 Internet, either directly or via a 530 companion gateway. 'A' configures a provider network IPv4 interface 531 with address 192.0.2.1 and arranges to add the address to the 532 provider network PRL. 'A' next configures an advertising ISATAP 533 router interface with link-local IPv6 address fe80::5efe:192.0.2.1 534 over the IPv4 interface. 536 Non-advertising ISATAP router 'B' connects to one or more IPv6 edge 537 networks and also connects to the provider network via an IPv4 538 interface with address 192.0.2.2, but it does not add the IPv4 539 address to the provider network PRL. 'B' next configures a non- 540 advertising ISATAP router interface with link-local address fe80:: 542 5efe:192.0.2.2, then receives the IPv6 prefix 2001:db8::/48 through a 543 DHCPv6 prefix delegation exchange via 'A'. 'B' then engages in an 544 IPv6 routing protocol over its ISATAP interface and announces the 545 delegated IPv6 prefix. 'B' finally sub-delegates the prefix to its 546 attached edge networks, where IPv6 host 'C' autoconfigures the 547 address 2001:db8::1. 549 Non-advertising ISATAP router 'D' connects to the provider network, 550 configures its ISATAP interface, receives a DHCPv6 prefix delegation, 551 and engages in the IPv6 routing protocol the same as for router 'B'. 552 In particular, 'D' configures the IPv4 address 192.0.2.3, the ISATAP 553 link-local address fe80::5efe:192.0.2.3, and the delegated IPv6 554 prefix 2001:db8:1::/48. 'D' finally sub-delegates the prefix to its 555 attached edge networks, where IPv6 host 'E' autoconfigures IPv6 556 address 2001:db8:1::1. 558 ISATAP host 'F' connects to the provider network via an IPv4 559 interface with address 192.0.2.4, and also configures an ISATAP host 560 interface with link-local address fe80::5efe:192.0.2.4 over the IPv4 561 interface. 'F' next configures a default IPv6 route with next-hop 562 address fe80::5efe:192.0.2.1 via the ISATAP interface, then receives 563 the IPv6 address 2001:db8:2::1 from a DHCPv6 address configuration 564 exchange via 'A'. When 'F' receives the IPv6 address, it assigns the 565 address to the ISATAP interface but does not assign a non-link-local 566 IPv6 prefix to the interface. 568 Finally, IPv6 host 'G' connects to an IPv6 network outside of the 569 ISATAP domain. 'G' configures its IPv6 interface in a manner 570 specific to its attached IPv6 link, and autoconfigures the IPv6 571 address 2001:db8:3::1. 573 Following this autoconfiguration, when host 'C' has an IPv6 packet to 574 send to host 'E', it prepares the packet with source address 2001: 575 db8::1 and destination address 2001:db8:1::1, then sends the packet 576 into the edge network where it will eventually be forwarded to router 577 'B'. 'B' then uses ISATAP encapsulation to forward the packet to 578 router 'D', since it has discovered a route to 2001:db8:1::/48 with 579 next hop 'D' via dynamic routing over the ISATAP interface. Router 580 'D' finally forwards the packet to host 'E'. 582 In a second scenario, when 'C' has a packet to send to ISATAP host 583 'F', it prepares the packet with source address 2001:db8::1 and 584 destination address 2001:db8:2::1, then sends the packet into the 585 edge network where it will eventually be forwarded to router 'B' the 586 same as above. 'B' then uses ISATAP encapsulation to forward the 587 packet to router 'A' (i.e., a router that advertises "default"), 588 which in turn forwards the packet to 'F'. Note that this operation 589 entails two hops across the ISATAP link (i.e., one from 'B' to 'A', 590 and a second from 'A' to 'F'). If 'F' also participates in the 591 dynamic IPv6 routing protocol, however, 'B' could instead forward the 592 packet directly to 'F' without involving 'A'. 594 In a final scenario, when 'C' has a packet to send to host 'G' in the 595 IPv6 Internet, the packet is forwarded to 'B' the same as above. 'B' 596 then forwards the packet to 'A', which forwards the packet into the 597 IPv6 Internet. 599 3.2.4.6. Scaling Considerations 601 Figure 3 depicts an ISATAP network topology with only a single 602 advertising ISATAP router within the provider network. In order to 603 support larger numbers of non-advertising ISATAP routers and ISATAP 604 hosts, the provider network can deploy more advertising ISATAP 605 routers to support load balancing and generally shortest-path 606 routing. 608 Such an arrangement requires that the advertising ISATAP routers 609 participate in an IPv6 routing protocol instance so that IPv6 610 address/prefix delegations can be mapped to the correct router. The 611 routing protocol instance can be configured as either a full mesh 612 topology involving all advertising ISATAP routers, or as a partial 613 mesh topology with each advertising ISATAP router associating with 614 one or more companion gateways and a full mesh between companion 615 gateways. 617 3.2.4.7. On-Demand Dynamic Routing 619 With respect to the reference operational scenario depicted in 620 Figure 3, there will be many use cases in which a proactive dynamic 621 IPv6 routing protocol cannot be used. For example, in large ISP 622 network deployments it would be impractical for all Customer-Edge and 623 Provider-Edge routers to engage in a common routing protocol instance 624 due to scaling considerations. 626 In those cases, an on-demand routing capability can be enabled in 627 which ISATAP nodes send initial packets via an advertising ISATAP 628 router and receive redirection messages back. For example, when a 629 non-advertising ISATAP router 'B' has a packet to send to a host 630 located behind non-advertising ISATAP router 'D', it can send the 631 initial packets via advertising router 'A' which will return 632 redirection messages to inform 'B' that 'D' is a better first hop. 633 Protocol details for this ISATAP redirection are specified in 634 [I-D.templin-intarea-vet]. 636 3.3. Destination and Source Address Checks 638 Tunnel routers can use a source address check mitigation when they 639 forward an IPv6 packet into a tunnel interface with an IPv6 source 640 address that embeds one of the router's configured IPv4 addresses. 641 Similarly, tunnel routers can use a destination address check 642 mitigation when they receive an IPv6 packet on a tunnel interface 643 with an IPv6 destination address that embeds one of the router's 644 configured IPv4 addresses. These checks should correspond to both 645 tunnels' IPv6 address formats, regardless of the type of tunnel the 646 router employs. 648 For example, if tunnel router R1 (of any tunnel protocol) forwards a 649 packet into a tunnel interface with an IPv6 source address that 650 matches the 6to4 prefix 2002:IP1::/48, the router discards the packet 651 if IP1 is one of its own IPv4 addresses. In a second example, if 652 tunnel router R2 receives an IPv6 packet on a tunnel interface with 653 an IPv6 destination address with an off-link prefix but with an 654 interface identifier that matches the ISATAP address suffix ::0200: 655 5EFE:IP2, the router discards the packet if IP2 is one of its own 656 IPv4 addresses. 658 Hence a tunnel router can avoid the attack by performing the 659 following checks: 661 o When the router forwards an IPv6 packet into a tunnel interface, 662 it discards the packet if the IPv6 source address has an off-link 663 prefix but embeds one of the router's configured IPv4 addresses. 665 o When the router receives an IPv6 packet on a tunnel interface, it 666 discards the packet if the IPv6 destination address has an off- 667 link prefix but embeds one of the router's configured IPv4 668 addresses. 670 This approach has the advantage that that no ancillary state is 671 required, since checking is through static lookup in the lists of 672 IPv4 and IPv6 addresses belonging to the router. However, this 673 approach has some inherent limitations 675 o The checks incur an overhead which is proportional to the number 676 of IPv4 addresses assigned to the router. If a router is assigned 677 many addresses, the additional processing overhead for each packet 678 may be considerable. Note that an unmitigated attack packet would 679 be repetitively processed by the router until the Hop Limit 680 expires, which may require as many as 255 iterations. Hence, an 681 unmitigated attack will consume far more aggregate processing 682 overhead than per-packet address checks even if the router assigns 683 a large number of addresses. 685 o The checks should be performed for the IPv6 address formats of 686 every existing automatic IPv6 tunnel protocol (which uses 687 protocol-41 encapsulation). Hence, the checks must be updated as 688 new protocols are defined. 690 o Before the checks can be performed the format of the address must 691 be recognized. There is no guarantee that this can be generally 692 done. For example, one can not determine if an IPv6 address is a 693 6rd one, hence the router would need to be configured with a list 694 of all applicable 6rd prefixes (which may be prohibitively large) 695 in order to unambiguously apply the checks. 697 o The checks cannot be performed if the embedded IPv4 address is a 698 private one [RFC1918] since it is ambiguous in scope. Namely, the 699 private address may be legitimately allocated to another node in 700 another routing region. 702 The last limitation may be relieved if the router has some 703 information that allows it to unambiguously determine the scope of 704 the address. The check in the following subsection is one example 705 for this. 707 3.3.1. Known IPv6 Prefix Check 709 A router may be configured with the full list of IPv6 subnet prefixes 710 assigned to the tunnels attached to its current IPv4 routing region. 711 In such a case it can use the list to determine when static 712 destination and source address checks are possible. By keeping track 713 of the list of IPv6 prefixes assigned to the tunnels in the IPv4 714 routing region, a router can perform the following checks on an 715 address which embeds a private IPv4 address: 717 o When the router forwards an IPv6 packet into its tunnel with a 718 source address that embeds a private IPv4 address and matches an 719 IPv6 prefix in the prefix list, it determines whether the packet 720 should be discarded or forwarded by performing the source address 721 check specified in Section 3.3. Otherwise, the router forwards 722 the packet. 724 o When the router receives an IPv6 packet on its tunnel interface 725 with a destination address that embeds a private IPv4 address and 726 matches an IPv6 prefix in the prefix list, it determines whether 727 the packet should be discarded or forwarded by performing the 728 destination address check specified in Section 3.3. Otherwise, 729 the router forwards the packet. 731 The disadvantage of this approach is the administrative overhead for 732 maintaining the list of IPv6 subnet prefixes associated with an IPv4 733 routing region may become unwieldy should that list be long and/or 734 frequently updated. 736 4. Recommendations 738 In light of the mitigation measures proposed above we make the 739 following recommendations in decreasing order: 741 1. When possible, it is recommended that the attacks are 742 operationally eliminated (as per one of the measures proposed in 743 Section 3.2). 745 2. For tunnel routers that keep a coherent and trusted neighbor 746 cache which includes all legitimate end-points of the tunnel, we 747 recommend exercising the Neighbor Cache Check. 749 3. For tunnel routers that can implement the Neighbor Reachability 750 Check, we recommend exercising it. 752 4. For tunnels having small and static list of end-points we 753 recommend exercising Known IPv4 Address Check. 755 5. We generally do not recommend using the Destination and Source 756 Address Checks since they can not mitigate routing loops with 6rd 757 routers. Therefore, these checks should not be used alone unless 758 there is operational assurance that other measures are exercised 759 to prevent routing loops with 6rd routers. 761 As noted earlier, tunnels may be deployed in various operational 762 environments. There is a possibility that other mitigations may be 763 feasible in specific deployment scenarios. The above recommendations 764 are general and do not attempt to cover such scenarios. 766 5. IANA Considerations 768 This document has no IANA considerations. 770 6. Security Considerations 772 This document aims at presenting possible solutions to the routing 773 loop attack which involves automatic tunnels' routers. It contains 774 various checks that aim to recognize and drop specific packets that 775 have strong potential to cause a routing loop. These checks do not 776 introduce new security threats. 778 7. Acknowledgments 780 This work has benefited from discussions on the V6OPS, 6MAN and 781 SECDIR mailing lists. Remi Despres, Christian Huitema, Dmitry 782 Anipko, Dave Thaler and Fernando Gont are acknowledged for their 783 contributions. 785 8. References 787 8.1. Normative References 789 [RFC1918] Rekhter, Y., Moskowitz, R., Karrenberg, D., Groot, G., and 790 E. Lear, "Address Allocation for Private Internets", 791 BCP 5, RFC 1918, February 1996. 793 [RFC3056] Carpenter, B. and K. Moore, "Connection of IPv6 Domains 794 via IPv4 Clouds", RFC 3056, February 2001. 796 [RFC3315] Droms, R., Bound, J., Volz, B., Lemon, T., Perkins, C., 797 and M. Carney, "Dynamic Host Configuration Protocol for 798 IPv6 (DHCPv6)", RFC 3315, July 2003. 800 [RFC3633] Troan, O. and R. Droms, "IPv6 Prefix Options for Dynamic 801 Host Configuration Protocol (DHCP) version 6", RFC 3633, 802 December 2003. 804 [RFC4213] Nordmark, E. and R. Gilligan, "Basic Transition Mechanisms 805 for IPv6 Hosts and Routers", RFC 4213, October 2005. 807 [RFC4861] Narten, T., Nordmark, E., Simpson, W., and H. Soliman, 808 "Neighbor Discovery for IP version 6 (IPv6)", RFC 4861, 809 September 2007. 811 [RFC5214] Templin, F., Gleeson, T., and D. Thaler, "Intra-Site 812 Automatic Tunnel Addressing Protocol (ISATAP)", RFC 5214, 813 March 2008. 815 [RFC5969] Townsley, W. and O. Troan, "IPv6 Rapid Deployment on IPv4 816 Infrastructures (6rd) -- Protocol Specification", 817 RFC 5969, August 2010. 819 8.2. Informative References 821 [I-D.gont-6man-teredo-loops] 822 Gont, F., "Mitigating Teredo Rooting Loop Attacks", 823 draft-gont-6man-teredo-loops-00 (work in progress), 824 September 2010. 826 [I-D.templin-intarea-vet] 827 Templin, F., "Virtual Enterprise Traversal (VET)", 828 draft-templin-intarea-vet-23 (work in progress), 829 January 2011. 831 [RFC4380] Huitema, C., "Teredo: Tunneling IPv6 over UDP through 832 Network Address Translations (NATs)", RFC 4380, 833 February 2006. 835 [RFC4732] Handley, M., Rescorla, E., and IAB, "Internet Denial-of- 836 Service Considerations", RFC 4732, December 2006. 838 [USENIX09] 839 Nakibly, G. and M. Arov, "Routing Loop Attacks using IPv6 840 Tunnels", USENIX WOOT, August 2009. 842 Authors' Addresses 844 Gabi Nakibly 845 National EW Research & Simulation Center 846 P.O. Box 2250 (630) 847 Haifa 31021 848 Israel 850 Email: gnakibly@yahoo.com 852 Fred L. Templin 853 Boeing Research & Technology 854 P.O. Box 3707 MC 7L-49 855 Seattle, WA 98124 856 USA 858 Email: fltemplin@acm.org