idnits 2.17.1 draft-ietf-6man-overlap-fragment-02.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** The document seems to lack a License Notice according IETF Trust Provisions of 28 Dec 2009, Section 6.b.i or Provisions of 12 Sep 2009 Section 6.b -- however, there's a paragraph with a matching beginning. Boilerplate error? (You're using the IETF Trust Provisions' Section 6.b License Notice from 12 Feb 2009 rather than one of the newer Notices. See https://trustee.ietf.org/license-info/.) 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 : ---------------------------------------------------------------------------- -- The draft header indicates that this document updates RFC2460, but the abstract doesn't seem to mention this, which it should. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords -- however, there's a paragraph with a matching beginning. Boilerplate error? (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). (Using the creation date from RFC2460, updated by this document, for RFC5378 checks: 1997-07-30) -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (March 8, 2009) is 5528 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Downref: Normative reference to an Informational RFC: RFC 1858 ** Obsolete normative reference: RFC 2460 (Obsoleted by RFC 8200) ** Downref: Normative reference to an Informational RFC: RFC 4942 Summary: 4 errors (**), 0 flaws (~~), 2 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 6man Working Group S. Krishnan 3 Internet-Draft Ericsson 4 Updates: 2460 (if approved) March 8, 2009 5 Intended status: Standards Track 6 Expires: September 9, 2009 8 Handling of overlapping IPv6 fragments 9 draft-ietf-6man-overlap-fragment-02 11 Status of this Memo 13 This Internet-Draft is submitted to IETF in full conformance with the 14 provisions of BCP 78 and BCP 79. 16 Internet-Drafts are working documents of the Internet Engineering 17 Task Force (IETF), its areas, and its working groups. Note that 18 other groups may also distribute working documents as Internet- 19 Drafts. 21 Internet-Drafts are draft documents valid for a maximum of six months 22 and may be updated, replaced, or obsoleted by other documents at any 23 time. It is inappropriate to use Internet-Drafts as reference 24 material or to cite them other than as "work in progress." 26 The list of current Internet-Drafts can be accessed at 27 http://www.ietf.org/ietf/1id-abstracts.txt. 29 The list of Internet-Draft Shadow Directories can be accessed at 30 http://www.ietf.org/shadow.html. 32 This Internet-Draft will expire on September 9, 2009. 34 Copyright Notice 36 Copyright (c) 2009 IETF Trust and the persons identified as the 37 document authors. All rights reserved. 39 This document is subject to BCP 78 and the IETF Trust's Legal 40 Provisions Relating to IETF Documents in effect on the date of 41 publication of this document (http://trustee.ietf.org/license-info). 42 Please review these documents carefully, as they describe your rights 43 and restrictions with respect to this document. 45 Abstract 47 The fragmentation and reassembly algorithm specified in the base IPv6 48 specification allows fragments to overlap. This document 49 demonstrates the security issues with allowing overlapping fragments 50 and updates the IPv6 specification to explicitly forbid overlapping 51 fragments. 53 Table of Contents 55 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 56 1.1. Conventions used in this document . . . . . . . . . . . . . 3 57 2. Overlapping Fragments . . . . . . . . . . . . . . . . . . . . . 3 58 3. The attack . . . . . . . . . . . . . . . . . . . . . . . . . . 4 59 4. Recommendation . . . . . . . . . . . . . . . . . . . . . . . . 6 60 5. Security Considerations . . . . . . . . . . . . . . . . . . . . 6 61 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 6 62 7. Normative References . . . . . . . . . . . . . . . . . . . . . 6 63 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 7 65 1. Introduction 67 Fragmentation is used in IPv6 when the IPv6 packet will not fit 68 inside the path MTU to its destination. When fragmentation is 69 performed an IPv6 node uses a fragment header as specified in section 70 4.5 of the IPv6 base specification [RFC2460] to break down the 71 datagram into smaller fragments that will fit in the path MTU. The 72 destination node receives these fragments and reassembles them. The 73 algorithm specified for fragmentation in [RFC2460] does not prevent 74 the fragments from overlapping, and this can lead to some security 75 issues with firewalls [RFC4942]. This document explores the issues 76 that can be caused by overlapping fragments. 78 1.1. Conventions used in this document 80 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL","SHALL NOT", 81 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 82 document are to be interpreted as described in [RFC2119]. 84 2. Overlapping Fragments 86 Commonly used firewalls use the algorithm specified in [RFC1858] to 87 weed out malicious packets that try to overwrite parts of the 88 transport layer header to bypass inbound connection checks. 89 [RFC1858] prevents an overlapping fragment attack on an upper layer 90 protocol (in this case TCP) by recommending that packets with 91 fragment offset 1 be dropped. While this works well for IPv4 92 fragments, it will not work for IPv6 fragments. This is because the 93 fragmentable part of the IPv6 packet can contain extension headers 94 before the TCP header, making this check less effective. 96 3. The attack 98 This attack describes how a malicious node can bypass a firewall 99 using overlapping fragments. Consider a sufficiently large IPv6 100 packet that needs to be fragmented. 102 +------------------+--------------------//-----------------------+ 103 | Unfragmentable | Fragmentable | 104 | Part | Part | 105 +------------------+--------------------//-----------------------+ 107 Figure 1: Large IPv6 packet 109 This packet is split into several fragments by the sender so that the 110 packet can fit inside the path MTU. Let's say the packet is split 111 into two fragments. 113 +------------------+--------+--------------------+ 114 | Unfragmentable |Fragment| first | 115 | Part | Header | fragment | 116 +------------------+--------+--------------------+ 118 +------------------+--------+--------------------+ 119 | Unfragmentable |Fragment| second | 120 | Part | Header | fragment | 121 +------------------+--------+--------------------+ 123 Figure 2: Fragmented IPv6 packet 125 Consider the first fragment. Let's say it contains a destination 126 options header (DOH) 80 octets long and is followed by a TCP header. 128 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<==FH 129 |NextHdr=DOH(60)| Reserved | FragmentOffset = 0 |Res|1| 130 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 131 | Identification=aaaabbbb | 132 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<==DOH 133 |NextHdr=TCP(6) | HdrExtLen = 9 | | 134 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + 135 | | 136 . . 137 . Options . 138 . . 139 | | 140 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<==TCP 141 | Source Port | Destination Port | 142 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 143 | Sequence Number | 144 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 145 | Acknowledgment Number | 146 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 147 | Offset| Reserved |U|A|P|R|S|F| Window | 148 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 150 Figure 3: First Fragment 152 The TCP header has the following values of the flags S(YN)=1 and 153 A(CK)=1. This makes an inspecting stateful firewall think that it is 154 a response packet for a connection request initiated from the trusted 155 side of the firewall. Hence it will allow the fragment to pass. It 156 will also allow the following fragments with the same Fragment 157 Identification value in the fragment header to pass through. 159 A malicious node can form a second fragment with a TCP header that 160 changes the flags and sets S(YN)=1 and A(CK)=0. This would change 161 the packet on the receiving end to consider the packet as a 162 connection request instead of a response. By doing this the 163 malicious node has bypassed the firewall's access control to initiate 164 a connection request to a node protected by a firewall. 166 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<==FH 167 |NextHdr=DOH(60)| Reserved | FragmentOffset = 10 |Res|0| 168 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 169 | Identification=aaaabbbb | 170 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<==TCP 171 | Source Port | Destination Port | 172 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 173 | Sequence Number | 174 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 175 | Acknowledgment Number | 176 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 177 | Offset| Reserved |U|A|P|R|S|F| Window | 178 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 180 Figure 4: Second Fragment 182 Note that this attack is much more serious in IPv6 than in IPv4. In 183 IPv4 the overlapping part of the TCP header did not include the 184 source and destination ports. In IPv6 the attack can easily work to 185 replace the source or destination port with an overlapping fragment. 187 4. Recommendation 189 IPv6 nodes transmitting datagrams that need to be fragmented MUST NOT 190 create overlapping fragments. IPv6 nodes that receive a fragment 191 that overlaps with a previously received fragment MUST cease the 192 reassembly process and MUST discard the previously received fragments 193 with the same IPv6 Source Address, IPv6 Destination Address and 194 Fragment Identification. 196 5. Security Considerations 198 This document discusses an attack that can be used to bypass IPv6 199 firewalls using overlapping fragments. It recommends disallowing 200 overlapping fragments in order to prevent this attack. 202 6. IANA Considerations 204 This document does not require any action from the IANA. 206 7. Normative References 208 [RFC1858] Ziemba, G., Reed, D., and P. Traina, "Security 209 Considerations for IP Fragment Filtering", RFC 1858, 210 October 1995. 212 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 213 Requirement Levels", BCP 14, RFC 2119, March 1997. 215 [RFC2460] Deering, S. and R. Hinden, "Internet Protocol, Version 6 216 (IPv6) Specification", RFC 2460, December 1998. 218 [RFC4942] Davies, E., Krishnan, S., and P. Savola, "IPv6 Transition/ 219 Co-existence Security Considerations", RFC 4942, 220 September 2007. 222 Author's Address 224 Suresh Krishnan 225 Ericsson 226 8400 Blvd Decarie 227 Town of Mount Royal, Quebec 228 Canada 230 Email: suresh.krishnan@ericsson.com