<?xml version="1.0" encoding="US-ASCII"?>
<!--used v2 online-->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">

<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

<?rfc toc="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc strict="no" ?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<?rfc rfcedstyle="yes"?>

<rfc 
	submissionType="IETF"
        ipr="trust200902"
	category="std"
        consensus="yes"
	updates="2460"
	number="7112">
  <front>
    <title abbrev="Implications of Oversized Header Chains">Implications of Oversized IPv6 Header Chains</title>

<author
        fullname="Fernando Gont"
        initials="F."
        surname="Gont">

        <organization abbrev="Huawei Technologies">Huawei Technologies</organization>
	
        <address>

            <postal>    
			<street>Evaristo Carriego 2644</street>
		<code>1706</code><city>Haedo</city>
 		<region>Provincia de Buenos Aires</region>
		<country>Argentina</country>
            </postal>
            <phone>+54 11 4650 8472</phone>

            <email>fgont@si6networks.com</email>

        </address>
    </author>

    <author fullname="Vishwas Manral" initials="V." 
            surname="Manral">
      <organization>Ionos Networks</organization>

      <address>
        <postal>
          <street></street>
          <city>Sunnyvale</city>
          <region>CA</region>
          <code>94089</code>
          <country>US</country>
        </postal>
        <phone>408-447-1497</phone>
        <email>vishwas@ionosnetworks.com</email>

        <uri></uri>
      </address>
    </author>

    <author fullname="Ronald P. Bonica" initials="R." surname="Bonica">
      <organization>Juniper Networks</organization>

      <address>
        <postal>
          <street>2251 Corporate Park Drive</street>

          <city>Herndon</city>

          <region>VA</region>

          <code>20171</code>

          <country>US</country>
        </postal>

        <phone>571 250 5819</phone>

        <email>rbonica@juniper.net</email>
      </address>
    </author>
    <date month="January" year="2014" />

    <area>Internet</area>
    <workgroup>IPv6 maintenance Working Group (6man)</workgroup>





    <abstract>
    <t>
The IPv6 specification allows IPv6 Header Chains of an arbitrary size. The specification also allows options that can, in turn, extend each of the headers. In those scenarios in which the IPv6 Header Chain or options are unusually long and packets are fragmented, or scenarios in which the fragment size is very small, the First Fragment of a packet may fail to include the entire IPv6 Header Chain. This document discusses the interoperability and security problems of such traffic, and updates RFC 2460 such that the First Fragment of a packet is required to contain the entire IPv6 Header Chain.
    </t>
    </abstract>
  </front>

  <middle>
  
   
<section title="Introduction" anchor="intro">


<t>With IPv6, optional internet-layer information is carried in one or more IPv6 Extension Headers <xref target="RFC2460"/>. Extension Headers are placed between the IPv6 header and the Upper-Layer Header in a packet. The term "Header Chain" refers collectively to the IPv6 header, Extension Headers, and Upper-Layer Header occurring in a packet. In those scenarios in which the IPv6 Header Chain is unusually long and packets are fragmented, or scenarios in which the fragment size is very small, the Header Chain may span multiple fragments.</t>

<t>
While IPv4 had a fixed maximum length for the set of all IPv4 options present in a single IPv4 packet, IPv6 does not have any equivalent maximum limit at present.  This document updates the set of IPv6 specifications to create an overall limit on the size of the combination of IPv6 options and IPv6 Extension Headers that is allowed in a single IPv6 packet. Namely, it updates RFC 2460 such that the First Fragment of a fragmented datagram is required to contain the entire IPv6 Header Chain.
</t>

<t>It should be noted that this requirement does not preclude the use of large payloads but, instead, merely requires that all headers, starting from the IPv6 base header and continuing up to the Upper-Layer Header (e.g.,  TCP or the like) be present in the First Fragment.
</t>

</section>


<section title="Requirements Language" anchor="req-language">
<t>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
   <xref target="RFC2119"/>.</t>
</section>

<section title="Terminology" anchor="terminology">

<t>For the purposes of this document, the terms Extension Header, IPv6 Header Chain, First Fragment, and Upper-Layer Header are used as follows:

<list style="hanging">
<t hangText="Extension Header:"><vspace blankLines="1"/>Extension Headers are defined in Section 4 of <xref target="RFC2460"/>. As a result of <xref target="RFC7045"/>, <xref target="IANA-PROTO"/> provides a list of assigned Internet Protocol Numbers and designates which of those protocol numbers also represent Extension Headers.</t>

          <t hangText="First Fragment:"><vspace blankLines="1"/>An IPv6
          fragment with Fragment Offset equal to 0.</t>

<t hangText="IPv6 Header Chain:">
<vspace blankLines="1" />   The IPv6 Header Chain contains an initial IPv6 header, zero or more IPv6 Extension Headers, and optionally, a single Upper-Layer Header.  If an Upper-Layer Header is present, it terminates the header chain; otherwise, the "No Next Header" value  (Next Header = 59) terminates it.<vspace blankLines="1" />

The first member of the IPv6 Header Chain is always an IPv6 header.  For a subsequent header to qualify as a member of the header chain, it must be referenced by the "Next Header" field of the previous member of the header chain.  However, if a second IPv6 header appears in the header chain, as is the case when IPv6 is tunneled over IPv6, the second IPv6 header is considered to be an Upper-Layer Header and terminates the header chain. Likewise, if an Encapsulating Security Payload (ESP) header appears in the header chain, it is considered to be an Upper-Layer Header, and it terminates the header chain.
</t>

<t hangText="Upper-Layer Header:"><vspace blankLines="1"/>
In the general case, the Upper-Layer Header is the first member of the header chain that is neither an IPv6 header nor an IPv6 Extension Header.  However, if either an ESP header, or a second IPv6 header occur in the header chain, they are considered to be Upper-Layer Headers, and they terminate the header chain.
<vspace blankLines="1"/>
Neither the upper-layer payload, nor any protocol data following the upper-layer payload, is considered to be part of the IPv6 Header Chain. In a simple example, if the Upper-Layer Header is a TCP header, the TCP payload is not part of the IPv6 Header Chain. In a more complex example, if the Upper-Layer Header is an ESP header, neither the payload data, nor any of the fields that follow the payload data in the ESP header are part of the IPv6 Header Chain.
</t>
</list>
</t>
</section>



    <section title="Motivation">
      <t>Many forwarding devices implement stateless firewalls. A stateless
      firewall enforces a forwarding policy on a packet-by-packet basis. In
      order to enforce its forwarding policy, the stateless firewall may need
      to glean information from both the IPv6 and upper-layer headers.</t>

<t>For example, assume that a stateless firewall discards all traffic
   received from an interface unless it is destined for a particular TCP
   port on a particular IPv6 address.  When this firewall is presented
   with a fragmented packet that is destined for a different TCP port, 
   and the entire header chain is contained within the First Fragment, 
   the firewall discards the First Fragment and allows subsequent 
   fragments to pass.  Because the First Fragment was discarded, 
   the packet cannot be reassembled at the destination. Insomuch as 
   the packet cannot be reassembled, the forwarding policy is enforced.
</t>
      <t>However, when the firewall is presented with a fragmented packet and
      the header chain spans multiple fragments, the First Fragment does not
      contain enough information for the firewall to enforce its forwarding
      policy. Lacking sufficient information, the stateless firewall either
      forwards or discards that fragment. Regardless of the action that it
      takes, it may fail to enforce its forwarding policy.</t>
    </section>


    <section title="Updates to RFC 2460">
      <t>When a host fragments an IPv6 datagram, it MUST include the entire IPv6 Header Chain in
      the First Fragment.</t>

<t>A host that receives a First Fragment that does not satisfy the above-stated requirement SHOULD discard the packet and SHOULD send an ICMPv6 error message to the
  source address of the offending packet (subject to the rules for ICMPv6 errors specified in <xref target="RFC4443"/>). However, for backwards compatibility, implementations MAY include a configuration option that allows such fragments to be accepted.
</t>

      <t>Likewise, an intermediate system (e.g., router or firewall) that
      receives an IPv6 First Fragment that does not satisfy the above-stated
      requirement MAY discard that packet, and it MAY send an ICMPv6 error
      message to the source address of the offending packet (subject to the rules for ICMPv6 error
      messages specified in <xref target="RFC4443"/>). Intermediate systems having this capability SHOULD support configuration (e.g., enable/disable) of whether or not such packets are dropped by the intermediate system.</t>

<t>If a host or intermediate system discards a First Fragment because it
   does not satisfy the above-stated requirement and sends an ICMPv6
   error message due to the discard, then the ICMPv6 error message MUST
   be Type 4 ("Parameter Problem") and MUST use Code 3 ("First
   Fragment has incomplete IPv6 Header Chain").  The Pointer field
   contained by the ICMPv6 Parameter Problem message MUST be set to
   zero. The format for the ICMPv6 error message is the same regardless of whether a host or intermediate system originates it.</t>

<t>As a result of the above-mentioned requirement, a packet's header chain length cannot exceed the Path MTU associated with its destination. Hosts discover the Path MTU using procedures such as those defined in <xref target="RFC1981"/> and <xref target="RFC4821"/>. Hosts that do not discover the Path MTU MUST limit the IPv6 Header Chain length to 1280 bytes. Limiting the IPv6 Header Chain length to 1280 bytes ensures that the header chain length does not exceed the IPv6 minimum MTU <xref target="RFC2460"/>.
</t>
<t>

</t>
    </section>



	<section title="IANA Considerations" anchor="iana-considerations">
<t>IANA has added the following "Type 4 - Parameter Problem" message to the "Internet Control Message Protocol version 6 (ICMPv6) Parameters" registry:</t>
<figure>
<artwork>
   CODE     NAME/DESCRIPTION
    3       IPv6 First Fragment has incomplete IPv6 Header Chain
</artwork>
</figure>


</section>

    <section title="Security Considerations">
<t>No new security exposures or issues are raised by this document. This document describes how undesirably fragmented packets can be leveraged to evade stateless packet filtering. Having made that observation, this document updates <xref target="RFC2460"/> so that undesirably fragmented packets are forbidden. Therefore, a security vulnerability is removed.
</t>

<t>This specification allows nodes that drop the aforementioned packets to signal such packet drops with ICMPv6 "Parameter Problem, IPv6 First Fragment has incomplete IPv6 header chain" (Type 4, Code 3) error messages.</t>

<t>As with all ICMPv6 error/diagnostic messages, deploying Source Address Forgery Prevention filters helps reduce the chances of an attacker successfully performing a reflection attack by sending forged illegal packets with the victim's/target's IPv6 address as the IPv6 source address of the illegal packet <xref target="RFC2827"/> <xref target="RFC3704"/>.</t>
<t>A firewall that performs stateless deep packet inspection (i.e., examines application payload content) might still be unable to correctly process fragmented packets, even if the IPv6 Header Chain is not fragmented.
</t>

    </section>

    <section title="Acknowledgements">
<t>The authors would like to thank Ran Atkinson for contributing text and ideas that were incorporated into this document.</t>

<t>The authors would like to thank (in alphabetical order) Ran Atkinson, Fred Baker, Stewart Bryant, Brian Carpenter, Benoit Claise, Dominik Elsbroek, Wes George, Mike Heard, Bill Jouris, Suresh Krishnan, Dave Thaler, Ole Troan, Eric Vyncke, and Peter Yee, for providing valuable comments on earlier versions of this document.</t>

    </section>


  </middle>

  <back>
  <references title='Normative References'>
	<?rfc include="reference.RFC.1981" ?>
	<?rfc include="reference.RFC.2119" ?>
	<?rfc include="reference.RFC.2460" ?>
	<?rfc include="reference.RFC.4443" ?>
	<?rfc include="reference.RFC.4821" ?>


<reference anchor='RFC7045'>

<front>
<title>Transmission and Processing of IPv6 Extension Headers</title>
<author initials='B.' surname='Carpenter' fullname='B. Carpenter'>
<organization /></author>
<author initials='S.' surname='Jiang' fullname='S. Jiang'>
<organization /></author>
<date year='2013' month='December' />
<abstract>
<t>Various IPv6 extension headers have been standardised since the IPv6 standard was first published.  This document updates RFC 2460 to clarify how intermediate nodes should deal with such extension headers and with any that are defined in the future.  It also specifies how extension headers should be registered by IANA, with a corresponding minor update to RFC 2780.</t></abstract></front>

<seriesInfo name='RFC' value='7045' />
<format type='TXT' octets='21852' target='http://www.rfc-editor.org/rfc/rfc7045.txt' />
</reference>


  </references>

  <references title='Informative References'>
	<?rfc include="reference.RFC.2827" ?>
	<?rfc include="reference.RFC.3704" ?>

      <reference anchor="IANA-PROTO"
                 target="http://www.iana.org/assignments/protocol-numbers">
        <front>
          <title>Protocol Numbers</title>

          <author fullname="">
            <organization>Internet Assigned Numbers Authority</organization>
          </author>

          <date month="" year=""/>
        </front>
      </reference>

</references>

  </back>
</rfc>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
