IPv6 Working Group Suresh Krishnan Internet-Draft Ericsson Expires: December 14, 2004 June 15, 2004 Arrangement of Hop-by-Hop options draft-krishnan-ipv6-hopbyhop-00 Status of this Memo This document is an Internet-Draft and is in full conformance with all provisions of Section 10 of RFC2026. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt. The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html. This Internet-Draft will expire on December 14, 2004. Copyright Notice Copyright (C) The Internet Society (2004). All Rights Reserved. Abstract The Hop-by-Hop option header is a type of IPv6 extension header that has been defined in the IPv6 protocol specification. The contents of this header need to be processed by every node along the path of an IPv6 datagram.This draft highlights the characteristics of this extension header which make it prone to Denial of Service attacks and proposes an arrangement of options to minimize such attacks. Krishnan Expires December 14, 2004 [Page 1] Internet-Draft Arrangement of Hop-by-Hop options June 2004 Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.1 Conventions used in this document . . . . . . . . . . . . 3 2. Details of the attack . . . . . . . . . . . . . . . . . . . . 4 2.1 Effects of the attack . . . . . . . . . . . . . . . . . . 4 3. Optimal arrangement of options . . . . . . . . . . . . . . . . 5 4. Proposed arrangement of options . . . . . . . . . . . . . . . 6 5. Deployment Considerations . . . . . . . . . . . . . . . . . . 7 5.1 Impact on deployed IPv6 nodes . . . . . . . . . . . . . . 7 5.2 Alternate solutions . . . . . . . . . . . . . . . . . . . 7 5.3 Quantitative analysis . . . . . . . . . . . . . . . . . . 7 6. Security Considerations . . . . . . . . . . . . . . . . . . . 8 7. References . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Author's Address . . . . . . . . . . . . . . . . . . . . . . . 8 Intellectual Property and Copyright Statements . . . . . . . . 9 Krishnan Expires December 14, 2004 [Page 2] Internet-Draft Arrangement of Hop-by-Hop options June 2004 1. Introduction The IPv6 base specification [RFC2460] defines the hop-by-hop extension header. This extension header carries the options which need to be processed by every node along the path of the datagram. Certain characteristics of the specification make it especially vulnerable to Denial of Service attacks. The characteristics are: o All the ipv6 nodes on the path need to process the options in this header o The option TLVs in the hop-by-hop options header need to be processed in order o A sub range of option types in this header will not cause any errors even if the node does not recognize them. o There is no restriction as to how many occurences of an option type can be present in the hop-by-hop header. This document details a low bandwidth Denial of Service attack on ipv6 routers/hosts using the hop-by-hop options extension header and possible ways of mitigating these attacks. 1.1 Conventions used in this document The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119]. Krishnan Expires December 14, 2004 [Page 3] Internet-Draft Arrangement of Hop-by-Hop options June 2004 2. Details of the attack The denial of service attack can be carried out by forming an IP datagram with a large number of TLV encoded options with random option type identifiers in the hop-by-hop options header. The option type is a 8 bit field with special meaning attached to the three most significant bits. The attack is most effective when all the nodes in the path are affected, meaning we do not want any node to drop the packet and send ICMP errors regarding unrecognized options. If the two most significant bits are cleared(0), the receiving node will silently ignore the option if it does not recognize the option type. The third most significant bit is used to denote whether the option data can change en-route. If the bit is set to 1 the option data can change en route. The attack is equally effective whether or not an IPSec Authentication Header(AH) treats the option data as zero valued octets. Hence we can include this bit in generating option types. The acceptable option types would be laid out like below +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- - - - - - - - - | Option Type | Opt Data Len | Option Data +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- - - - - - - - - |0 0 x x x x x x|...............|................. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- - - - - - - - - Figure 1: Option type layout Since the option types 0(0x00) and 1(0x01) are reserved for the Pad1 and PadN options in [RFC2460] we exclude these from the acceptable range as well. So we choose the option type identifiers for each of these options to be in the range 0x02-0x63. More option types defined by other RFCs can be excluded from the attack as and when they are allocated by the IANA. Examples are Tunnel Encapsulation limit (0x04) and Router Alert (0x05). 2.1 Effects of the attack The attack can be used to cripple the routers by attacking the control processor rather than the forwarding plane. Since the control traffic, like the routing protocols, shares the same resources with this traffic, this kind of attack may be hard to control. On routers having separate Control and Forwarding elements only the Control traffic would be affected. For routers whose the Control and Forwarding elements are fused together this would lead to problems with forwarding packets as well. Krishnan Expires December 14, 2004 [Page 4] Internet-Draft Arrangement of Hop-by-Hop options June 2004 3. Optimal arrangement of options This attack can be mitigated by restricting each option type to occur only once in a given extension header. Since it would be computationally expensive for each ipv6 node to remember all the option types which have already occurred in the header, it makes sense to specify some kind of ordering of the option type identifiers within the hop by hop options header. The most efficient arrangement is to arrange the options in descending order of the numerical value of the option type identifier. With this arrangement it is trivial to check if an option has occurred before. The IPv6 node has to remember and compare to only the last encountered option in addition to the current one rather than remembering and comparing all the previously encountered options. The reserved option types 0x00(Pad1) and 0x01(PadN) options MAY occur anywhere in the header and they are not considered for this check. This exception leaves the door open for another class of DoS attacks. The attacker can use just the Pad1 and PadN options multiple times in the header to achieve the same effect as the previously detailed attack. Hence it becomes necessary to add one more restriction. Two padding options MUST NOT appear together in the header. Since there is no legitimate case where two pad options have to appear together this will not cause too many problems. The option type identifier space is shared between the hop-by-hop options and the destination options extension headers. Therefore the attack is equally applicable to the destination options header but is not as effective because only the destination node processes the header. Similar language MAY be used to specify the destination options header as well. Krishnan Expires December 14, 2004 [Page 5] Internet-Draft Arrangement of Hop-by-Hop options June 2004 4. Proposed arrangement of options Within an IPv6 hop-by-hop option header each option type MUST NOT occur more than once with the exception of the Pad1(0x00) and PadN(0x01) options. The options MUST be arranged in descending order of the numerical value of the option type identifier with the exception of the Pad1 and the PadN options. The pad options MAY occur anywhere in the header but two pad options MUST be seperated by an option which is not a pad option. So the final receiving algorithm looks like this /* Receiving algorithm for hop-by-hop options */ last_option_was_pad=0; first_option=1; while (more_options) { if (current_option_id & 0xfe) { if (last_option_was_pad) { /* Error: Cannot have two pad options together */ /* Send ICMPv6 message */ } else { last_option_was_pad=1; continue; } } if (current_option_id