<?xml version="1.0" encoding="US-ASCII"?>

<!--xml2rfcv2-->

<!DOCTYPE rfc SYSTEM "rfc2629.dtd">

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

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

<rfc number="6980" submissionType="IETF" consensus="yes"
        ipr="trust200902"
        category="std"
        updates="3971, 4861">
  <front>
    <title abbrev="ND and IPv6 Fragmentation">Security Implications of IPv6 Fragmentation with IPv6 Neighbor Discovery</title>

    <author fullname="Fernando Gont" initials="F." surname="Gont">
      <organization abbrev="SI6 Networks / UTN-FRH">SI6 Networks / UTN-FRH</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>

        <uri>http://www.si6networks.com</uri>
      </address>
    </author>
        
        
    <date month="August" year="2013" />
   <area>Internet</area>
    <workgroup>IPv6 maintenance Working Group (6man)</workgroup>

<keyword>vulnerabilities, evasion, monitoring</keyword>

<!-- [rfced] FYI, we have used xml2rfc v2 (available from 
http://xml.resource.org) to convert this document to text. -->

    <abstract>
    <t>
This document analyzes the security implications of employing IPv6
fragmentation with Neighbor Discovery (ND) messages. It updates RFC 4861 such
that use of the IPv6 Fragmentation Header is forbidden in all Neighbor
Discovery messages, thus allowing for simple and effective countermeasures for
Neighbor Discovery attacks. Finally, it discusses the security implications of using IPv6 fragmentation with SEcure Neighbor Discovery (SEND) and formally updates RFC 3971 to provide advice regarding how the aforementioned security implications can be mitigated.</t>
    </abstract>
  </front>

  <middle>
  
  
<section title="Introduction" anchor="intro">
<t>
The Neighbor Discovery Protocol (NDP) is specified in RFC 4861 <xref
target="RFC4861"/>.  It is used by both hosts and routers.  Its functions
include Neighbor Discovery (ND), Router Discovery (RD), address
autoconfiguration, address resolution, Neighbor Unreachability Detection (NUD),
Duplicate Address Detection (DAD), and redirection.
</t>
<t>Many of the possible attacks against the Neighbor Discovery Protocol are
discussed in detail in <xref target="RFC3756"/>. In order to mitigate the
aforementioned possible attacks, SEcure Neighbor Discovery (SEND) was
standardized. SEND employs a number of mechanisms to certify the origin of
Neighbor Discovery packets and the authority of routers, and to protect
Neighbor Discovery packets from being the subject of modification or replay
attacks.</t>

<t>However, a number of factors, such as the high administrative overhead of
deploying trust anchors and the unavailability of SEND implementations for many
widely deployed operating systems, make SEND hard to deploy <xref target="Gont-DPSC"/>. Thus, in many general scenarios, it may be necessary and/or convenient to use other mitigation techniques for NDP-based attacks. The following mitigations are currently available for NDP attacks:</t>
<t>
<list style="symbols">
<t>Static Access Control Lists (ACLs) in switches</t>
<t>Layer-2 filtering of Neighbor Discovery packets (such as RA-Guard <xref target="RFC6105"/>)</t>
<t>Neighbor Discovery monitoring tools (e.g., NDPMon <xref
target="NDPMon"/> and ramond <xref target="ramond"/>)</t>
<t>Intrusion Prevention Systems (IPS)</t>
</list>
</t>

<t>
IPv6 Router Advertisement Guard (RA-Guard) is a mitigation technique for attack
vectors based on ICMPv6 Router Advertisement (RA) messages. It is meant to
block attack packets at a layer-2 device before the attack packets actually
reach the target nodes. <xref target="RFC6104"/> describes the problem
statement of "Rogue IPv6 Router Advertisements", and <xref target="RFC6105"/>
specifies the "IPv6 Router Advertisement Guard" functionality.</t>

<t>Tools such as NDPMon <xref target="NDPMon"/> and ramond <xref
target="ramond"/> aim to monitor Neighbor Discovery traffic in the hopes of
detecting possible attacks when there are discrepancies between the information
advertised in Neighbor Discovery packets and the information stored on a local
database.</t>

<t>Some Intrusion Prevention Systems (IPS) can mitigate Neighbor Discovery attacks. We recommend that Intrusion Prevention Systems implement mitigations for NDP attacks.
</t>

<t>IPv6 fragmentation introduces a key challenge for these mitigation or
monitoring techniques, since it is trivial for an attacker to conceal his
attack by fragmenting his packets into multiple fragments. This may
limit or even eliminate the effectiveness of the aforementioned mitigation or
monitoring techniques. Recent work <xref target="CPNI-IPv6"/> indicates that
current implementations of the aforementioned mitigations for NDP attacks can
be trivially evaded. For example, as noted in <xref target="RA-GUARD"/>,
current RA-Guard implementations can be trivially evaded by fragmenting the
attack packets into multiple fragments, such that the layer-2 device cannot
find all the necessary information to perform packet filtering in the same
packet. While Neighbor Discovery monitoring tools could (in theory) implement IPv6 fragment reassembly, this is usually an arms-race with the attacker (an attacker can generate lots of forged fragments to "confuse" the monitoring tools), and therefore the aforementioned tools are unreliable for the detection of such attacks.
</t>


<t><xref target="ND"/> analyzes the use of IPv6 fragmentation in traditional
Neighbor Discovery. <xref target="SEND"/> analyzes the use of IPv6
fragmentation in SEcure Neighbor Discovery (SEND). <xref target="rationale"/>
provides the rationale for forbidding the use of IPv6 fragmentation with
Neighbor Discovery. <xref target="specification"/> formally updates RFC 4861
such that the use of the IPv6 Fragment Header with traditional Neighbor
Discovery is forbidden, and also formally updates RFC 3971 by providing advice
on the use of IPv6 fragmentation with SEND. <xref target="operational-advice"/>
provides operational advice about interoperability problems arising from the
use of IPv6 fragmentation with Neighbor Discovery.</t>

<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
   RFC 2119 <xref target="RFC2119"/>.</t>

</section>

<section title="Traditional Neighbor Discovery and IPv6 Fragmentation" anchor="ND">

<t>The only potential use case for IPv6 fragmentation with traditional (i.e.,
non-SEND) IPv6 Neighbor Discovery would be that in which a Router Advertisement
must include a large number of options (Prefix Information Options, Route
Information Options, etc.). However, this could still be achieved without
employing fragmentation, by splitting the aforementioned information into
multiple Router Advertisement messages.</t>

<t>
<list style="hanging">
<t>Some Neighbor Discovery implementations are known to silently ignore Router
Advertisement messages that employ fragmentation. Therefore, splitting the
necessary information into multiple RA messages (rather than sending a
large RA message that is fragmented into multiple IPv6 fragments) is
probably desirable even from an interoperability point of view.</t>
</list>
</t>

<t>Thus, avoiding the use of IPv6 fragmentation in traditional Neighbor Discovery would greatly simplify and improve the effectiveness of monitoring and filtering Neighbor Discovery traffic and would also prevent interoperability problems with those implementations that do not support fragmentation in Neighbor Discovery messages.</t>
</section>

<section title="SEcure Neighbor Discovery (SEND) and IPv6 Fragmentation" anchor="SEND">
<t>SEND packets typically carry more information than traditional Neighbor
Discovery packets: for example, they include additional options such as the
Cryptographically Generated Address (CGA) option and the RSA signature option.</t>
<t>When SEND nodes employ any of the Neighbor Discovery messages specified in <xref target="RFC4861"/>, the situation is roughly the same: if more information than would fit in a non-fragmented Neighbor Discovery packet needs to be sent, it should be split into multiple Neighbor Discovery messages (such that IPv6 fragmentation is avoided).</t>
<t>However, Certification Path Advertisement (CPA)  messages (specified in <xref
target="RFC3971"/>) pose a different situation, since the Certificate Option
they include typically contains much more information than any other Neighbor
Discovery option. For example, Appendix C of <xref target="RFC3971"/> reports
Certification Path Advertisement messages from 1050 to 1066 bytes on an
Ethernet link layer. Since the size of CPA messages could potentially exceed
the MTU of the local link, <xref target="specification"/> recommends that
fragmented CPA messages be processed normally, but discourages the use of keys
that would result in fragmented CPA messages.
</t>

<t>It should be noted that relying on fragmentation opens the door to a variety
of IPv6 fragmentation-based attacks against SEND. In particular, if an attacker
is located on the same broadcast domain as the victim host and Certification
Path Advertisement messages employ IPv6 fragmentation, it would be trivial for
the attacker to forge IPv6 fragments such that they result in "Fragment ID
collisions", causing both the attack fragments and the legitimate fragments to
be discarded by the victim node. This would eventually cause Authorization
Delegation Discovery (Section 6 of <xref target="RFC3971"/>) to fail, thus
leading the host to (depending on local configuration) either fall back to
unsecured mode or reject the corresponding Router Advertisement messages
(possibly resulting in a denial of service).</t>
</section>

<section title="Rationale for Forbidding IPv6 Fragmentation in Neighbor Discovery" anchor="rationale">
<t>A number of considerations should be made regarding the use of IPv6 fragmentation with Neighbor Discovery:
<list style="symbols">
<t>A significant number of existing implementations already silently drop fragmented ND messages, so the use of IPv6 fragmentation may hamper interoperability among IPv6 implementations.</t>
<t>Although it is possible to build an ND message that needs to be fragmented, such packets are unlikely to exist in the real world because of the large number of options that would be required for the resulting packet to exceed the minimum IPv6 MTU of 1280 octets.
</t>
<t>If an ND message was so large as to need fragmentation, there is an option to distribute the same information amongst more than one message, each of which is small enough to not need fragmentation.
</t>
</list>
Thus, forbidding the use of IPv6 fragmentation with Neighbor Discovery normalizes existing behavior and sets the expectations of all implementations to the existing lowest common denominator.
</t>
</section>

<section title="Specification" anchor="specification">
<t>Nodes MUST NOT employ IPv6 fragmentation for sending any of the following Neighbor Discovery and SEcure Neighbor Discovery messages:

<list style="symbols">
<t>Neighbor Solicitation</t>
<t>Neighbor Advertisement</t>
<t>Router Solicitation</t>
<t>Router Advertisement</t>
<t>Redirect</t>
<t>Certification Path Solicitation</t>
</list>
</t>

<t>Nodes SHOULD NOT employ IPv6 fragmentation for sending the following messages (see Section 6.4.2 of <xref target="RFC3971"/>):
<list style="symbols">
<t>Certification Path Advertisement</t>
</list>
</t>

<t>
Nodes MUST silently ignore the following Neighbor Discovery and SEcure Neighbor Discovery messages if the packets carrying them include an IPv6 Fragmentation Header:
<list style="symbols">
<t>Neighbor Solicitation</t>
<t>Neighbor Advertisement</t>
<t>Router Solicitation</t>
<t>Router Advertisement</t>
<t>Redirect</t>
<t>Certification Path Solicitation</t>
</list>
</t>

<t>Nodes SHOULD normally process the following messages when the packets carrying them include an IPv6 Fragmentation Header:
<list style="symbols">
<t>Certification Path Advertisement</t>
</list>
</t>
<t>SEND nodes SHOULD NOT employ keys that would result in fragmented CPA messages.</t>
</section>

<section title="Operational Advice" anchor="operational-advice">
<t>An operator detecting that Neighbor Discovery traffic is being silently
dropped should find whether the corresponding Neighbor Discovery messages are
employing IPv6 fragmentation. If they are, it is likely that the devices
receiving such packets are silently dropping them merely because they employ
IPv6 fragmentation. In such a case, an operator should check whether the
sending device has an option to prevent fragmentation of ND messages, and/or
see whether it is possible to reduce the options carried on such messages. We
note that solving this (unlikely) problem might require a software upgrade to a
version that does not employ IPv6 fragmentation with Neighbor Discovery.
</t>
</section>

    <section title="Security Considerations">
<t>The IPv6 Fragmentation Header can be leveraged to circumvent network
monitoring tools and current implementations of mechanisms such as RA-Guard
<xref target="RA-GUARD"/>. By updating the relevant specifications such
that the IPv6 Fragment Header is not allowed in any Neighbor Discovery messages
except Certification Path Advertisement messages, protection of local nodes
against Neighbor Discovery attacks, as well as the monitoring of
Neighbor Discovery traffic, are greatly simplified.
</t>

<t>As noted in <xref target="SEND"/>, the use of SEND could potentially result
in fragmented Certification Path Advertisement messages, thus allowing an
attacker to employ IPv6 fragmentation-based attacks against such
messages. Therefore, to the extent that is possible, such use of fragmentation
should be avoided.
</t>

    </section>

    <section title="Acknowledgements">
<t>The author would like to thank (in alphabetical order) Mikael Abrahamsson,
Ran Atkinson, Ron Bonica, Jean-Michel Combes, David Farmer, Adrian Farrel,
Stephen Farrell, Roque Gagliano, Brian Haberman, Bob Hinden, Philip Homburg,
Ray Hunter, Arturo Servin, Mark Smith, and Martin Stiemerling for providing
valuable comments on earlier versions of this document.</t>

<t>The author would also like to thank Roque Gagliano for contributing
the information regarding message sizes in <xref target="message-sizes"/>, and
Arturo Servin for presenting this document at IETF 81.</t>

<t>Finally, the author would like to thank his brother, friend, and colleague, Guillermo Gont, for his love and support.</t>

<t>This document resulted from the project "Security Assessment of the Internet
Protocol version 6 (IPv6)" <xref target="CPNI-IPv6"/>, carried out by Fernando
Gont on behalf of the UK Centre for the Protection of National Infrastructure
(CPNI).</t>

    </section>


  </middle>

  <back>

  <references title="Normative References">
        <?rfc include="reference.RFC.2119" ?>
        <?rfc include="reference.RFC.3971" ?>
        <?rfc include="reference.RFC.4861" ?>
        <?rfc include="reference.RFC.6494" ?>
  </references>

  <references title="Informative References">
        <?rfc include="reference.RFC.3756" ?>
        <?rfc include="reference.RFC.6104" ?>
        <?rfc include="reference.RFC.6105" ?>

        <reference anchor="NDPMon" target="http://ndpmon.sourceforge.net/">
                <front>
            <title>NDPMon - IPv6 Neighbor Discovery Protocol Monitor</title>
            <author><organization>SourceForge</organization></author>
            <date month="July" year="2012"/>
                </front>
        </reference>


        <reference anchor="ramond" target="http://ramond.sourceforge.net/">
                <front>
            <title>ramond</title>
            <author><organization>SourceForge</organization></author>
            <date month="January" year="2009"/>
                </front>
        </reference>

<!-- draft-ietf-v6ops-ra-guard-implementation (MISSREF) -->
<reference
  anchor="RA-GUARD"><front><title>Implementation Advice for IPv6 Router Advertisement Guard (RA-Guard)</title><author
  initials="F" surname="Gont" fullname="Fernando Gont"><organization/></author>
<date month="November" year="2012"/>
</front>
<seriesInfo name="Work in" value="Progress"/>
</reference>

    <reference anchor="CPNI-IPv6">
  <front>
<title>Security Assessment of the Internet Protocol version 6 (IPv6)</title>
  <author initials="F.G." surname="Gont" fullname="F. Gont">
   <organization>Centre for the Protection of National Infrastructure</organization>
  </author>
  <date month="" year="(available on request)"/>
  </front>
      <seriesInfo name="" value="UK Centre for the Protection of National Infrastructure"/>
  </reference>

  <reference anchor="Gont-DPSC" target="http://www.si6networks.com/presentations/deepsec2011/fgont-deepsec2011-ipv6-security.pdf">
     <front>
      <title>Results of a Security Assessment of the Internet Protocol version 6 (IPv6)</title>
<author initials="F." surname="Gont" fullname="Fernando Gont">
        <organization abbrev="SI6 Networks">SI6 Networks</organization>
    </author>  
<date month="November" year="2011"/>
        </front>
    <seriesInfo name="DEEPSEC 2011" value="Conference, Vienna, Austria"/>
    </reference>

</references>

<section title="Message Size When Carrying Certificates" anchor="message-sizes">
<t>This section aims at estimating the size of normal Certification Path
Advertisement messages.</t>

<t>Considering a Certification Path Advertisement (CPA) such as that of
Appendix C of <xref target="RFC3971"/> (certification path length of 4, between
1 and 4 address prefix extensions, and a key length of 1024 bits), the
certificate lengths range between 864 and 888 bytes (and the corresponding
Ethernet packets from 1050 to 1066 bytes) <xref target="RFC3971"/>.</t>

<t>Updating the aforementioned packet size to account for the larger (2048
bits) keys required by <xref target="RFC6494"/> results in packet sizes ranging
from 1127 to 1238 bytes, which are smaller than the minimum IPv6 MTU (1280
bytes) and much smaller than the ubiquitous Ethernet MTU (1500 bytes).

</t>
<t>However, we note that packet sizes may vary depending on a number of
factors, including:
<list style="symbols">
<t>the number of prefixes included in the certificate</t>
<t>the length of Fully Qualified Domain Names (FQDNs) in Trust Anchor (TA) options <xref target="RFC3971"/> (if present)</t>
</list>
If larger key sizes (e.g., 4096 bits) are required in the future, a larger MTU
size might be required to convey such information in Neighbor Discovery packets without the need to employ fragmentation.
</t>

</section>

</back>
</rfc>
