draft-ietf-v6ops-ra-guard-implementation-07.txt   rfc7113.txt 
IPv6 Operations Working Group (v6ops) F. Gont Internet Engineering Task Force (IETF) F. Gont
Internet-Draft UK CPNI Request for Comments: 7113 Huawei Technologies
Updates: 6105 (if approved) November 14, 2012 Updates: 6105 February 2014
Intended status: Informational Category: Informational
Expires: May 18, 2013 ISSN: 2070-1721
Implementation Advice for IPv6 Router Advertisement Guard (RA-Guard) Implementation Advice for IPv6 Router Advertisement Guard (RA-Guard)
draft-ietf-v6ops-ra-guard-implementation-07
Abstract Abstract
The IPv6 Router Advertisement Guard (RA-Guard) mechanism is commonly The IPv6 Router Advertisement Guard (RA-Guard) mechanism is commonly
employed to mitigate attack vectors based on forged ICMPv6 Router employed to mitigate attack vectors based on forged ICMPv6 Router
Advertisement messages. Many existing IPv6 deployments rely on RA- Advertisement messages. Many existing IPv6 deployments rely on
Guard as the first line of defense against the aforementioned attack RA-Guard as the first line of defense against the aforementioned
vectors. However, some implementations of RA-Guard have been found attack vectors. However, some implementations of RA-Guard have been
to be prone to circumvention by employing IPv6 Extension Headers. found to be prone to circumvention by employing IPv6 Extension
This document describes the evasion techniques that affect the Headers. This document describes the evasion techniques that affect
aforementioned implementations, and formally updates RFC 6105, such the aforementioned implementations and formally updates RFC 6105,
that the aforementioned RA-Guard evasion vectors are eliminated. such that the aforementioned RA-Guard evasion vectors are eliminated.
Status of this Memo
This Internet-Draft is submitted in full conformance with the Status of This Memo
provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering This document is not an Internet Standards Track specification; it is
Task Force (IETF). Note that other groups may also distribute published for informational purposes.
working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months This document is a product of the Internet Engineering Task Force
and may be updated, replaced, or obsoleted by other documents at any (IETF). It represents the consensus of the IETF community. It has
time. It is inappropriate to use Internet-Drafts as reference received public review and has been approved for publication by the
material or to cite them other than as "work in progress." Internet Engineering Steering Group (IESG). Not all documents
approved by the IESG are a candidate for any level of Internet
Standard; see Section 2 of RFC 5741.
This Internet-Draft will expire on May 18, 2013. Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
http://www.rfc-editor.org/info/rfc7113.
Copyright Notice Copyright Notice
Copyright (c) 2012 IETF Trust and the persons identified as the Copyright (c) 2014 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 2
2. Evasion techniques for some Router Advertisement Guard (RA 2. Evasion Techniques for Some RA-Guard Implementations . . . . . 3
Guard) implementations . . . . . . . . . . . . . . . . . . . . 4 2.1. Attack Vector Based on IPv6 Extension Headers . . . . . . 3
2.1. Attack Vector based on IPv6 Extension Headers . . . . . . 4 2.2. Attack Vector Based on IPv6 Fragmentation . . . . . . . . 4
2.2. Attack vector based on IPv6 fragmentation . . . . . . . . 4 3. RA-Guard Implementation Advice . . . . . . . . . . . . . . . . 6
3. RA-Guard implementation advice . . . . . . . . . . . . . . . . 8 4. Other Implications . . . . . . . . . . . . . . . . . . . . . . 9
4. Other Implications . . . . . . . . . . . . . . . . . . . . . . 11 5. Security Considerations . . . . . . . . . . . . . . . . . . . 9
5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 12 6. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 10
6. Security Considerations . . . . . . . . . . . . . . . . . . . 13 7. References . . . . . . . . . . . . . . . . . . . . . . . . . . 10
7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 14 7.1. Normative References . . . . . . . . . . . . . . . . . . . 10
8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 15 7.2. Informative References . . . . . . . . . . . . . . . . . . 11
8.1. Normative References . . . . . . . . . . . . . . . . . . . 15 Appendix A. Assessment Tools . . . . . . . . . . . . . . . . . . 12
8.2. Informative References . . . . . . . . . . . . . . . . . . 15
Appendix A. Assessment tools . . . . . . . . . . . . . . . . . . 17
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 18
1. Introduction 1. Introduction
IPv6 Router Advertisement Guard (RA-Guard) is a mitigation technique IPv6 Router Advertisement Guard (RA-Guard) is a mitigation technique
for attack vectors based on ICMPv6 Router Advertisement messages. for attack vectors based on ICMPv6 Router Advertisement [RFC4861]
[RFC6104] describes the problem statement of "Rogue IPv6 Router messages. [RFC6104] describes the problem statement of "Rogue IPv6
Advertisements", and [RFC6105] specifies the "IPv6 Router Router Advertisements", and [RFC6105] specifies the "IPv6 Router
Advertisement Guard" functionality. Advertisement Guard" functionality.
The concept behind RA-Guard is that a layer-2 device filters ICMPv6 The concept behind RA-Guard is that a Layer-2 (L2) device filters
Router Advertisement messages, according to a number of different ICMPv6 Router Advertisement messages, according to a number of
criteria. The most basic filtering criterion is that Router different criteria. The most basic filtering criterion is that
Advertisement messages are discarded by the layer-2 device unless Router Advertisement messages are discarded by the L2 device unless
they are received on a specified port of the layer-2 device. they are received on a specified port of the L2 device. Clearly, the
Clearly, the effectiveness of the RA Guard mitigation relies on the effectiveness of RA-Guard relies on the ability of the L2 device to
ability of the layer-2 device to identify ICMPv6 Router Advertisement identify ICMPv6 Router Advertisement messages.
messages.
Some popular RA-Guard implementations have been found to be easy to Some popular RA-Guard implementations have been found to be easy to
circumvent by employing IPv6 extension headers [CPNI-IPv6]. This circumvent by employing IPv6 Extension Headers [CPNI-IPv6]. This
document describes such evasion techniques, and provides advice to document describes such evasion techniques and provides advice to
RA-Guard implementers such that the aforementioned evasion vectors RA-Guard implementers such that the aforementioned evasion vectors
can be eliminated. can be eliminated.
It should be noted that the aforementioned techniques could also be It should be noted that the previously mentioned techniques could
exploited to evade network monitoring tools such as NDPMon [NDPMon], also be exploited to evade network monitoring tools such as NDPMon
ramond [ramond], and rafixd [rafixd], and could probably be exploited [NDPMon], ramond [ramond], and rafixd [rafixd], and could probably be
to perform stealth DHCPv6 attacks. exploited to perform stealth DHCPv6 [RFC3315] attacks.
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 [RFC2119].
2. Evasion techniques for some Router Advertisement Guard (RA Guard) 2. Evasion Techniques for Some RA-Guard Implementations
implementations
The following subsections describe two different vectors that have The following subsections describe two different vectors that have
been found to be effective for the evasion of popular implementations been found to be effective for the evasion of popular implementations
of the RA-Guard protection. Section 2.1 describes an attack vector of RA-Guard. Section 2.1 describes an attack vector based on the use
based on the use of IPv6 Extension Headers with the ICMPv6 Router of IPv6 Extension Headers with ICMPv6 Router Advertisement messages,
Advertisement messages, which may be used to circumvent the RA-Guard which may be used to circumvent the RA-Guard protection of those
protection of those implementations that fail to process an entire implementations that fail to process an entire IPv6 header chain when
IPv6 header chain when trying to identify the ICMPv6 Router trying to identify the ICMPv6 Router Advertisement messages.
Advertisement messages. Section 2.2 describes an attack method based Section 2.2 describes an attack method based on the use of IPv6
on the use of IPv6 fragmentation, possibly in conjunction with the fragmentation, possibly in conjunction with the use of IPv6 Extension
use of IPv6 Extension Headers. This later vector has been found to Headers. This later vector has been found to be effective against
be effective with all existing implementations of the RA-Guard all existing implementations of RA-Guard.
mechanism.
2.1. Attack Vector based on IPv6 Extension Headers 2.1. Attack Vector Based on IPv6 Extension Headers
While there is currently no legitimate use for IPv6 Extension Headers While there is currently no legitimate use for IPv6 Extension Headers
in ICMPv6 Router Advertisement messages, Neighbor Discovery in ICMPv6 Router Advertisement messages, Neighbor Discovery [RFC4861]
implementations allow the use of Extension Headers with these implementations allow the use of Extension Headers with these
messages, by simply ignoring the received options. Some RA-Guard messages, by simply ignoring the received options. Some RA-Guard
implementations try to identify ICMPv6 Router Advertisement messages implementations try to identify ICMPv6 Router Advertisement messages
by simply looking at the "Next Header" field of the fixed IPv6 by simply looking at the "Next Header" field of the fixed IPv6
header, rather than following the entire header chain. As a result, header, rather than following the entire header chain. As a result,
such implementations fail to identify any ICMPv6 Router Advertisement such implementations fail to identify any ICMPv6 Router Advertisement
messages that include any Extension Headers (for example, a Hop by messages that include any Extension Headers (for example, a Hop-by-
Hop Options header, a Destination Options Header, etc.), and can be Hop Options header, a Destination Options header, etc.), and can be
easily circumvented. easily circumvented.
The following figure illustrates the structure of ICMPv6 Router The following figure illustrates the structure of ICMPv6 Router
Advertisement messages that implement this evasion technique: Advertisement messages that implement this evasion technique:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|NH=60| |NH=58| | | |NH=60| |NH=58| | |
+-+-+-+ +-+-+-+ + + +-+-+-+ +-+-+-+ + +
| IPv6 header | Dst Opt Hdr | ICMPv6 Router Advertisement | | IPv6 Header | Dst Opt Hdr | ICMPv6 Router Advertisement |
+ + + + + + + +
| | | | | | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2.2. Attack vector based on IPv6 fragmentation 2.2. Attack Vector Based on IPv6 Fragmentation
This section presents a different attack vector, which has been found This section presents a different attack vector, which has been found
to be effective against all implementations of RA-Guard. The basic to be effective against all implementations of RA-Guard. The basic
idea behind this attack vector is that if the forged ICMPv6 Router idea behind this attack vector is that if the forged ICMPv6 Router
Advertisement is fragmented into at least two fragments, the layer-2 Advertisement is fragmented into at least two fragments, the L2
device implementing "RA-Guard" would be unable to identify the attack device implementing RA-Guard would be unable to identify the attack
packet, and would thus fail to block it. packet and would thus fail to block it.
A first variant of this attack vector would be an original ICMPv6 A first variant of this attack vector would be an original ICMPv6
Router Advertisement message preceded with a Destination Options Router Advertisement message preceded with a Destination Options
Header, that results in two fragments. The following figure header, which results in two fragments. The following figure
illustrates the "original" attack packet, prior to fragmentation, and illustrates the "original" attack packet, prior to fragmentation, and
the two resulting fragments which are actually sent as part of the the two resulting fragments that are actually sent as part of the
attack. attack.
Original packet: Original Packet:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|NH=60| |NH=58| | | |NH=60| |NH=58| | |
+-+-+-+ +-+-+-+ + + +-+-+-+ +-+-+-+ + +
| IPv6 header | Dst Opt Hdr | ICMPv6 RA | | IPv6 Header | Dst Opt Hdr | ICMPv6 RA |
+ + + + + + + +
| | | | | | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
First fragment: First Fragment:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|NH=44| |NH=60| |NH=58| | |NH=44| |NH=60| |NH=58| |
+-+-+-+ +-+-+-+ +-+-+-+ + +-+-+-+ +-+-+-+ +-+-+-+ +
| IPv6 Header | Frag Hdr | Dst Opt Hdr | | IPv6 Header | Frag Hdr | Dst Opt Hdr |
+ + + + + + + +
| | | | | | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Second fragment: Second Fragment:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|NH=44| |NH=60| | | | |NH=44| |NH=60| | | |
+-+-+-+ +-+-+-+ + + + +-+-+-+ +-+-+-+ + + +
| IPv6 header | Frag Hdr | Dst Opt Hdr | ICMPv6 RA | | IPv6 Header | Frag Hdr | Dst Opt Hdr | ICMPv6 RA |
+ + + + + + + + + +
| | | | | | | | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
It should be noted that the "Hdr Ext Len" field of the Destination It should be noted that the "Hdr Ext Len" field of the Destination
Options Header is present in the first fragment (rather than the Options header is present in the First Fragment (rather than the
second). Therefore, it is impossible for a device processing only second). Therefore, it is impossible for a device processing only
the second fragment to locate the ICMPv6 header contained in that the second fragment to locate the ICMPv6 header contained in that
fragment, since it is unknown how many bytes should be "skipped" to fragment, since it is unknown how many bytes should be "skipped" to
get to the next header following the Destination Options Header. get to the next header following the Destination Options header.
Thus, by leveraging the use of the Fragment Header together with the Thus, by leveraging the use of the Fragment Header together with the
use of the Destination Options header, the attacker is able to use of the Destination Options header, the attacker is able to
conceal the type and contents of the ICMPv6 message he is sending (an conceal the type and contents of the ICMPv6 message he is sending (an
ICMPv6 Router Advertisement in this example). Unless the layer-2 ICMPv6 Router Advertisement in this example). Unless the L2 device
device were to implement IPv6 fragment reassembly, it would be were to implement IPv6 fragment reassembly, it would be impossible
impossible for the device to identify the ICMPv6 type of the message. for the device to identify the ICMPv6 type of the message.
A layer-2 device could, however, at least detect that that an An L2 device could, however, at least detect that an ICMPv6
ICMPv6 message (or some type) is being sent, since the "Next message (of some type) is being sent, since the "Next Header"
Header" field of the Destination Options header contained in the field of the Destination Options header contained in the First
first fragment is set to "58" (ICMPv6). Fragment is set to "58" (ICMPv6).
This idea can be taken further, such that it is also impossible for This idea can be taken further, such that it is also impossible for
the layer-2 device to detect that the attacker is sending an ICMPv6 the L2 device to detect that the attacker is sending an ICMPv6
message in the first place. This can be achieved with an original message in the first place. This can be achieved with an original
ICMPv6 Router Advertisement message preceded with two Destination ICMPv6 Router Advertisement message preceded with two Destination
Options Headers, that results in two fragments. The following figure Options headers that results in two fragments. The following figure
illustrates the "original" attack packet, prior to fragmentation, and illustrates the "original" attack packet, prior to fragmentation, and
the two resulting packets which are actually sent as part of the the two resulting packets that are actually sent as part of the
attack. attack.
Original packet: Original Packet:
+-+-+-+-+-+-+-+-+-+-+-+-//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|NH=60| |NH=60| |NH=58| | | |NH=60| |NH=60| |NH=58| | |
+-+-+-+ +-+-+-+ +-+-+-+ + + +-+-+-+ +-+-+-+ +-+-+-+ + +
| IPv6 header | Dst Opt Hdr | Dst Opt Hdr | ICMPv6 RA | | IPv6 header | Dst Opt Hdr | Dst Opt Hdr | ICMPv6 RA |
+ + + + + + + + + +
| | | | | | | | | |
+-+-+-+-+-+-+-+-+-+-+-+-//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
First fragment: First Fragment:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|NH=44| |NH=60| |NH=60| | |NH=44| |NH=60| |NH=60| |
+-+-+-+ +-+-+-+ +-+-+-+ + +-+-+-+ +-+-+-+ +-+-+-+ +
| IPv6 header | Frag Hdr | Dst Opt Hdr | | IPv6 header | Frag Hdr | Dst Opt Hdr |
+ + + + + + + +
| | | | | | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Second Fragment:
Second fragment:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|NH=44| |NH=60| | |NH=58| | | |NH=44| |NH=60| | |NH=58| | |
+-+-+-+ +-+-+-+ + +-+-+-+ + + +-+-+-+ +-+-+-+ + +-+-+-+ + +
| IPv6 header | Frag Hdr | Dst O Hdr | Dst Opt Hdr | ICMPv6 RA | | IPv6 header | Frag Hdr | Dst O Hdr | Dst Opt Hdr | ICMPv6 RA |
+ + + + + + + + + + + +
| | | | | | | | | | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
In this variant, the "Next Header" field of the Destination Options In this variant, the "Next Header" field of the Destination Options
header contained in the first fragment is set "60" (Destination header contained in the First Fragment is set to "60" (Destination
Options header), and thus it is impossible for a device processing Options header); thus, it is impossible for a device processing only
only the first fragment to detect that an ICMPv6 message is being the First Fragment to detect that an ICMPv6 message is being sent in
sent in the first place. the first place.
The second fragment presents the same challenges as the second The second fragment presents the same challenges as the second
fragment of the previous variant. That is, it would be impossible fragment of the previous variant. That is, it would be impossible
for a device processing only the second fragment to locate the second for a device processing only the second fragment to locate the second
Destination Options header (and hence the ICMPv6 header), since the Destination Options header (and hence the ICMPv6 header), since the
"Hdr Ext Len" field of the first Destination Options header is "Hdr Ext Len" field of the first Destination Options header is
present in the first fragment (rather than the second). present in the First Fragment (rather than the second).
3. RA-Guard implementation advice 3. RA-Guard Implementation Advice
The following filtering rules must be implemented as part of an "RA- The following filtering rules must be implemented as part of an
Guard" implementation on ports that face interfaces that are not RA-Guard implementation on ports that face interfaces that are not
allowed to send ICMPv6 Router Advertisement messages, such that the allowed to send ICMPv6 Router Advertisement messages, such that the
vulnerabilities discussed in this document are eliminated: vulnerabilities discussed in this document are eliminated:
1. If the IPv6 Source Address of the packet is not a link-local 1. If the IPv6 Source Address of the packet is not a link-local
address (fe80::/10), RA-Guard must pass the packet. address (fe80::/10), RA-Guard must pass the packet.
RATIONALE: This prevents "RA-Guard" from dedicating compute RATIONALE: This prevents RA-Guard from dedicating processing
cycles to filtering packets that originate off-net and, if cycles to filtering packets that originate off-net and that,
they are RA's, would not be accepted by the host. Section if they are RA's, would not be accepted by the host. Section
6.1.2 of [RFC4861] requires nodes to discard Router 6.1.2 of [RFC4861] requires nodes to discard Router
Advertisement messages if their IPv6 Source Address is not a Advertisement messages if their IPv6 Source Address is not a
link-local address. link-local address.
2. If the Hop Limit is not 255, RA-Guard must pass the packet. 2. If the Hop Limit is not 255, RA-Guard must pass the packet.
RATIONALE: This prevents "RA-Guard" from dedicating compute RATIONALE: This prevents RA-Guard from dedicating processing
cycles to filtering packets that originate off-net and, if cycles to filtering packets that originate off-net and that,
they are RA's, would not be accepted by the host. Section if they are RA's, would not be accepted by the destination
6.1.2 of [RFC4861] requires nodes to discard Router host. Section 6.1.2 of [RFC4861] requires nodes to discard
Advertisement messages if their Hop Limit is not 255. Router Advertisement messages if their Hop Limit is not 255.
3. RA-Guard must parse the IPv6 entire header chain present in the 3. RA-Guard must parse the entire IPv6 header chain present in the
packet, to identify whether the packet is a Router Advertisement packet, to identify whether the packet is a Router Advertisement
message. message.
RATIONALE: [RFC6564] specifies a uniform format for IPv6 NOTE: RA-Guard implementations must not enforce a limit on the
Extension Header, thus meaning that an IPv6 node can parse an
IPv6 header chain even if it contains Extension Headers that
are not currently supported by that node. Additionally,
[I-D.ietf-6man-oversized-header-chain] requires that if a
packet is fragmented, the first fragment contains the entire
IPv6 header chain.
RA-Guard implementations must not enforce a limit on the
number of bytes they can inspect (starting from the beginning number of bytes they can inspect (starting from the beginning
of the IPv6 packet), since this could introduce false- of the IPv6 packet), since this could introduce false
positives: legitimate packets could be dropped simply because positives: legitimate packets could be dropped simply because
the RA-Guard device does not parse the entire IPv6 header the RA-Guard device does not parse the entire IPv6 header
chain present in the packet. An implementation that has such chain present in the packet. An implementation that has such
an implementation-specific limit must not claim compliance an implementation-specific limit must not claim compliance
with this specification, and must pass the packet when such with this specification, and must pass the packet when such
implementation-specific limit is reached. implementation-specific limit is reached.
4. When parsing the IPv6 header chain, if the packet is a first- 4. When parsing the IPv6 header chain, if the packet is a First
fragment (i.e., a packet containing a Fragment Header with the Fragment (i.e., a packet containing a Fragment Header with the
Fragment Offset set to 0) and it fails to contain the entire IPv6 Fragment Offset set to 0) and it fails to contain the entire IPv6
header chain (i.e., all the headers starting from the IPv6 header header chain (i.e., all the headers starting from the IPv6 header
up to, and including, the upper-layer header), RA-Guard must drop up to, and including, the upper-layer header), RA-Guard must drop
the packet, and should log the packet drop event in an the packet and should log the packet drop event in an
implementation-specific manner as a security fault. implementation-specific manner as a security fault.
RATIONALE: [I-D.ietf-6man-oversized-header-chain] specifies RATIONALE: [RFC7112] specifies that the First Fragment (i.e.,
that the first-fragment (i.e., the fragment with the Fragment the fragment with the Fragment Offset set to 0) must contain
Offset set to 0) MUST contain the entire IPv6 header chain, the entire IPv6 header chain, and allows intermediate systems
and allows intermmediate systems such as routers to drop those such as routers to drop those packets that fail to comply with
packets that fail to comply with this requirement. this requirement.
NOTE: This rule should only be applied to IPv6 fragments with NOTE: This rule should only be applied to IPv6 fragments with
a Fragment Offset of 0 (non-first fragments can be safely a Fragment Offset of 0 (non-First Fragments can be safely
passed, since they will never reassemble into a complete passed, since they will never reassemble into a complete
datagram if they are part of a Router Advertisement received datagram if they are part of a Router Advertisement received
on a port where such packets are not allowed). on a port where such packets are not allowed).
5. When parsing the IPv6 header chain, if the packet is identified 5. When parsing the IPv6 header chain, if the packet is identified
to be an ICMPv6 Router Advertisement message, RA-Guard must drop to be an ICMPv6 Router Advertisement message or the packet
the packet, and should log the packet drop event in an contains an unrecognized Next Header value [IANA-IP-PROTO],
implementation-specific manner as a security fault. RA-Guard must drop the packet, and should log the packet drop
event in an implementation-specific manner as a security fault.
RA-Guard must provide a configuration knob that controls whether
packets with unrecognized Next Header values are dropped; this
configuration knob must default to "drop".
RATIONALE: By definition, Router Advertisement messages MUST RATIONALE: By definition, Router Advertisement messages are
originate on-link, MUST have a link-local IPv6 Source Address, required to originate on-link, have a link-local IPv6 Source
and MUST have a Hop Limit value of 255. [RFC4861]. Address, and have a Hop Limit value of 255 [RFC4861].
[RFC7045] requires that nodes be configurable with respect to
whether packets with unrecognized headers are forwarded, and
allows the default behavior to be that such packets be
dropped.
6. In all other cases, RA-Guard must pass the packet as usual. 6. In all other cases, RA-Guard must pass the packet as usual.
NOTE: For the purpose of enforcing the RA-Guard filtering policy, NOTE: For the purpose of enforcing the RA-Guard filtering policy,
an ESP header [RFC4303] should be considered to be an "upper-layer an Encapsulating Security Payload (ESP) header [RFC4303] should be
protocol" (that is, it should be considered the last header in the considered to be an "upper-layer protocol" (that is, it should be
IPv6 header chain). This means that packets employing ESP would considered the last header in the IPv6 header chain). This means
be passed by the RA-Guard device to the intended destination. If that packets employing ESP would be passed by the RA-Guard device
the destination host does not have a security association with the to the intended destination. If the destination host does not
sender of the aforementioned IPv6 packet, the packet would be have a security association with the sender of the aforementioned
dropped. Otherwise, if the packet is considered valid by the IPv6 packet, the packet would be dropped. Otherwise, if the
IPsec implementation at the receiving host and encapsulates a packet is considered valid by the IPsec implementation at the
Router Advertisement message, it is up to the receiving host what receiving host and encapsulates a Router Advertisement message, it
to do with such packet. is up to the receiving host what to do with such a packet.
If a packet is dropped due to this filtering policy, then the packet If a packet is dropped due to this filtering policy, then the packet
drop event should be logged in an implementation-specific manner as a drop event should be logged in an implementation-specific manner as a
security fault. The logging mechanism should include a drop counter security fault. The logging mechanism should include a drop counter
dedicated to RA-Guard packet drops. dedicated to RA-Guard packet drops.
In order to protect current end-node IPv6 implementations, Rule #4 In order to protect current end-node IPv6 implementations, Rule #4
has been defined as a default rule to drop packets that cannot be has been defined as a default rule to drop packets that cannot be
positively identified as not being Router Advertisement (RA) messages positively identified as not being Router Advertisement (RA) messages
(because the packet is a fragment that fails to include the entire (because the packet is a fragment that fails to include the entire
IPv6 header chain). This means that, at least in theory, RA-Guard IPv6 header chain). This means that, at least in theory, RA-Guard
could result in false-positive blocking of some legitimate non-RA could result in false-positive blocking of some legitimate non-RA
packets that could not be positively identified as being non-RA. In packets that could not be positively identified as being non-RA. In
order to reduce the likelihood of false positives, Rule #1 and Rule order to reduce the likelihood of false positives, Rule #1 and Rule
#2 require that packets that would not pass the required validation #2 require that packets that would not pass the required validation
checks for RA messages (Section 6.1.2 of [RFC4861]) be passed without checks for RA messages (Section 6.1.2 of [RFC4861]) be passed without
further inspection. In any case, as noted in further inspection. In any case, as noted in [RFC7112], IPv6 packets
[I-D.ietf-6man-oversized-header-chain], IPv6 packets that fail to that fail to include the entire IPv6 header chain are virtually
include the entire IPv6 header chain are virtually impossible to impossible to police with state-less filters and firewalls and,
police with state-less filters and firewalls, and hence are unlikely hence, are unlikely to survive in real networks. [RFC7112] requires
to survive in real networks. [I-D.ietf-6man-oversized-header-chain] that hosts employing fragmentation include the entire IPv6 header
requires that hosts employing fragmentation include the entire IPv6 chain in the First Fragment (the fragment with the Fragment Offset
header chain in the first fragment (the fragment with the Fragment set to 0), thus eliminating the aforementioned false positives.
Offset set to 0), thus eliminating the aforementioned false
positives.
This filtering policy assumes that host implementations require that This filtering policy assumes that host implementations require that
the IPv6 Source Address of ICMPv6 Router Advertisement messages be a the IPv6 Source Address of ICMPv6 Router Advertisement messages be a
link-local address, and that they discard the packet if this check link-local address and that they discard the packet if this check
fails, as required by the current IETF specifications [RFC4861]. fails, as required by the current IETF specifications [RFC4861].
Additionally, it assumes that hosts require the Hop Limit of Neighbor Additionally, it assumes that hosts require the Hop Limit of Neighbor
Discovery messages to be 255, and discard those packets otherwise. Discovery messages to be 255, and that they discard those packets
otherwise.
The aforementioned filtering rules implicitly handle the case of The aforementioned filtering rules implicitly handle the case of
fragmented packets: if the RA-Guard device fails to identify the fragmented packets: if the RA-Guard device fails to identify the
upper-layer protocol as a result of the use of fragmentation, the upper-layer protocol as a result of the use of fragmentation, the
corresponding packets would be dropped. corresponding packets would be dropped.
Finally, we note that IPv6 implementations that allow overlapping Finally, we note that IPv6 implementations that allow overlapping
fragments (i.e. that do not comply with [RFC5722]) might still be fragments (i.e., that do not comply with [RFC5722]) might still be
subject of RA-based attacks. However, a recent assessment of IPv6 subject of RA-based attacks. However, a recent assessment of IPv6
implementations [SI6-FRAG] with respect to their fragment reassembly implementations [SI6-FRAG] with respect to their fragment reassembly
policy seems to indicate that most current implementations comply policy seems to indicate that most current implementations comply
with [RFC5722]. with [RFC5722].
4. Other Implications 4. Other Implications
A similar concept to that of "RA-Guard" has been implemented for A similar concept to that of RA-Guard has been implemented for
protecting against forged DHCPv6 messages. Such protection can be protecting against forged DHCPv6 messages. Such protection can be
circumvented with the same techniques discussed in this document, and circumvented with the same techniques discussed in this document, and
the counter-measures for such evasion attack are analogous to those the countermeasures for such evasion attack are analogous to those
described in Section 3 of this document. described in Section 3 of this document.
[DHCPv6-Shield] specifies a mechanism to protect against rogue [DHCPv6-Shield] specifies a mechanism to protect against rogue
DHCPv6 servers, while taking into consideration the evasion DHCPv6 servers, while taking into consideration the evasion
techniques discussed in this document. techniques discussed in this document.
5. IANA Considerations 5. Security Considerations
This document has no actions for IANA.
6. Security Considerations
This document describes a number of techniques that have been found This document describes a number of techniques that have been found
to be effective to circumvent popular RA-Guard implementations, and to be effective to circumvent popular RA-Guard implementations and
provides advice to RA-Guard implementations such that those evasion provides advice to RA-Guard implementers such that those evasion
vulnerabilities are eliminated. vulnerabilities are eliminated.
As noted in Section 3, IPv6 implementations that allow overlapping As noted in Section 3, IPv6 implementations that allow overlapping
fragments (i.e. that do not comply with [RFC5722]) might still be fragments (i.e., that do not comply with [RFC5722]) might still be
subject of RA-based attacks. However, most current subject of RA-based attacks. However, most current
implementations seem to comply with [RFC5722]. implementations seem to comply with [RFC5722].
We note that if an attacker sends a fragmented Router Advertisement We note that if an attacker sends a fragmented ICMPv6 Router
message on a port not allowed to send such packets, the first- Advertisement message on a port not allowed to send such packets, the
fragment would be dropped, and the rest of the fragments would be First Fragment would be dropped, and the rest of the fragments would
passed. This means that the victim node would tie memory buffers for be passed. This means that the victim node would tie memory buffers
the aforementioned fragments, which would never reassemble into a for the aforementioned fragments, which would never reassemble into a
complete datagram. If a large number of such packets were sent by an complete datagram. If a large number of such packets were sent by an
attacker, and the victim node failed to implement proper resource attacker, and the victim node failed to implement proper resource
management for the fragment reassembly buffer, this could lead to a management for the IPv6 fragment reassembly buffer, this could lead
Denial of Service (DoS). However, this does not really introduce a to a Denial of Service (DoS). However, this does not really
new attack vector, since an attacker could always perform the same introduce a new attack vector, since an attacker could always perform
attack by sending forged fragmented datagram in which at least one of the same attack by sending forged fragmented datagrams in which at
the fragments is missing. [CPNI-IPv6] discusses some resource least one of the fragments is missing. [CPNI-IPv6] discusses some
management strategies that could be implemented for the fragment resource management strategies that could be implemented for the IPv6
reassembly buffer. fragment reassembly buffer.
We note that most effective and efficient mitigation for these We note that the most effective and efficient mitigation for these
attacks would be to prohibit the use of IPv6 fragmentation with attacks would rely on the prohibiting the use of IPv6 fragmentation
Router Advertisement messages (as proposed by with Router Advertisement messages (as specified by [RFC6980]), such
[I-D.ietf-6man-nd-extension-headers]), such that the RA-Guard that the RA-Guard functionality is easier to implement. However,
functionality is easier to implement. However, since such mitigation since such mitigation would require an update to existing
would require an update to existing implementations, it cannot be implementations, it cannot be relied upon in the short or near term.
relied upon in the short or near term.
Finally, we note that RA-Guard only mitigates attack vectors based on Finally, we note that RA-Guard only mitigates attack vectors based on
ICMPv6 Router advertisement messages. Protection against similar ICMPv6 Router advertisement messages. Protection against similar
attacks based on other messages (such as DCHPv6) is considered out of attacks based on other messages (such as DCHPv6) is considered out of
the scope of this document, and left for other documents(e.g. the scope of this document and is left for other documents (e.g.,
[DHCPv6-Shield]). [DHCPv6-Shield]).
7. Acknowledgements 6. Acknowledgements
The author would like to thank Ran Atkinson, who provided very The author would like to thank Ran Atkinson, who provided very
detailed comments and suggested text that was incorporated into this detailed comments and suggested text that was incorporated into this
document. document.
The author would like to thank Ran Atkinson, Karl Auer, Robert The author would like to thank Ran Atkinson, Karl Auer, Robert
Downie, Washam Fan, David Farmer, Marc Heuse, Nick Hilliard, Ray Downie, Washam Fan, David Farmer, Mike Heard, Marc Heuse, Nick
Hunter, Joel Jaeggli, Simon Perreault, Arturo Servin, Gunter van de Hilliard, Ray Hunter, Joel Jaeggli, Simon Perreault, Arturo Servin,
Velde, James Woodyatt, and Bjoern A. Zeeb, for providing valuable Gunter van de Velde, James Woodyatt, and Bjoern A. Zeeb, for
comments on earlier versions of this document. providing valuable comments on earlier versions of this document.
The author would like to thank Arturo Servin, who presented this The author would like to thank Arturo Servin, who presented this
document at IETF 81. document at IETF 81.
This document resulted from the project "Security Assessment of the This document resulted from the project "Security Assessment of the
Internet Protocol version 6 (IPv6)" [CPNI-IPv6], carried out by Internet Protocol version 6 (IPv6)" [CPNI-IPv6], carried out by
Fernando Gont on behalf of the UK Centre for the Protection of Fernando Gont on behalf of the UK Centre for the Protection of
National Infrastructure (CPNI). The author would like to thank the National Infrastructure (CPNI).
UK CPNI, for their continued support.
8. References 7. References
8.1. Normative References 7.1. Normative References
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC3315] Droms, R., Bound, J., Volz, B., Lemon, T., Perkins,
Requirement Levels", BCP 14, RFC 2119, March 1997. C., and M. Carney, "Dynamic Host Configuration
Protocol for IPv6 (DHCPv6)", RFC 3315, July 2003.
[RFC4303] Kent, S., "IP Encapsulating Security Payload (ESP)", [RFC4303] Kent, S., "IP Encapsulating Security Payload (ESP)",
RFC 4303, December 2005. RFC 4303, December 2005.
[RFC4861] Narten, T., Nordmark, E., Simpson, W., and H. Soliman, [RFC4861] Narten, T., Nordmark, E., Simpson, W., and H.
"Neighbor Discovery for IP version 6 (IPv6)", RFC 4861, Soliman, "Neighbor Discovery for IP version 6
September 2007. (IPv6)", RFC 4861, September 2007.
[RFC5722] Krishnan, S., "Handling of Overlapping IPv6 Fragments", [RFC5722] Krishnan, S., "Handling of Overlapping IPv6
RFC 5722, December 2009. Fragments", RFC 5722, December 2009.
[RFC6105] Levy-Abegnoli, E., Van de Velde, G., Popoviciu, C., and J. [RFC6105] Levy-Abegnoli, E., Van de Velde, G., Popoviciu, C.,
Mohacsi, "IPv6 Router Advertisement Guard", RFC 6105, and J. Mohacsi, "IPv6 Router Advertisement Guard",
February 2011. RFC 6105, February 2011.
[RFC6564] Krishnan, S., Woodyatt, J., Kline, E., Hoagland, J., and [RFC6980] Gont, F., "Security Implications of IPv6
M. Bhatia, "A Uniform Format for IPv6 Extension Headers", Fragmentation with IPv6 Neighbor Discovery",
RFC 6564, April 2012. RFC 6980, August 2013.
[I-D.ietf-6man-oversized-header-chain] [RFC7045] Carpenter, B. and S. Jiang, "Transmission and
Gont, F. and V. Manral, "Security and Interoperability Processing of IPv6 Extension Headers", RFC 7045,
Implications of Oversized IPv6 Header Chains", December 2013.
draft-ietf-6man-oversized-header-chain-02 (work in
progress), November 2012.
[I-D.ietf-6man-nd-extension-headers] [RFC7112] Gont, F., Manral, V., and R. Bonica, "Implications
Gont, F., "Security Implications of IPv6 Fragmentation of Oversized IPv6 Header Chains", RFC 7112,
with IPv6 Neighbor Discovery", January 2014.
draft-ietf-6man-nd-extension-headers-01 (work in
progress), November 2012.
8.2. Informative References 7.2. Informative References
[RFC6104] Chown, T. and S. Venaas, "Rogue IPv6 Router Advertisement [CPNI-IPv6] Gont, F., "Security Assessment of the Internet
Problem Statement", RFC 6104, February 2011. Protocol version 6 (IPv6)", UK Centre for the
Protection of National Infrastructure, (available on
request).
[DHCPv6-Shield] [DHCPv6-Shield] Gont, F., Liu, W., and G. Van de Velde, "DHCPv6-
Gont, F., "DHCPv6-Shield: Protecting Against Rogue DHCPv6 Shield: Protecting Against Rogue DHCPv6 Servers",
Servers", IETF Internet Draft, Work in Progress, October 2013.
draft-gont-opsec-dhcpv6-shield, work in progress,
May 2012.
[CPNI-IPv6] [IANA-IP-PROTO] IANA, "Assigned Internet Protocol Numbers",
Gont, F., "Security Assessment of the Internet Protocol <http://www.iana.org/assignments/protocol-numbers/>.
version 6 (IPv6)", UK Centre for the Protection of
National Infrastructure, (available on request).
[NDPMon] "NDPMon - IPv6 Neighbor Discovery Protocol Monitor", [NDPMon] "NDPMon - IPv6 Neighbor Discovery Protocol Monitor",
<http://ndpmon.sourceforge.net/>. <http://ndpmon.sourceforge.net/>.
[rafixd] "rafixd", <http://www.kame.net/dev/cvsweb2.cgi/kame/kame/ [RFC6104] Chown, T. and S. Venaas, "Rogue IPv6 Router
kame/rafixd/>. Advertisement Problem Statement", RFC 6104,
February 2011.
[ramond] "ramond", <http://ramond.sourceforge.net/>. [SI6-FRAG] SI6 Networks, "IPv6 NIDS evasion and improvements in
IPv6 fragmentation/reassembly", 2012,
<http://blog.si6networks.com/2012/02/
ipv6-nids-evasion-and-improvements-in.html>.
[SI6-FRAG] [SI6-IPv6] "SI6 Networks' IPv6 toolkit",
SI6 Networks, "IPv6 NIDS evasion and improvements in IPv6 <http://www.si6networks.com/tools/ipv6toolkit>.
fragmentation/reassembly", 2012, <http://
blog.si6networks.com/2012/02/
ipv6-nids-evasion-and-improvements-in.html>.
[SI6-IPv6] [THC-IPV6] "The Hacker's Choice IPv6 Attack Toolkit",
"SI6 Networks' IPv6 toolkit", <http://www.thc.org/thc-ipv6/>.
<http://www.si6networks.com/tools/ipv6toolkit>.
[THC-IPV6] [rafixd] "rafixd", <http://www.kame.net/dev/cvsweb2.cgi/kame/
"The Hacker's Choice IPv6 Attack Toolkit", kame/kame/rafixd/>.
<http://www.thc.org/thc-ipv6/>.
Appendix A. Assessment tools [ramond] "ramond", <http://ramond.sourceforge.net/>.
[SI6-IPv6] is a publicly-available set of tools (for Linux, *BSD, and Appendix A. Assessment Tools
[SI6-IPv6] is a publicly available set of tools (for Linux, *BSD, and
Mac OS) that implements the techniques described in this document. Mac OS) that implements the techniques described in this document.
[THC-IPV6] is a publicly-available set of tools (for Linux) that [THC-IPV6] is a publicly available set of tools (for Linux) that
implements some of the techniques described in this document. implements some of the techniques described in this document.
Author's Address Author's Address
Fernando Gont Fernando Gont
Centre for the Protection of National Infrastructure Huawei Technologies
Evaristo Carriego 2644
Haedo, Provincia de Buenos Aires 1706
Argentina
Email: fgont@si6networks.com Phone: +54 11 4650 8472
URI: http://www.cpni.gov.uk EMail: fgont@si6networks.com
 End of changes. 95 change blocks. 
267 lines changed or deleted 246 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/