Ipv6 Security for Ipv4 Engineers
Total Page:16
File Type:pdf, Size:1020Kb
March 2019 – Version 1.0 Network Security IPv6 Security for IPv4 Engineers Author Fernando Gont Network Security – IPv6 Security for IPv4 Engineers 2 Abstract This document provides an overview of IPv6 security that is specifically aimed at IPv4 engineers and operators. Rather than describing IPv6 in an isolated manner, it aims to re-use as much of the existing IPv4 knowledge and experience as possible. It highlights the security issues that affect both protocols in the same manner, as well as those that are new or different for the IPv6 protocol suite. Additionally, it discusses the security implications arising from the co-existence of the IPv6 and IPv4 protocols. 1. Introduction The IPv6 protocol suite has been designed to accommodate the present and future growth of the Internet by providing a much larger address space than that of its IPv4 counterpart, and is expected to be the successor of the original IPv4 protocol suite. The imminent exhaustion of the IPv4 address space has already led to the deployment of IPv6 in a large number of production environments, with many other organizations planning to deploy IPv6 in the short or near term. There are a number of factors that make the IPv6 protocol suite interesting from a security standpoint [IPV6-SEC]. Firstly, being a newer technology, technical personnel have less confidence with the IPv6 protocol suite than with its IPv4 counterpart, and it is therefore possible that the security implications of the protocols will be overlooked when they are deployed on production networks. Secondly, IPv6 implementations tend to be less mature than their IPv4 counterparts, and it therefore likely that vulnerabilities will be discovered before their robustness matches that of existing IPv4 implementations.Thirdly, security products such as firewalls and NIDS’s (Network Intrusion Detection Systems) usually have less support for the IPv6 protocols than for their IPv4 counterparts [IPV6-SEC-2] [IPV6-FW]. Fourthly, the security implications of IPv6 transition/co-existence technologies on existing IPv4 networks are usually overlooked, potentially enabling attackers to leverage these technologies to circumvent IPv4 security controls in unexpected ways [RFC7123]. Finally, marketing claims have created a lot of myths around IPv6 (and IPv6 security in particular), hindering proper awareness about IPv6 and its security considerations in particular [IPV6-MYTHS]. This document provides an overview of IPv6 security that is specifically aimed at IPv4 engineers and operators. Rather than describing IPv6 in an isolated manner, it aims to re-use as much of the existing IPv4 knowledge and experience as possible, by highlighting the security issues that affect both protocols in the same manner, those that are new or different for the IPv6 protocol suite, and those that arise from the co-existence of IPv6 and IPv4. internetsociety.org Network Security – IPv6 Security for IPv4 Engineers 3 2. Security Implications of the IPv6 Protocol Suite The IPv6 protocol suite provides very similar functionality and services to those provided by its IPv4 counterpart. Namely, it provides an unreliable datagram transfer service to the upper layers and implements features such as automatic host configuration, fault isolation, etc. However, most of these features are implemented by means of completely different mechanisms. The following table provides a rough comparison of IPv4 and IPv6 features, highlighting how each feature is implemented in each version of the protocol: Feature IPv4 IPv6 Addressing 32 bits 128 bits Packet structure Variable-length header Fixed-size base header + Extension Headers Address Resolution ARP ICMPv6 NS/NA (+ MLD) Auto-configuration DHCP ICMPv6 RS/RA & DHCPv6 (+ MLD) Fault Isolation ICMPv4 ICMPv6 IPsec support Optional Optional Fragmentation Both in hosts and routers Only in hosts Multicast Usage Only for Multicast apps Required for Neighbor Discovery Network Architecture Private addresses + NAT Global addresses + Firewall Comparing the IPv4 and IPv6 protocol suites in this manner is particularly important from a security standpoint for at less two reasons. Firstly, it stresses what features/services are present in both protocols, and consequently what features/services can be subject to attacks. Secondly, spelling out the specific mechanisms that are employed to implement a given feature/service provides a hint regarding the possible differences in corresponding attacks, as well as in possible mitigations. The following subsections provide an overview of each of the aforementioned IPv6 features, how the implementation of each feature differs from the IPv4 counterpart, and what are the security implications of such differences. 2.1. IP Addressing The main driver for the adoption and deployment of IPv6 is its larger address space. The structure internetsociety.org Network Security – IPv6 Security for IPv4 Engineers 4 of IPv6 addresses is quite similar to that of their IPv4 counterparts, namely there are different address types (unicast, multicast, etc.) and scopes (link-local, global, etc.) and addresses are normally aggregated (as “prefixes”) for the purpose of routing. However, IPv6 addresses are obviously much larger than their IPv4 counterparts: 128-bits vs. 32 bits. Similarly, IPv6 subnets are normally much larger than their IPv4 counterparts: in IPv4, /24 (or smaller) subnets are quite common, while /64 subnets are the norm for the IPv6 case, allowing for 264 possible addresses - a virtually unlimited number of addresses for each subnet. While IPv4 systems typically employ only one address per network interface, IPv6 systems normally employ multiple addresses for each network interface. For example, each network interface will normally employ one link-local unicast address, and one (or more) global unicast address. IPv6 also makes extensive use of multicasting (e.g. for address resolution and automatic configuration) and nodes are therefore normally reachable via one or more multicast addresses. These differences warrant the discussion of a number of topics that are closely related to IPv6 addressing: • IPv6 network reconnaissance • Impact of IPv6 subnet size on IPv6 stack resiliency • Challenges arising from IPv6 host address availability • Lack of Address Translation The following sub-sections discuss each of these areas, and their corresponding security implications. 2.1.1. IPv6 Network Reconnaissance The much larger IPv6 subnet size results in a much lower host address density in IPv6 subnets. That is, given an IPv6 subnet, only a very small fraction of the available addresses are actually employed by nodes on such subnet (see [RFC4692] and [RFC7421] for further discussion). If addresses are randomly distributed over the 264 possible values, it becomes unfeasible to brute- force search for “alive” nodes on a target network (as with the typical “ping sweeps” normally employed in the IPv4 world). This may be beneficial for mitigating network reconnaissance attacks but may also hinder legitimate penetration tests and security assessments. The feasibility and effectiveness of IPv6 address scans depends on whether the addresses of nodes in the target network follow specific patterns. For example, recent versions of most internetsociety.org Network Security – IPv6 Security for IPv4 Engineers 5 operating systems generate unpredictable IPv6 addresses when SLAAC is employed (see [RFC8064] and [RFC7217]). In such scenarios, traditional brute-force network reconnaissance via the so-called “ping sweeps” becomes unfeasible, and thus alternative techniques need to be employed. However, servers, routers, and other infrastructure systems tend to employ manual configuration and typically result in predictable addresses that may be easily discovered by means of IPv6 address scans [RFC7707]. The effectiveness of IPv6 address scans will typically depend on how addresses are configured (SLAAC, DHCPv6, or manual configuration) and the type of target node (clients, servers, routers, etc.). [RFC7707] discusses network reconnaissance in IPv6 networks in detail. While there is a plethora of techniques for performing network reconnaissance in IPv6 networks, some of them have been found to be particularly effective. If the target is a local subnet, the following techniques have been found to be effective: • Multicasted probes (ICMPv6 echo, and specially-crafted probe packets that elicit ICMPv6 error messages) • Multicast DNS (mDNS) queries. On the other hand, if the target is a remote network, the following techniques may be used: • Pattern-based address scans • DNS zone transfers • DNS reverse mappings • Certificate transparency framework • Search engines Pattern-based address scans are discussed in detail in [RFC7707], whilst [DNS-REV] and [DNS- REV2] discuss DNS reverse mappings with practical examples. [CTF] discusses the use of search engines and the certificate transparency framework for network reconnaissance, with practical examples. [IPV6-REC] provides practical examples of several techniques for IPv6 network reconnaissance using open source tools. internetsociety.org Network Security – IPv6 Security for IPv4 Engineers 6 We note that whilst the address scan techniques are IPv6-specific, the other techniques can also be employed to map IPv4 systems and networks. However, they become more relevant for IPv6 because of the unfeasibility to perform traditional brute-force address scans. 2.1.2. Impact of IPv6 subnet size on IPv6 stack resiliency IPv4 subnets do not accommodate more than a few hundred or