idnits 2.17.1 draft-ietf-6man-overlap-fragment-03.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 (July 2, 2009) is 5383 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) July 2, 2009 5 Intended status: Standards Track 6 Expires: January 3, 2010 8 Handling of overlapping IPv6 fragments 9 draft-ietf-6man-overlap-fragment-03 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 January 3, 2010. 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. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 6 62 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 7 63 8. Normative References . . . . . . . . . . . . . . . . . . . . . 7 64 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 7 66 1. Introduction 68 Fragmentation is used in IPv6 when the IPv6 packet will not fit 69 inside the path MTU to its destination. When fragmentation is 70 performed an IPv6 node uses a fragment header as specified in section 71 4.5 of the IPv6 base specification [RFC2460] to break down the 72 datagram into smaller fragments that will fit in the path MTU. The 73 destination node receives these fragments and reassembles them. The 74 algorithm specified for fragmentation in [RFC2460] does not prevent 75 the fragments from overlapping, and this can lead to some security 76 issues with firewalls [RFC4942]. This document explores the issues 77 that can be caused by overlapping fragments. 79 1.1. Conventions used in this document 81 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL","SHALL NOT", 82 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 83 document are to be interpreted as described in [RFC2119]. 85 2. Overlapping Fragments 87 Commonly used firewalls use the algorithm specified in [RFC1858] to 88 weed out malicious packets that try to overwrite parts of the 89 transport layer header to bypass inbound connection checks. 90 [RFC1858] prevents an overlapping fragment attack on an upper layer 91 protocol (in this case TCP) by recommending that packets with 92 fragment offset 1 be dropped. While this works well for IPv4 93 fragments, it will not work for IPv6 fragments. This is because the 94 fragmentable part of the IPv6 packet can contain extension headers 95 before the TCP header, making this check less effective. 97 3. The attack 99 This attack describes how a malicious node can bypass a firewall 100 using overlapping fragments. Consider a sufficiently large IPv6 101 packet that needs to be fragmented. 103 +------------------+--------------------//-----------------------+ 104 | Unfragmentable | Fragmentable | 105 | Part | Part | 106 +------------------+--------------------//-----------------------+ 108 Figure 1: Large IPv6 packet 110 This packet is split into several fragments by the sender so that the 111 packet can fit inside the path MTU. Let's say the packet is split 112 into two fragments. 114 +------------------+--------+--------------------+ 115 | Unfragmentable |Fragment| first | 116 | Part | Header | fragment | 117 +------------------+--------+--------------------+ 119 +------------------+--------+--------------------+ 120 | Unfragmentable |Fragment| second | 121 | Part | Header | fragment | 122 +------------------+--------+--------------------+ 124 Figure 2: Fragmented IPv6 packet 126 Consider the first fragment. Let's say it contains a destination 127 options header (DOH) 80 octets long and is followed by a TCP header. 129 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<==FH 130 |NextHdr=DOH(60)| Reserved | FragmentOffset = 0 |Res|1| 131 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 132 | Identification=aaaabbbb | 133 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<==DOH 134 |NextHdr=TCP(6) | HdrExtLen = 9 | | 135 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + 136 | | 137 . . 138 . Options . 139 . . 140 | | 141 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<==TCP 142 | Source Port | Destination Port | 143 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 144 | Sequence Number | 145 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 146 | Acknowledgment Number | 147 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 148 | Offset| Reserved |U|A|P|R|S|F| Window | 149 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 151 Figure 3: First Fragment 153 The TCP header has the following values of the flags S(YN)=1 and 154 A(CK)=1. This may make an inspecting stateful firewall think that it 155 is a response packet for a connection request initiated from the 156 trusted side of the firewall. Hence it will allow the fragment to 157 pass. It will also allow the following fragments with the same 158 Fragment Identification value in the fragment header to pass through. 160 A malicious node can form a second fragment with a TCP header that 161 changes the flags and sets S(YN)=1 and A(CK)=0. This can change the 162 packet on the receiving end to consider the packet as a connection 163 request instead of a response. By doing this the malicious node has 164 bypassed the firewall's access control to initiate a connection 165 request to a node protected by a firewall. 167 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<==FH 168 |NextHdr=DOH(60)| Reserved | FragmentOffset = 10 |Res|0| 169 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 170 | Identification=aaaabbbb | 171 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+<==TCP 172 | Source Port | Destination Port | 173 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 174 | Sequence Number | 175 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 176 | Acknowledgment Number | 177 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 178 | Offset| Reserved |U|A|P|R|S|F| Window | 179 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 181 Figure 4: Second Fragment 183 Note that this attack is much more serious in IPv6 than in IPv4. In 184 IPv4 the overlapping part of the TCP header did not include the 185 source and destination ports. In IPv6 the attack can easily work to 186 replace the source or destination port with an overlapping fragment. 188 4. Recommendation 190 IPv6 nodes transmitting datagrams that need to be fragmented MUST NOT 191 create overlapping fragments. When reassembling an IPv6 datagram, if 192 one or more its constituent fragments is determined to be an 193 overlapping fragment, the entire datagram (and any constituent 194 fragments, including those not yet received), MUST be silently 195 discarded. 197 5. Security Considerations 199 This document discusses an attack that can be used to bypass IPv6 200 firewalls using overlapping fragments. It recommends disallowing 201 overlapping fragments in order to prevent this attack. 203 6. Acknowledgements 205 The author would like to thank Thomas Narten, Doug Montgomery, 206 Gabriel Montenegro, Remi Denis-Courmont, Marla Azinger, Arnaud 207 Ebalard, Seiichi Kawamura, Behcet Sarikaya, Vishwas Manral, Christian 208 Vogt, and Alfred Hoenes for their reviews and suggestions that made 209 this document better. 211 7. IANA Considerations 213 This document does not require any action from the IANA. 215 8. Normative References 217 [RFC1858] Ziemba, G., Reed, D., and P. Traina, "Security 218 Considerations for IP Fragment Filtering", RFC 1858, 219 October 1995. 221 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 222 Requirement Levels", BCP 14, RFC 2119, March 1997. 224 [RFC2460] Deering, S. and R. Hinden, "Internet Protocol, Version 6 225 (IPv6) Specification", RFC 2460, December 1998. 227 [RFC4942] Davies, E., Krishnan, S., and P. Savola, "IPv6 Transition/ 228 Co-existence Security Considerations", RFC 4942, 229 September 2007. 231 Author's Address 233 Suresh Krishnan 234 Ericsson 235 8400 Blvd Decarie 236 Town of Mount Royal, Quebec 237 Canada 239 Email: suresh.krishnan@ericsson.com