| 1 |
<pre>Internet Engineering Task Force (IETF) F. Gont |
| 2 |
Request for Comments: 7739 Huawei Technologies |
| 3 |
Category: Informational February 2016 |
| 4 |
ISSN: 2070-1721 |
| 5 |
|
| 6 |
|
| 7 |
<span class="h1">Security Implications of Predictable Fragment Identification Values</span> |
| 8 |
|
| 9 |
Abstract |
| 10 |
|
| 11 |
IPv6 specifies the Fragment Header, which is employed for the |
| 12 |
fragmentation and reassembly mechanisms. The Fragment Header |
| 13 |
contains an "Identification" field that, together with the IPv6 |
| 14 |
Source Address and the IPv6 Destination Address of a packet, |
| 15 |
identifies fragments that correspond to the same original datagram, |
| 16 |
such that they can be reassembled together by the receiving host. |
| 17 |
The only requirement for setting the Identification field is that the |
| 18 |
corresponding value must be different than that employed for any |
| 19 |
other fragmented datagram sent recently with the same Source Address |
| 20 |
and Destination Address. Some implementations use a simple global |
| 21 |
counter for setting the Identification field, thus leading to |
| 22 |
predictable Identification values. This document analyzes the |
| 23 |
security implications of predictable Identification values, and |
| 24 |
provides implementation guidance for setting the Identification field |
| 25 |
of the Fragment Header, such that the aforementioned security |
| 26 |
implications are mitigated. |
| 27 |
|
| 28 |
Status of This Memo |
| 29 |
|
| 30 |
This document is not an Internet Standards Track specification; it is |
| 31 |
published for informational purposes. |
| 32 |
|
| 33 |
This document is a product of the Internet Engineering Task Force |
| 34 |
(IETF). It represents the consensus of the IETF community. It has |
| 35 |
received public review and has been approved for publication by the |
| 36 |
Internet Engineering Steering Group (IESG). Not all documents |
| 37 |
approved by the IESG are a candidate for any level of Internet |
| 38 |
Standard; see <a href="./rfc5741#section-2">Section 2 of RFC 5741</a>. |
| 39 |
|
| 40 |
Information about the current status of this document, any errata, |
| 41 |
and how to provide feedback on it may be obtained at |
| 42 |
<a href="http://www.rfc-editor.org/info/rfc7739">http://www.rfc-editor.org/info/rfc7739</a>. |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
<span class="grey">Gont Informational [Page 1]</span></pre> |
| 53 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span> |
| 54 |
<span class="grey"><a href="./rfc7739">RFC 7739</a> Implications of Predictable Fragment IDs February 2016</span> |
| 55 |
|
| 56 |
|
| 57 |
Copyright Notice |
| 58 |
|
| 59 |
Copyright (c) 2016 IETF Trust and the persons identified as the |
| 60 |
document authors. All rights reserved. |
| 61 |
|
| 62 |
This document is subject to <a href="https://www.rfc-editor.org/bcp/bcp78">BCP 78</a> and the IETF Trust's Legal |
| 63 |
Provisions Relating to IETF Documents |
| 64 |
(<a href="http://trustee.ietf.org/license-info">http://trustee.ietf.org/license-info</a>) in effect on the date of |
| 65 |
publication of this document. Please review these documents |
| 66 |
carefully, as they describe your rights and restrictions with respect |
| 67 |
to this document. Code Components extracted from this document must |
| 68 |
include Simplified BSD License text as described in Section 4.e of |
| 69 |
the Trust Legal Provisions and are provided without warranty as |
| 70 |
described in the Simplified BSD License. |
| 71 |
|
| 72 |
Table of Contents |
| 73 |
|
| 74 |
<a href="#section-1">1</a>. Introduction . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-3">3</a> |
| 75 |
<a href="#section-2">2</a>. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-3">3</a> |
| 76 |
3. Security Implications of Predictable Fragment Identification |
| 77 |
Values . . . . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-3">3</a> |
| 78 |
4. Constraints for the Selection of Fragment Identification |
| 79 |
Values . . . . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-7">7</a> |
| 80 |
<a href="#section-5">5</a>. Algorithms for Selecting Fragment Identification Values . . . <a href="#page-8">8</a> |
| 81 |
5.1. Per-Destination Counter (Initialized to a Random Value) . 8 |
| 82 |
<a href="#section-5.2">5.2</a>. Randomized Identification Values . . . . . . . . . . . . <a href="#page-9">9</a> |
| 83 |
5.3. Hash-Based Fragment Identification Selection Algorithm . 10 |
| 84 |
<a href="#section-6">6</a>. Security Considerations . . . . . . . . . . . . . . . . . . . <a href="#page-12">12</a> |
| 85 |
<a href="#section-7">7</a>. References . . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-13">13</a> |
| 86 |
<a href="#section-7.1">7.1</a>. Normative References . . . . . . . . . . . . . . . . . . <a href="#page-13">13</a> |
| 87 |
<a href="#section-7.2">7.2</a>. Informative References . . . . . . . . . . . . . . . . . <a href="#page-14">14</a> |
| 88 |
<a href="#appendix-A">Appendix A</a>. Information Leakage Produced by Vulnerable |
| 89 |
Implementations . . . . . . . . . . . . . . . . . . <a href="#page-16">16</a> |
| 90 |
<a href="#appendix-B">Appendix B</a>. Survey of Fragment Identification Selection |
| 91 |
Algorithms Employed by Popular IPv6 Implementations 18 |
| 92 |
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-20">20</a> |
| 93 |
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . <a href="#page-20">20</a> |
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
<span class="grey">Gont Informational [Page 2]</span></pre> |
| 109 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span> |
| 110 |
<span class="grey"><a href="./rfc7739">RFC 7739</a> Implications of Predictable Fragment IDs February 2016</span> |
| 111 |
|
| 112 |
|
| 113 |
<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Introduction</span> |
| 114 |
|
| 115 |
IPv6 specifies the Fragment Header, which is employed for the |
| 116 |
fragmentation and reassembly mechanisms. The Fragment Header |
| 117 |
contains an "Identification" field that, together with the IPv6 |
| 118 |
Source Address and the IPv6 Destination Address of a packet, |
| 119 |
identifies fragments that correspond to the same original datagram, |
| 120 |
such that they can be reassembled together by the receiving host. |
| 121 |
The only requirement for setting the Identification field is that its |
| 122 |
value must be different than that employed for any other fragmented |
| 123 |
datagram sent recently with the same Source Address and Destination |
| 124 |
Address. |
| 125 |
|
| 126 |
The most trivial algorithm to avoid reusing Identification values too |
| 127 |
quickly is to maintain a global counter that is incremented for each |
| 128 |
fragmented datagram that is transmitted. However, this trivial |
| 129 |
algorithm leads to predictable Identification values that can be |
| 130 |
leveraged to perform a variety of attacks. |
| 131 |
|
| 132 |
<a href="#section-3">Section 3</a> of this document analyzes the security implications of |
| 133 |
predictable Identification values. <a href="#section-4">Section 4</a> discusses constraints |
| 134 |
in the possible algorithms for selecting Identification values. |
| 135 |
<a href="#section-5">Section 5</a> specifies a number of algorithms that could be used for |
| 136 |
generating Identification values that mitigate the issues discussed |
| 137 |
in this document. Finally, <a href="#appendix-B">Appendix B</a> contains a survey of the |
| 138 |
algorithms employed by popular IPv6 implementations for generating |
| 139 |
the Identification values. |
| 140 |
|
| 141 |
<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Terminology</span> |
| 142 |
|
| 143 |
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", |
| 144 |
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this |
| 145 |
document are to be interpreted as described in <a href="./rfc2119">RFC 2119</a> [<a href="./rfc2119" title=""Key words for use in RFCs to Indicate Requirement Levels"">RFC2119</a>]. |
| 146 |
|
| 147 |
<span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. Security Implications of Predictable Fragment Identification Values</span> |
| 148 |
|
| 149 |
Predictable Identification values result in an information leakage |
| 150 |
that can be exploited in a number of ways. Among others, they may |
| 151 |
potentially be exploited to: |
| 152 |
|
| 153 |
o determine the packet rate at which a given system is transmitting |
| 154 |
information |
| 155 |
|
| 156 |
o perform stealth port scans to a third party |
| 157 |
|
| 158 |
o uncover the rules of a number of firewalls |
| 159 |
|
| 160 |
o count the number of systems behind a middle-box |
| 161 |
|
| 162 |
|
| 163 |
|
| 164 |
<span class="grey">Gont Informational [Page 3]</span></pre> |
| 165 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span> |
| 166 |
<span class="grey"><a href="./rfc7739">RFC 7739</a> Implications of Predictable Fragment IDs February 2016</span> |
| 167 |
|
| 168 |
|
| 169 |
o perform Denial-of-Service (DoS) attacks, or |
| 170 |
|
| 171 |
o perform data injection attacks against transport or application |
| 172 |
protocols |
| 173 |
|
| 174 |
The security implications introduced by predictable Identification |
| 175 |
values in IPv6 are very similar to those of predictable |
| 176 |
Identification values in IPv4. |
| 177 |
|
| 178 |
NOTE: |
| 179 |
[<a href="#ref-Sanfilippo1998a">Sanfilippo1998a</a>] originally pointed out how the IPv4 |
| 180 |
Identification field could be examined to determine the packet |
| 181 |
rate at which a given system is transmitting information. Later, |
| 182 |
[<a href="#ref-Sanfilippo1998b">Sanfilippo1998b</a>] described how a system with such an |
| 183 |
implementation could be used to perform a stealth port scan to a |
| 184 |
third (victim) host. [<a href="#ref-Sanfilippo1999">Sanfilippo1999</a>] explained how to exploit |
| 185 |
this implementation strategy to uncover the rules of a number of |
| 186 |
firewalls. [<a href="#ref-Bellovin2002">Bellovin2002</a>] explained how the IPv4 Identification |
| 187 |
field could be exploited to count the number of systems behind a |
| 188 |
NAT. [<a href="#ref-Fyodor2004">Fyodor2004</a>] is an entire paper on most (if not all) the |
| 189 |
ways to exploit the information provided by the Identification |
| 190 |
field of the IPv4 header (and these results apply in a similar way |
| 191 |
to IPv6). [<a href="#ref-Zalewski2003">Zalewski2003</a>] originally envisioned the exploitation |
| 192 |
of IP fragmentation/reassembly for performing data injection |
| 193 |
attacks against upper-layer protocols. [<a href="#ref-Herzberg2013">Herzberg2013</a>] explores |
| 194 |
the use of IPv4/IPv6 fragmentation and predictable Identification |
| 195 |
values for performing DNS cache poisoning attacks in great detail. |
| 196 |
[<a href="./rfc6274" title=""Security Assessment of the Internet Protocol Version 4"">RFC6274</a>] covers the security implications of the IPv4 case in |
| 197 |
detail. |
| 198 |
|
| 199 |
One key difference between the IPv4 case and the IPv6 case is that, |
| 200 |
in IPv4, the Identification field is part of the fixed IPv4 header |
| 201 |
(and thus usually set for all packets), while in IPv6 the |
| 202 |
Identification field is present only in those packets that carry a |
| 203 |
Fragment Header. As a result, successful exploitation of the |
| 204 |
Identification field depends on two different factors: |
| 205 |
|
| 206 |
o vulnerable Identification generators, and |
| 207 |
|
| 208 |
o the ability of an attacker to trigger the use of IPv6 |
| 209 |
fragmentation for packets sent from/to the victim node |
| 210 |
|
| 211 |
The scenarios in which an attacker may successfully perform the |
| 212 |
aforementioned attacks depend on the specific attack type. For |
| 213 |
example, in order to perform a DoS attack on communications between |
| 214 |
two hosts, an attacker would need to know the IPv6 addresses employed |
| 215 |
by the aforementioned two nodes. Such knowledge may be readily |
| 216 |
available if the target of the attack is the communication between |
| 217 |
|
| 218 |
|
| 219 |
|
| 220 |
<span class="grey">Gont Informational [Page 4]</span></pre> |
| 221 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span> |
| 222 |
<span class="grey"><a href="./rfc7739">RFC 7739</a> Implications of Predictable Fragment IDs February 2016</span> |
| 223 |
|
| 224 |
|
| 225 |
two specific BGP peers, two specific SMTP servers, or one specific |
| 226 |
primary DNS server and one of its secondary DNS servers, but may not |
| 227 |
be easily available if the goal is a DoS attack on all communications |
| 228 |
between arbitrary IPv6 hosts (e.g., the goal is to perform a DoS |
| 229 |
attack on all communications involving one specific node with |
| 230 |
arbitrary/unknown hosts). Other attacks, such as performing stealth |
| 231 |
port scans to a third party or determining the packet rate at which a |
| 232 |
given system is transmitting information, only require the attacker |
| 233 |
to know the IPv6 address of a vulnerable implementation. |
| 234 |
|
| 235 |
As noted in <a href="#section-1">Section 1</a>, some implementations have been known to use |
| 236 |
predictable Identification values. For instance, <a href="#appendix-B">Appendix B</a> of this |
| 237 |
document shows that recent versions of a number of popular IPv6 |
| 238 |
implementations employ predictable values for the Identification |
| 239 |
field of the Fragment Header. |
| 240 |
|
| 241 |
Additionally, we note that [<a href="./rfc2460" title=""Internet Protocol, Version 6 (IPv6) Specification"">RFC2460</a>] states that when an ICMPv6 |
| 242 |
Packet Too Big (PTB) error message advertising a Maximum Transfer |
| 243 |
Unit (MTU) smaller than 1280 bytes is received, the receiving host is |
| 244 |
not required to reduce the Path-MTU for the corresponding Destination |
| 245 |
Address, but must simply include a Fragment Header in all subsequent |
| 246 |
packets sent to that destination. This triggers the use of the so- |
| 247 |
called IPv6 "atomic fragments" [<a href="./rfc6946" title=""Processing of IPv6 "">RFC6946</a>]: IPv6 fragments with a |
| 248 |
Fragment Offset equal to 0, and the "M" ("More fragments") bit clear. |
| 249 |
[<a href="#ref-DEPGEN" title=""Generation of IPv6 Atomic Fragments Considered Harmful"">DEPGEN</a>] documents the motivation of deprecating the generation of |
| 250 |
IPv6 atomic fragments in [<a href="./rfc2460" title=""Internet Protocol, Version 6 (IPv6) Specification"">RFC2460</a>]. |
| 251 |
|
| 252 |
Thus, an attacker can usually cause a victim host to "fragment" its |
| 253 |
outgoing packets by sending it a forged ICMPv6 Packet Too Big (PTB) |
| 254 |
error message that advertises an MTU smaller than 1280 bytes. |
| 255 |
|
| 256 |
There are a number of aspects that should be considered, though: |
| 257 |
|
| 258 |
o All the implementations the author is aware of record the Path-MTU |
| 259 |
information on a per-destination basis. Thus, an attacker can |
| 260 |
only cause the victim to enable fragmentation for those packets |
| 261 |
sent to the Source Address of IPv6 packet embedded in the payload |
| 262 |
of the ICMPv6 PTB message. However, we note that <a href="./rfc1981#section-5.2">Section 5.2 of |
| 263 |
[RFC1981]</a> notes that an implementation could maintain a single |
| 264 |
system-wide Path MTU (PMTU) value to be used for all packets sent |
| 265 |
to that node. Clearly, such implementations would exacerbate the |
| 266 |
problem of any attacks based on Path MTU Discovery (PMTUD) |
| 267 |
[<a href="./rfc5927" title=""ICMP Attacks against TCP"">RFC5927</a>] or IPv6 fragmentation. |
| 268 |
|
| 269 |
o If the victim node implements some of the counter-measures for |
| 270 |
ICMP attacks described in <a href="./rfc5927">RFC 5927</a> [<a href="./rfc5927" title=""ICMP Attacks against TCP"">RFC5927</a>], it might be |
| 271 |
difficult for an attacker to cause the victim node to employ |
| 272 |
fragmentation for its outgoing packets. However, many current |
| 273 |
|
| 274 |
|
| 275 |
|
| 276 |
<span class="grey">Gont Informational [Page 5]</span></pre> |
| 277 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span> |
| 278 |
<span class="grey"><a href="./rfc7739">RFC 7739</a> Implications of Predictable Fragment IDs February 2016</span> |
| 279 |
|
| 280 |
|
| 281 |
implementations fail to enforce these validation checks. For |
| 282 |
example, Linux 2.6.38-8 does not even require received ICMPv6 |
| 283 |
error messages to correspond to an ongoing communication instance. |
| 284 |
|
| 285 |
o Some implementations (notably Linux) have already been updated |
| 286 |
according to [<a href="#ref-DEPGEN" title=""Generation of IPv6 Atomic Fragments Considered Harmful"">DEPGEN</a>] such that ICMPv6 PTB messages do not result |
| 287 |
in the generation of IPv6 atomic fragments. |
| 288 |
|
| 289 |
Implementations that employ predictable Identification values and |
| 290 |
also fail to enforce validation checks on ICMPv6 error messages |
| 291 |
become vulnerable to the same type of attacks that can be exploited |
| 292 |
with IPv4 fragmentation, discussed earlier in this section. |
| 293 |
|
| 294 |
One possible way in which predictable Identification values could be |
| 295 |
leveraged for performing a DoS attack is as follows: Let us assume |
| 296 |
that Host A is communicating with Host B, and that an attacker wants |
| 297 |
to perform a DoS attack such communication. The attacker would learn |
| 298 |
the Identification value currently in use by Host A, possibly by |
| 299 |
sending any packet that would elicit a fragmented response (e.g., an |
| 300 |
ICPMv6 echo request with a large payload). The attacker would then |
| 301 |
send a forged ICMPv6 PTB error message to Host A (with the IPv6 |
| 302 |
Source Address of the embedded IPv6 packet set to the IPv6 address of |
| 303 |
Host A, and the Destination Address of the embedded IPv6 packet set |
| 304 |
to the IPv6 address of a Host B), such that any subsequent packets |
| 305 |
sent by Host A to Host B include a Fragment Header. Finally, the |
| 306 |
attacker would send forged IPv6 fragments to Host B, with their IPv6 |
| 307 |
Source Address set to that of Host A, and Identification values that |
| 308 |
would result in collisions with the Identification values employed |
| 309 |
for the legitimate traffic sent by Host A to Host B. If Host B |
| 310 |
discards fragments that result in collisions of Identification values |
| 311 |
(e.g., such fragments overlap, and the host implements [<a href="./rfc5722" title=""Handling of Overlapping IPv6 Fragments"">RFC5722</a>]), |
| 312 |
the attacker could simply trash the Identification space by sending |
| 313 |
multiple forged fragments with different Identification values, such |
| 314 |
that any subsequent packets from Host A to Host B are discarded at |
| 315 |
Host B as a result of the malicious fragments sent by the attacker. |
| 316 |
|
| 317 |
NOTE: |
| 318 |
For example, Linux 2.6.38-10 is vulnerable to the aforementioned |
| 319 |
issue. |
| 320 |
|
| 321 |
[<a id="ref-RFC6946">RFC6946</a>] describes an improved processing of these packets that |
| 322 |
would eliminate this specific attack vector, at least in the case |
| 323 |
of TCP connections that employ the Path-MTU Discovery mechanism. |
| 324 |
|
| 325 |
The aforementioned attack scenario is simply included to illustrate |
| 326 |
the problem of employing predictable Identification values. We note |
| 327 |
that regardless of the attacker's ability to cause a victim host to |
| 328 |
|
| 329 |
|
| 330 |
|
| 331 |
|
| 332 |
<span class="grey">Gont Informational [Page 6]</span></pre> |
| 333 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span> |
| 334 |
<span class="grey"><a href="./rfc7739">RFC 7739</a> Implications of Predictable Fragment IDs February 2016</span> |
| 335 |
|
| 336 |
|
| 337 |
employ fragmentation when communicating with third parties, use of |
| 338 |
predictable Identification values makes communication flows that |
| 339 |
employ fragmentation vulnerable to any fragmentation-based attacks. |
| 340 |
|
| 341 |
<span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. Constraints for the Selection of Fragment Identification Values</span> |
| 342 |
|
| 343 |
The Identification field of the Fragment Header is 32-bits long. |
| 344 |
However, when translators (e.g. [<a href="./rfc6145" title=""IP/ICMP Translation Algorithm"">RFC6145</a>]) are employed, the high- |
| 345 |
order 16 bits of the Identification field are effectively ignored. |
| 346 |
|
| 347 |
NOTE: |
| 348 |
[<a href="./rfc6145" title=""IP/ICMP Translation Algorithm"">RFC6145</a>] notes that, when translating in the IPv6-to-IPv4 |
| 349 |
direction, "if there is a Fragment Header in the IPv6 packet, the |
| 350 |
last 16 bits of its value MUST be used for the IPv4 identification |
| 351 |
value". |
| 352 |
|
| 353 |
Additionally, <a href="./rfc6052#section-3.3">Section 3.3 of [RFC6052]</a> encourages operators to use |
| 354 |
a Network-Specific Prefix (NSP) that maps the IPv4 address space |
| 355 |
into IPv6. Thus, when an NSP is being used, IPv6 addresses |
| 356 |
representing IPv4 nodes (reached through a stateless translator) |
| 357 |
are indistinguishable from native IPv6 addresses. |
| 358 |
|
| 359 |
Thus, when translators are employed, the "effective" length of the |
| 360 |
Identification field is 16 bits and, as a result, at least during the |
| 361 |
IPv6/IPv4 transition/co-existence phase, it is probably safer to |
| 362 |
assume that only the low-order 16 bits of the Identification field |
| 363 |
are of use to the destination system. |
| 364 |
|
| 365 |
Regarding the selection of Identification values, the only |
| 366 |
requirement specified in [<a href="./rfc2460" title=""Internet Protocol, Version 6 (IPv6) Specification"">RFC2460</a>] is that the Identification value |
| 367 |
must be different than that of any other fragmented packet sent |
| 368 |
recently with the same Source Address and Destination Address. |
| 369 |
Failure to comply with this requirement could lead to the |
| 370 |
interoperability problems discussed in [<a href="./rfc4963" title=""IPv4 Reassembly Errors at High Data Rates"">RFC4963</a>]. |
| 371 |
|
| 372 |
From a security standpoint, unpredictable Identification values are |
| 373 |
desirable. However, this is somewhat at odds with the "reuse" |
| 374 |
requirements specified in [<a href="./rfc2460" title=""Internet Protocol, Version 6 (IPv6) Specification"">RFC2460</a>], that specifies that an |
| 375 |
Identification value must be different than that employed for any |
| 376 |
other fragmented packet sent recently with the same Source Address |
| 377 |
and Destination Address. |
| 378 |
|
| 379 |
Finally, since Identification values need to be selected for each |
| 380 |
outgoing datagram that requires fragmentation, the performance impact |
| 381 |
should be considered when choosing an algorithm for the selection of |
| 382 |
Identification values. |
| 383 |
|
| 384 |
|
| 385 |
|
| 386 |
|
| 387 |
|
| 388 |
<span class="grey">Gont Informational [Page 7]</span></pre> |
| 389 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span> |
| 390 |
<span class="grey"><a href="./rfc7739">RFC 7739</a> Implications of Predictable Fragment IDs February 2016</span> |
| 391 |
|
| 392 |
|
| 393 |
<span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. Algorithms for Selecting Fragment Identification Values</span> |
| 394 |
|
| 395 |
There are a number of algorithms that may be used for setting the |
| 396 |
Identification field such that the security issues discussed in this |
| 397 |
document are avoided. This section presents three of those. |
| 398 |
|
| 399 |
The algorithm in <a href="#section-5.1">Section 5.1</a> typically leads to a low Identification |
| 400 |
reuse frequency at the expense of keeping per-destination state; this |
| 401 |
algorithm only uses a Pseudorandom Number Generator (PNRG) when the |
| 402 |
host communicates with a new destination. The algorithm in |
| 403 |
<a href="#section-5.2">Section 5.2</a> may result in a higher Identification reuse frequency. |
| 404 |
It also uses a PRNG for each datagram that needs to be fragmented. |
| 405 |
Hence, the algorithm in <a href="#section-5.1">Section 5.1</a> will likely result in better |
| 406 |
performance properties. Finally, the algorithm in <a href="#section-5.3">Section 5.3</a> |
| 407 |
achieves a similar Identification reuse frequency to that of the |
| 408 |
algorithm in <a href="#section-5.1">Section 5.1</a> without the need of keeping state, but |
| 409 |
possibly at the expense of lower per-packet performance. |
| 410 |
|
| 411 |
NOTE: |
| 412 |
Since the specific algorithm to be employed for the PRNGs in |
| 413 |
<a href="#section-5.1">Section 5.1</a> and <a href="#section-5.2">Section 5.2</a>, and the specific algorithms to be |
| 414 |
employed for the hash functions in <a href="#section-5.3">Section 5.3</a> have not been |
| 415 |
specified, it is impossible to provide a quantitative performance |
| 416 |
comparison of the algorithms described in this section. |
| 417 |
|
| 418 |
<span class="h3"><a class="selflink" id="section-5.1" href="#section-5.1">5.1</a>. Per-Destination Counter (Initialized to a Random Value)</span> |
| 419 |
|
| 420 |
This algorithm consists of the following steps: |
| 421 |
|
| 422 |
1. Whenever a packet must be sent with a Fragment Header, the |
| 423 |
sending host should look up in the Destination Cache an entry |
| 424 |
corresponding to the Destination Address of the packet. |
| 425 |
|
| 426 |
2. If such an entry exists, it contains the last Identification |
| 427 |
value used for that Destination Address. Therefore, such a value |
| 428 |
should be incremented by 1 and used for setting the |
| 429 |
Identification field of the outgoing packet. Additionally, the |
| 430 |
updated value should be recorded in the corresponding entry of |
| 431 |
the Destination Cache [<a href="./rfc4861" title=""Neighbor Discovery for IP version 6 (IPv6)"">RFC4861</a>]. |
| 432 |
|
| 433 |
3. If such an entry does not exist, it should be created, and the |
| 434 |
Identification value for that destination should be initialized |
| 435 |
with a random value (e.g., with a Pseudorandom Number Generator), |
| 436 |
and used for setting the Identification field of the Fragment |
| 437 |
Header of the outgoing fragmented datagram. |
| 438 |
|
| 439 |
|
| 440 |
|
| 441 |
|
| 442 |
|
| 443 |
|
| 444 |
<span class="grey">Gont Informational [Page 8]</span></pre> |
| 445 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span> |
| 446 |
<span class="grey"><a href="./rfc7739">RFC 7739</a> Implications of Predictable Fragment IDs February 2016</span> |
| 447 |
|
| 448 |
|
| 449 |
The advantages of this algorithm are: |
| 450 |
|
| 451 |
o It is simple to implement, with the only complexity residing in |
| 452 |
the PRNG used to initialize the Identification value contained in |
| 453 |
each entry of the Destination Cache. |
| 454 |
|
| 455 |
o The Identification reuse frequency will typically be lower than |
| 456 |
that achieved by a global counter (when sending traffic to |
| 457 |
multiple destinations), since this algorithm uses per-destination |
| 458 |
counters (rather than a single system-wide counter). |
| 459 |
|
| 460 |
o It has good performance properties (once the corresponding entry |
| 461 |
in the Destination Cache has been created and initialized, each |
| 462 |
subsequent Identification value simply involves the increment of a |
| 463 |
counter). |
| 464 |
|
| 465 |
The possible drawbacks of this algorithm are: |
| 466 |
|
| 467 |
o If, as a result of resource management, an entry of the |
| 468 |
Destination Cache must be removed, the last Identification value |
| 469 |
used for that Destination will be lost. Thus, subsequent traffic |
| 470 |
to that destination would cause that entry to be recreated and |
| 471 |
reinitialized to random value, thus possibly leading to |
| 472 |
Identification "collisions". |
| 473 |
|
| 474 |
o Since the Identification values are predictable by the destination |
| 475 |
host, a vulnerable host might possibly leak to third parties the |
| 476 |
Identification values used by other hosts to send traffic to it |
| 477 |
(i.e., Host B could leak to Host C the Identification values that |
| 478 |
Host A is using to send packets to Host B). <a href="#appendix-A">Appendix A</a> describes |
| 479 |
one possible scenario for such leakage in detail. |
| 480 |
|
| 481 |
<span class="h3"><a class="selflink" id="section-5.2" href="#section-5.2">5.2</a>. Randomized Identification Values</span> |
| 482 |
|
| 483 |
Clearly, use of a Pseudorandom Number Generator for selecting the |
| 484 |
Identification would be desirable from a security standpoint. With |
| 485 |
such a scheme, the Identification of each fragmented datagram would |
| 486 |
be selected as: |
| 487 |
|
| 488 |
Identification = random() |
| 489 |
|
| 490 |
where "random()" is the PRNG. |
| 491 |
|
| 492 |
The specific properties of such scheme would clearly depend on the |
| 493 |
specific PRNG employed. For example, some PRNGs may result in higher |
| 494 |
Identification reuse frequencies than others, in the same way that |
| 495 |
some PRNGs may be more expensive (in terms of processing requirements |
| 496 |
and/or implementation complexity) than others. |
| 497 |
|
| 498 |
|
| 499 |
|
| 500 |
<span class="grey">Gont Informational [Page 9]</span></pre> |
| 501 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-10" ></span> |
| 502 |
<span class="grey"><a href="./rfc7739">RFC 7739</a> Implications of Predictable Fragment IDs February 2016</span> |
| 503 |
|
| 504 |
|
| 505 |
Discussion of the properties of possible PRNGs is considered out of |
| 506 |
the scope of this document. However, we do note that some PRNGs |
| 507 |
employed in the past by some implementations have been found to be |
| 508 |
predictable [<a href="#ref-Klein2007">Klein2007</a>]. Please see [<a href="./rfc4086" title=""Randomness Requirements for Security"">RFC4086</a>] for randomness |
| 509 |
requirements for security. |
| 510 |
|
| 511 |
<span class="h3"><a class="selflink" id="section-5.3" href="#section-5.3">5.3</a>. Hash-Based Fragment Identification Selection Algorithm</span> |
| 512 |
|
| 513 |
Another alternative is to implement a hash-based algorithm similar to |
| 514 |
that specified in [<a href="./rfc6056" title=""Recommendations for Transport- Protocol Port Randomization"">RFC6056</a>] for the selection of transport port |
| 515 |
numbers. With such a scheme, the Identification value of each |
| 516 |
fragmented datagram would be selected with the expression: |
| 517 |
|
| 518 |
Identification = F(Src IP, Dst IP, secret1) + |
| 519 |
counter[G(Src IP, Dst Pref, secret2)] |
| 520 |
|
| 521 |
where: |
| 522 |
|
| 523 |
Identification: |
| 524 |
Identification value to be used for the fragmented datagram. |
| 525 |
|
| 526 |
F(): |
| 527 |
Hash function. |
| 528 |
|
| 529 |
Src IP: |
| 530 |
IPv6 Source Address of the datagram to be fragmented. |
| 531 |
|
| 532 |
Dst IP: |
| 533 |
IPv6 Destination Address of the datagram to be fragmented. |
| 534 |
|
| 535 |
secret1: |
| 536 |
Secret data unknown to the attacker. This value can be |
| 537 |
initialized to a pseudo-random value during the system |
| 538 |
bootstrapping sequence. It should remain constant at least while |
| 539 |
there could be previously sent fragments still in the network or |
| 540 |
at the fragment reassembly buffer of the corresponding destination |
| 541 |
system(s). |
| 542 |
|
| 543 |
counter[]: |
| 544 |
System-wide array of 32-bit counters (e.g. with 8K elements or |
| 545 |
more). Each counter should be initialized to a pseudo-random |
| 546 |
value during the system bootstrapping sequence. |
| 547 |
|
| 548 |
G(): |
| 549 |
Hash function. It may or may not be the same hash function as |
| 550 |
that used for F(). |
| 551 |
|
| 552 |
|
| 553 |
|
| 554 |
|
| 555 |
|
| 556 |
<span class="grey">Gont Informational [Page 10]</span></pre> |
| 557 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-11" ></span> |
| 558 |
<span class="grey"><a href="./rfc7739">RFC 7739</a> Implications of Predictable Fragment IDs February 2016</span> |
| 559 |
|
| 560 |
|
| 561 |
Dst Pref: |
| 562 |
IPv6 "Destination Prefix" of the datagram to be fragmented (can be |
| 563 |
assumed to be the first eight bytes of the Destination Address of |
| 564 |
such packet). Note: the "Destination Prefix" (rather than |
| 565 |
Destination Address) is used, such that the ability of an attacker |
| 566 |
of searching the "increments" space by using multiple addresses of |
| 567 |
the same subnet is reduced. |
| 568 |
|
| 569 |
secret2: |
| 570 |
Secret data unknown to the attacker. This value can be |
| 571 |
initialized to a pseudo-random value during the system |
| 572 |
bootstrapping sequence. It should remain constant at least while |
| 573 |
there could be previously sent fragments still in the network or |
| 574 |
at the fragment reassembly buffer of the corresponding destination |
| 575 |
system(s). |
| 576 |
|
| 577 |
NOTE: |
| 578 |
counter[G(src IP, Dst Pref, secret2)] should be incremented by one |
| 579 |
each time an Identification value is selected. |
| 580 |
|
| 581 |
The output of F() will be constant for each (Src IP, Dst IP) pair. |
| 582 |
Similarly, the output of G() will be constant for each (Src IP, Dst |
| 583 |
Pref) pair. Thus, the resulting Identification value will be the |
| 584 |
result of a random offset plus a linear function (provided by |
| 585 |
counter[]), therefore resulting in a monotonically increasing |
| 586 |
sequence of Identification values for each (src IP, Dst IP) pair. |
| 587 |
|
| 588 |
NOTE: |
| 589 |
F() essentially provides the unpredictability (by off-path |
| 590 |
attackers) of the resulting Identification values, while counter[] |
| 591 |
provides a linear function such that the Identification values are |
| 592 |
different for each fragmented packet while the Identification |
| 593 |
reuse frequency is minimized. |
| 594 |
|
| 595 |
The advantages of this algorithm are: |
| 596 |
|
| 597 |
o The Identification reuse frequency will typically be lower than |
| 598 |
that achieved by a global counter (when sending traffic to |
| 599 |
multiple destinations), since this algorithm uses multiple system- |
| 600 |
wide counters (rather than a single system-wide counter). The |
| 601 |
extent to which the reuse frequency will be lower depends on the |
| 602 |
number of elements in counter[], and the number of other active |
| 603 |
flows that result in the same value of G() (and hence cause the |
| 604 |
same counter to be incremented for each datagram that is |
| 605 |
fragmented). |
| 606 |
|
| 607 |
|
| 608 |
|
| 609 |
|
| 610 |
|
| 611 |
|
| 612 |
<span class="grey">Gont Informational [Page 11]</span></pre> |
| 613 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-12" ></span> |
| 614 |
<span class="grey"><a href="./rfc7739">RFC 7739</a> Implications of Predictable Fragment IDs February 2016</span> |
| 615 |
|
| 616 |
|
| 617 |
o It is possible to implement the algorithm such that good |
| 618 |
performance is achieved. For example, the result of F() could be |
| 619 |
stored in the Destination Cache (such that it need not be |
| 620 |
recomputed for each packet that must be sent) along with the |
| 621 |
computed index/argument for counter[]. |
| 622 |
|
| 623 |
NOTE: |
| 624 |
If this implementation approach is followed, and an entry of |
| 625 |
the Destination Cache must be removed as a result of resource |
| 626 |
management, the last Identification value used for that |
| 627 |
Destination will *not* be lost. This is an improvement over |
| 628 |
the algorithm specified in <a href="#section-5.1">Section 5.1</a>. |
| 629 |
|
| 630 |
The possible drawbacks of this algorithm are: |
| 631 |
|
| 632 |
o Since the Identification values are predictable by the destination |
| 633 |
host, a vulnerable host could possibly leak to third parties the |
| 634 |
Identification values used by other hosts to send traffic to it |
| 635 |
(i.e., Host B could leak to Host C the Identification values that |
| 636 |
Host A is using to send packets to Host B). <a href="#appendix-A">Appendix A</a> describes |
| 637 |
a possible scenario in which that information leakage could take |
| 638 |
place. We note, however, that this algorithm makes the |
| 639 |
aforementioned attack less reliable for the attacker, since each |
| 640 |
counter could be possibly shared by multiple traffic flows (i.e., |
| 641 |
packets destined to other destinations might cause the same |
| 642 |
counter to be incremented). |
| 643 |
|
| 644 |
This algorithm might be preferable (over the one specified in |
| 645 |
<a href="#section-5.1">Section 5.1</a>) in those scenarios in which a node is expected to |
| 646 |
communicate with a large number of destinations, and thus it is |
| 647 |
desirable to limit the amount of information to be maintained in |
| 648 |
memory. |
| 649 |
|
| 650 |
NOTE: |
| 651 |
In such scenarios, if the algorithm specified in <a href="#section-5.1">Section 5.1</a> were |
| 652 |
implemented, entries from the Destination Cache might need to be |
| 653 |
pruned frequently, thus increasing the risk of Identification |
| 654 |
"collisions". |
| 655 |
|
| 656 |
<span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>. Security Considerations</span> |
| 657 |
|
| 658 |
This document discusses the security implications of predictable |
| 659 |
Identification values, and provides implementation guidance such that |
| 660 |
the aforementioned security implications can be mitigated. |
| 661 |
|
| 662 |
|
| 663 |
|
| 664 |
|
| 665 |
|
| 666 |
|
| 667 |
|
| 668 |
<span class="grey">Gont Informational [Page 12]</span></pre> |
| 669 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-13" ></span> |
| 670 |
<span class="grey"><a href="./rfc7739">RFC 7739</a> Implications of Predictable Fragment IDs February 2016</span> |
| 671 |
|
| 672 |
|
| 673 |
A number of possible algorithms are described, to provide some |
| 674 |
implementation alternatives to implementers. We note that the |
| 675 |
selection of such an algorithm usually implies a number of trade-offs |
| 676 |
(security, performance, implementation complexity, interoperability |
| 677 |
properties, etc.). |
| 678 |
|
| 679 |
<span class="h2"><a class="selflink" id="section-7" href="#section-7">7</a>. References</span> |
| 680 |
|
| 681 |
<span class="h3"><a class="selflink" id="section-7.1" href="#section-7.1">7.1</a>. Normative References</span> |
| 682 |
|
| 683 |
[<a id="ref-RFC1981">RFC1981</a>] McCann, J., Deering, S., and J. Mogul, "Path MTU Discovery |
| 684 |
for IP version 6", <a href="./rfc1981">RFC 1981</a>, DOI 10.17487/RFC1981, August |
| 685 |
1996, <<a href="http://www.rfc-editor.org/info/rfc1981">http://www.rfc-editor.org/info/rfc1981</a>>. |
| 686 |
|
| 687 |
[<a id="ref-RFC2119">RFC2119</a>] Bradner, S., "Key words for use in RFCs to Indicate |
| 688 |
Requirement Levels", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc2119">RFC 2119</a>, |
| 689 |
DOI 10.17487/RFC2119, March 1997, |
| 690 |
<<a href="http://www.rfc-editor.org/info/rfc2119">http://www.rfc-editor.org/info/rfc2119</a>>. |
| 691 |
|
| 692 |
[<a id="ref-RFC2460">RFC2460</a>] Deering, S. and R. Hinden, "Internet Protocol, Version 6 |
| 693 |
(IPv6) Specification", <a href="./rfc2460">RFC 2460</a>, DOI 10.17487/RFC2460, |
| 694 |
December 1998, <<a href="http://www.rfc-editor.org/info/rfc2460">http://www.rfc-editor.org/info/rfc2460</a>>. |
| 695 |
|
| 696 |
[<a id="ref-RFC4086">RFC4086</a>] Eastlake 3rd, D., Schiller, J., and S. Crocker, |
| 697 |
"Randomness Requirements for Security", <a href="https://www.rfc-editor.org/bcp/bcp106">BCP 106</a>, <a href="./rfc4086">RFC 4086</a>, |
| 698 |
DOI 10.17487/RFC4086, June 2005, |
| 699 |
<<a href="http://www.rfc-editor.org/info/rfc4086">http://www.rfc-editor.org/info/rfc4086</a>>. |
| 700 |
|
| 701 |
[<a id="ref-RFC4861">RFC4861</a>] Narten, T., Nordmark, E., Simpson, W., and H. Soliman, |
| 702 |
"Neighbor Discovery for IP version 6 (IPv6)", <a href="./rfc4861">RFC 4861</a>, |
| 703 |
DOI 10.17487/RFC4861, September 2007, |
| 704 |
<<a href="http://www.rfc-editor.org/info/rfc4861">http://www.rfc-editor.org/info/rfc4861</a>>. |
| 705 |
|
| 706 |
[<a id="ref-RFC5722">RFC5722</a>] Krishnan, S., "Handling of Overlapping IPv6 Fragments", |
| 707 |
<a href="./rfc5722">RFC 5722</a>, DOI 10.17487/RFC5722, December 2009, |
| 708 |
<<a href="http://www.rfc-editor.org/info/rfc5722">http://www.rfc-editor.org/info/rfc5722</a>>. |
| 709 |
|
| 710 |
[<a id="ref-RFC6052">RFC6052</a>] Bao, C., Huitema, C., Bagnulo, M., Boucadair, M., and X. |
| 711 |
Li, "IPv6 Addressing of IPv4/IPv6 Translators", <a href="./rfc6052">RFC 6052</a>, |
| 712 |
DOI 10.17487/RFC6052, October 2010, |
| 713 |
<<a href="http://www.rfc-editor.org/info/rfc6052">http://www.rfc-editor.org/info/rfc6052</a>>. |
| 714 |
|
| 715 |
[<a id="ref-RFC6056">RFC6056</a>] Larsen, M. and F. Gont, "Recommendations for Transport- |
| 716 |
Protocol Port Randomization", <a href="https://www.rfc-editor.org/bcp/bcp156">BCP 156</a>, <a href="./rfc6056">RFC 6056</a>, |
| 717 |
DOI 10.17487/RFC6056, January 2011, |
| 718 |
<<a href="http://www.rfc-editor.org/info/rfc6056">http://www.rfc-editor.org/info/rfc6056</a>>. |
| 719 |
|
| 720 |
|
| 721 |
|
| 722 |
|
| 723 |
|
| 724 |
<span class="grey">Gont Informational [Page 13]</span></pre> |
| 725 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-14" ></span> |
| 726 |
<span class="grey"><a href="./rfc7739">RFC 7739</a> Implications of Predictable Fragment IDs February 2016</span> |
| 727 |
|
| 728 |
|
| 729 |
[<a id="ref-RFC6145">RFC6145</a>] Li, X., Bao, C., and F. Baker, "IP/ICMP Translation |
| 730 |
Algorithm", <a href="./rfc6145">RFC 6145</a>, DOI 10.17487/RFC6145, April 2011, |
| 731 |
<<a href="http://www.rfc-editor.org/info/rfc6145">http://www.rfc-editor.org/info/rfc6145</a>>. |
| 732 |
|
| 733 |
[<a id="ref-RFC6946">RFC6946</a>] Gont, F., "Processing of IPv6 "Atomic" Fragments", |
| 734 |
<a href="./rfc6946">RFC 6946</a>, DOI 10.17487/RFC6946, May 2013, |
| 735 |
<<a href="http://www.rfc-editor.org/info/rfc6946">http://www.rfc-editor.org/info/rfc6946</a>>. |
| 736 |
|
| 737 |
<span class="h3"><a class="selflink" id="section-7.2" href="#section-7.2">7.2</a>. Informative References</span> |
| 738 |
|
| 739 |
[<a id="ref-RFC4963">RFC4963</a>] Heffner, J., Mathis, M., and B. Chandler, "IPv4 Reassembly |
| 740 |
Errors at High Data Rates", <a href="./rfc4963">RFC 4963</a>, |
| 741 |
DOI 10.17487/RFC4963, July 2007, |
| 742 |
<<a href="http://www.rfc-editor.org/info/rfc4963">http://www.rfc-editor.org/info/rfc4963</a>>. |
| 743 |
|
| 744 |
[<a id="ref-RFC5927">RFC5927</a>] Gont, F., "ICMP Attacks against TCP", <a href="./rfc5927">RFC 5927</a>, |
| 745 |
DOI 10.17487/RFC5927, July 2010, |
| 746 |
<<a href="http://www.rfc-editor.org/info/rfc5927">http://www.rfc-editor.org/info/rfc5927</a>>. |
| 747 |
|
| 748 |
[<a id="ref-RFC6274">RFC6274</a>] Gont, F., "Security Assessment of the Internet Protocol |
| 749 |
Version 4", <a href="./rfc6274">RFC 6274</a>, DOI 10.17487/RFC6274, July 2011, |
| 750 |
<<a href="http://www.rfc-editor.org/info/rfc6274">http://www.rfc-editor.org/info/rfc6274</a>>. |
| 751 |
|
| 752 |
[<a id="ref-DEPGEN">DEPGEN</a>] Gont, F., Liu, S., and T. Anderson, "Generation of IPv6 |
| 753 |
Atomic Fragments Considered Harmful", Work in Progress, |
| 754 |
<a href="./draft-ietf-6man-deprecate-atomfrag-generation-05">draft-ietf-6man-deprecate-atomfrag-generation-05</a>, January |
| 755 |
2016. |
| 756 |
|
| 757 |
[<a id="ref-Bellovin2002">Bellovin2002</a>] |
| 758 |
Bellovin, S., "A Technique for Counting NATted Hosts", |
| 759 |
IMW'02 Nov. 6-8, 2002, Marseille, France, |
| 760 |
DOI 10.1145/637201.637243, 2002. |
| 761 |
|
| 762 |
[<a id="ref-Fyodor2004">Fyodor2004</a>] |
| 763 |
Lyon, G., "TCP Idle Scan", from Chapter 5 of "Nmap Network |
| 764 |
Scanning", 2004, |
| 765 |
<<a href="http://www.insecure.org/nmap/idlescan.html">http://www.insecure.org/nmap/idlescan.html</a>>. |
| 766 |
|
| 767 |
[<a id="ref-Herzberg2013">Herzberg2013</a>] |
| 768 |
Herzberg, A. and H. Shulman, "Fragmentation Considered |
| 769 |
Poisonous", Technical Report 13-03, March 2013, |
| 770 |
<<a href="http://u.cs.biu.ac.il/~herzbea/security/13-03-frag.pdf">http://u.cs.biu.ac.il/~herzbea/security/13-03-frag.pdf</a>>. |
| 771 |
|
| 772 |
[<a id="ref-Klein2007">Klein2007</a>] |
| 773 |
Klein, A., "OpenBSD DNS Cache Poisoning and Multiple O/S |
| 774 |
Predictable IP ID Vulnerability", 2007, |
| 775 |
<<a href="http://www.trusteer.com/files/OpenBSD_DNS_Cache_Poisoning_and_Multiple_OS_Predictable_IP_ID_Vulnerability.pdf">http://www.trusteer.com/files/OpenBSD_DNS_Cache_Poisoning</a> |
| 776 |
<a href="http://www.trusteer.com/files/OpenBSD_DNS_Cache_Poisoning_and_Multiple_OS_Predictable_IP_ID_Vulnerability.pdf">_and_Multiple_OS_Predictable_IP_ID_Vulnerability.pdf</a>>. |
| 777 |
|
| 778 |
|
| 779 |
|
| 780 |
<span class="grey">Gont Informational [Page 14]</span></pre> |
| 781 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-15" ></span> |
| 782 |
<span class="grey"><a href="./rfc7739">RFC 7739</a> Implications of Predictable Fragment IDs February 2016</span> |
| 783 |
|
| 784 |
|
| 785 |
[<a id="ref-Sanfilippo1998a">Sanfilippo1998a</a>] |
| 786 |
Sanfilippo, S., "Subject: about the ip header id", message |
| 787 |
to Bugtraq mailing list, 14 December 1998, |
| 788 |
<<a href="http://diswww.mit.edu/menelaus.mit.edu/bt/8704">http://diswww.mit.edu/menelaus.mit.edu/bt/8704</a>>. |
| 789 |
|
| 790 |
[<a id="ref-Sanfilippo1998b">Sanfilippo1998b</a>] |
| 791 |
Sanfilippo, S., "Subject: new tcp scan method", message |
| 792 |
to Bugtraq mailing list, 18 December 1998, |
| 793 |
<<a href="http://diswww.mit.edu/menelaus.mit.edu/bt/8736">http://diswww.mit.edu/menelaus.mit.edu/bt/8736</a>>. |
| 794 |
|
| 795 |
[<a id="ref-Sanfilippo1999">Sanfilippo1999</a>] |
| 796 |
Sanfilippo, S., "Subject: more about IP ID", message |
| 797 |
to Bugtraq mailing list, 20 November 1999, |
| 798 |
<<a href="http://diswww.mit.edu/menelaus.mit.edu/bt/12686">http://diswww.mit.edu/menelaus.mit.edu/bt/12686</a>>. |
| 799 |
|
| 800 |
[<a id="ref-SI6-IPv6">SI6-IPv6</a>] SI6 Networks, "SI6 Networks' IPv6 Toolkit", |
| 801 |
<<a href="http://www.si6networks.com/tools/ipv6toolkit">http://www.si6networks.com/tools/ipv6toolkit</a>>. |
| 802 |
|
| 803 |
[<a id="ref-Zalewski2003">Zalewski2003</a>] |
| 804 |
Zalewski, M., "Subject: A new TCP/IP blind data injection |
| 805 |
technique?", message to Bugtraq mailing list, 11 December |
| 806 |
2003, <<a href="http://lcamtuf.coredump.cx/ipfrag.txt">http://lcamtuf.coredump.cx/ipfrag.txt</a>>. |
| 807 |
|
| 808 |
|
| 809 |
|
| 810 |
|
| 811 |
|
| 812 |
|
| 813 |
|
| 814 |
|
| 815 |
|
| 816 |
|
| 817 |
|
| 818 |
|
| 819 |
|
| 820 |
|
| 821 |
|
| 822 |
|
| 823 |
|
| 824 |
|
| 825 |
|
| 826 |
|
| 827 |
|
| 828 |
|
| 829 |
|
| 830 |
|
| 831 |
|
| 832 |
|
| 833 |
|
| 834 |
|
| 835 |
|
| 836 |
<span class="grey">Gont Informational [Page 15]</span></pre> |
| 837 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-16" ></span> |
| 838 |
<span class="grey"><a href="./rfc7739">RFC 7739</a> Implications of Predictable Fragment IDs February 2016</span> |
| 839 |
|
| 840 |
|
| 841 |
<span class="h2"><a class="selflink" id="appendix-A" href="#appendix-A">Appendix A</a>. Information Leakage Produced by Vulnerable Implementations</span> |
| 842 |
|
| 843 |
<a href="#section-3">Section 3</a> provides a number of references describing a number of ways |
| 844 |
in which a vulnerable implementation may reveal the Identification |
| 845 |
values to be used in subsequent packets, thus opening the door to a |
| 846 |
number of attacks. In all of those scenarios, a vulnerable |
| 847 |
implementation leaks/reveals its own Identification number. |
| 848 |
|
| 849 |
This section presents a different attack scenario, in which a |
| 850 |
vulnerable implementation leaks/reveals the Identification number of |
| 851 |
a non-vulnerable implementation. That is, a vulnerable |
| 852 |
implementation (Host A) leaks the current Identification value in use |
| 853 |
by a third-party host (Host B) to send fragmented datagrams from Host |
| 854 |
B to Host A. |
| 855 |
|
| 856 |
NOTE: |
| 857 |
For the most part, this section is included to illustrate how a |
| 858 |
vulnerable implementation might be leveraged to leak out the |
| 859 |
Identification value of an otherwise non-vulnerable |
| 860 |
implementation. |
| 861 |
|
| 862 |
The following scenarios assume: |
| 863 |
|
| 864 |
Host A: |
| 865 |
An IPv6 host that implements the algorithm specified in |
| 866 |
<a href="#section-5.1">Section 5.1</a>, implements [<a href="./rfc5722" title=""Handling of Overlapping IPv6 Fragments"">RFC5722</a>], but does not implement |
| 867 |
[<a href="./rfc6946" title=""Processing of IPv6 "">RFC6946</a>]. |
| 868 |
|
| 869 |
Host B: |
| 870 |
Victim node. Selects the Identification values from a global |
| 871 |
counter. |
| 872 |
|
| 873 |
Host C: |
| 874 |
Attacker. Can forge the IPv6 Source Address of his packets at |
| 875 |
will. |
| 876 |
|
| 877 |
In the following scenarios, large ICMPv6 Echo Request packets are |
| 878 |
employed to "sample" the Identification value of a host. We note |
| 879 |
that while the figures show only one packet for the ICMPv6 Echo |
| 880 |
Request and the ICMPv6 Echo Reply packets, each of those packets will |
| 881 |
typically comprise two fragments, such that the corresponding |
| 882 |
unfragmented datagram is larger than the MTU of the networks to which |
| 883 |
Host B and Host C are attached. Additionally, the following |
| 884 |
scenarios assume that Host A employs a Fragment Header when sending |
| 885 |
traffic to Host B (typically the so-called "IPv6 atomic fragments" |
| 886 |
[<a href="./rfc6946" title=""Processing of IPv6 "">RFC6946</a>]): this behavior may be triggered by forged ICMPv6 PTB |
| 887 |
messages that advertise an MTU smaller than 1280 bytes (assuming the |
| 888 |
victim still generates atomic fragments [<a href="#ref-DEPGEN" title=""Generation of IPv6 Atomic Fragments Considered Harmful"">DEPGEN</a>]). |
| 889 |
|
| 890 |
|
| 891 |
|
| 892 |
<span class="grey">Gont Informational [Page 16]</span></pre> |
| 893 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-17" ></span> |
| 894 |
<span class="grey"><a href="./rfc7739">RFC 7739</a> Implications of Predictable Fragment IDs February 2016</span> |
| 895 |
|
| 896 |
|
| 897 |
In lines #1-#2 (and lines #7-#8), the attacker samples the current |
| 898 |
Identification value at Host B. In line #3, the attacker sends a |
| 899 |
forged TCP SYN segment to Host A. In line 4, the attacker sends a |
| 900 |
forged TCP segment to Host B as an incomplete IPv6 fragmented |
| 901 |
datagram (e.g., a single fragment with Fragment Offset=0, More |
| 902 |
fragments=1). If corresponding TCP port is closed, and the attacker |
| 903 |
fails when trying to produce a collision of Identification values |
| 904 |
(see line #4), the following packet exchange might take place: |
| 905 |
|
| 906 |
A B C |
| 907 |
|
| 908 |
#1 <------ Echo Req #1 ----------- |
| 909 |
#2 --- Echo Repl #1, FID=5000 ---> |
| 910 |
#3 <------------------- SYN #1, src= B ----------------------- |
| 911 |
#4 <--- SYN/ACK, FID=42 src=A ---- |
| 912 |
#5 ---- SYN/ACK, FID=9000 ---> |
| 913 |
#6 <----- RST, FID= 5001 ----- |
| 914 |
#7 <-------- Echo Req #2 --------- |
| 915 |
#8 --- Echo Repl #2, FID=5002 ---> |
| 916 |
|
| 917 |
The RST segment in line #6 is elicited by the SYN/ACK segment from |
| 918 |
line #5 (illegitimately elicited by the SYN segment from line #3). |
| 919 |
The packet from line #4, sent as an incomplete IPv6 datagram, |
| 920 |
eventually times out. |
| 921 |
|
| 922 |
On the other hand, if the attacker succeeds to produce a collision of |
| 923 |
Identification values, the following packet exchange could take |
| 924 |
place: |
| 925 |
|
| 926 |
A B C |
| 927 |
|
| 928 |
#1 <------- Echo Req #1 ---------- |
| 929 |
#2 --- Echo Repl #1, FID=5000 ---> |
| 930 |
#3 <------------------- SYN #1, src= B ----------------------- |
| 931 |
#4 <-- SYN/ACK, FID=9000 src=A --- |
| 932 |
#5 ---- SYN/ACK, FID=9000 ---> |
| 933 |
... (<a href="./rfc5722">RFC5722</a>) ... |
| 934 |
#6 <------- Echo Req #2 ---------- |
| 935 |
#7 ---- Echo Repl #2, FID=5001 --> |
| 936 |
|
| 937 |
Clearly, the Identification value sampled from the second ICMPv6 Echo |
| 938 |
Reply packet ("Echo Repl #2") implicitly indicates whether the |
| 939 |
Identification value in the forged SYN/ACK (see line #4 in both |
| 940 |
figures) was the current Identification value in use by Host A. |
| 941 |
|
| 942 |
As a result, the attacker could employ this technique to learn the |
| 943 |
current Identification value used by host A to send packets to host |
| 944 |
B, even when Host A itself has a non-vulnerable implementation. |
| 945 |
|
| 946 |
|
| 947 |
|
| 948 |
<span class="grey">Gont Informational [Page 17]</span></pre> |
| 949 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-18" ></span> |
| 950 |
<span class="grey"><a href="./rfc7739">RFC 7739</a> Implications of Predictable Fragment IDs February 2016</span> |
| 951 |
|
| 952 |
|
| 953 |
<span class="h2"><a class="selflink" id="appendix-B" href="#appendix-B">Appendix B</a>. Survey of Fragment Identification Selection Algorithms</span> |
| 954 |
Employed by Popular IPv6 Implementations |
| 955 |
|
| 956 |
This section includes a survey of the Identification selection |
| 957 |
algorithms employed by some popular operating systems. |
| 958 |
|
| 959 |
NOTE: |
| 960 |
The survey was produced with the SI6 Networks' IPv6 toolkit |
| 961 |
[<a href="#ref-SI6-IPv6" title=""SI6 Networks' IPv6 Toolkit"">SI6-IPv6</a>]. |
| 962 |
|
| 963 |
+------------------------------+------------------------------------+ |
| 964 |
| Operating System | Algorithm | |
| 965 |
+------------------------------+------------------------------------+ |
| 966 |
| Cisco IOS 15.3 | Predictable (Global Counter, | |
| 967 |
| | Init=0, Incr=1) | |
| 968 |
+------------------------------+------------------------------------+ |
| 969 |
| FreeBSD 9.0 | Unpredictable (Random) | |
| 970 |
+------------------------------+------------------------------------+ |
| 971 |
| Linux 3.0.0-15 | Predictable (Global Counter, | |
| 972 |
| | Init=0, Incr=1) | |
| 973 |
+------------------------------+------------------------------------+ |
| 974 |
| Linux-current | Unpredictable (Per-dest Counter, | |
| 975 |
| | Init=random, Incr=1) | |
| 976 |
+------------------------------+------------------------------------+ |
| 977 |
| NetBSD 5.1 | Unpredictable (Random) | |
| 978 |
+------------------------------+------------------------------------+ |
| 979 |
| OpenBSD-current | Unpredictable (Random, SKIP32) | |
| 980 |
+------------------------------+------------------------------------+ |
| 981 |
| Solaris 10 | Predictable (Per-dst Counter, | |
| 982 |
| | Init=0, Incr=1) | |
| 983 |
+------------------------------+------------------------------------+ |
| 984 |
| Windows XP SP2 | Predictable (Global Counter, | |
| 985 |
| | Init=0, Incr=2) | |
| 986 |
+------------------------------+------------------------------------+ |
| 987 |
| Windows XP Professional | Predictable (Global Counter, | |
| 988 |
| 32bit, SP3 | Init=0, Incr=2) | |
| 989 |
+------------------------------+------------------------------------+ |
| 990 |
| Windows Vista (Build 6000) | Predictable (Global Counter, | |
| 991 |
| | Init=0, Incr=2) | |
| 992 |
+------------------------------+------------------------------------+ |
| 993 |
| Windows Vista Business | Predictable (Global Counter, | |
| 994 |
| 64bit, SP1 | Init=0, Incr=2) | |
| 995 |
+------------------------------+------------------------------------+ |
| 996 |
| Windows 7 Home Premium | Predictable (Global Counter, | |
| 997 |
| | Init=0, Incr=2) | |
| 998 |
+------------------------------+------------------------------------+ |
| 999 |
| Windows Server 2003 R2 | Predictable (Global Counter, | |
| 1000 |
| Standard 64bit, SP2 | Init=0, Incr=2) | |
| 1001 |
|
| 1002 |
|
| 1003 |
|
| 1004 |
<span class="grey">Gont Informational [Page 18]</span></pre> |
| 1005 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-19" ></span> |
| 1006 |
<span class="grey"><a href="./rfc7739">RFC 7739</a> Implications of Predictable Fragment IDs February 2016</span> |
| 1007 |
|
| 1008 |
|
| 1009 |
+------------------------------+------------------------------------+ |
| 1010 |
| Windows Server 2008 Standard | Predictable (Global Counter, | |
| 1011 |
| 32bit, SP1 | Init=0, Incr=2) | |
| 1012 |
+------------------------------+------------------------------------+ |
| 1013 |
| Windows Server 2008 R2 | Predictable (Global Counter, | |
| 1014 |
| Standard 64bit, SP1 | Init=0, Incr=2) | |
| 1015 |
+------------------------------+------------------------------------+ |
| 1016 |
| Windows Server 2012 Standard | Predictable (Global Counter, | |
| 1017 |
| 64bit | Init=0, Incr=2) | |
| 1018 |
+------------------------------+------------------------------------+ |
| 1019 |
| Windows 7 Home Premium | Predictable (Global Counter, | |
| 1020 |
| 32bit, SP1 | Init=0, Incr=2) | |
| 1021 |
+------------------------------+------------------------------------+ |
| 1022 |
| Windows 7 Ultimate 32bit, | Predictable (Global Counter, | |
| 1023 |
| SP1 | Init=0, Incr=2) | |
| 1024 |
+------------------------------+------------------------------------+ |
| 1025 |
| Windows 8 Enterprise 32 bit | Unpredictable (Alg. from Section | |
| 1026 |
| | 5.3) | |
| 1027 |
+------------------------------+------------------------------------+ |
| 1028 |
|
| 1029 |
Table 1: Fragment Identification algorithms employed by different OSs |
| 1030 |
|
| 1031 |
NOTE: |
| 1032 |
In the text above, "predictable" should be taken as "easily |
| 1033 |
guessable by an off-path attacker, by sending a few probe |
| 1034 |
packets". |
| 1035 |
|
| 1036 |
|
| 1037 |
|
| 1038 |
|
| 1039 |
|
| 1040 |
|
| 1041 |
|
| 1042 |
|
| 1043 |
|
| 1044 |
|
| 1045 |
|
| 1046 |
|
| 1047 |
|
| 1048 |
|
| 1049 |
|
| 1050 |
|
| 1051 |
|
| 1052 |
|
| 1053 |
|
| 1054 |
|
| 1055 |
|
| 1056 |
|
| 1057 |
|
| 1058 |
|
| 1059 |
|
| 1060 |
<span class="grey">Gont Informational [Page 19]</span></pre> |
| 1061 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-20" ></span> |
| 1062 |
<span class="grey"><a href="./rfc7739">RFC 7739</a> Implications of Predictable Fragment IDs February 2016</span> |
| 1063 |
|
| 1064 |
|
| 1065 |
Acknowledgements |
| 1066 |
|
| 1067 |
The author would like to thank Ivan Arce for proposing the attack |
| 1068 |
scenario described in <a href="#appendix-A">Appendix A</a>. |
| 1069 |
|
| 1070 |
The author would like to thank Ivan Arce, Stephen Bensley, Ron |
| 1071 |
Bonica, Tassos Chatzithomaoglou, Guillermo Gont, Brian Haberman, Bob |
| 1072 |
Hinden, Sheng Jiang, Tatuya Jinmei, Merike Kaeo, Will Liu, Juan |
| 1073 |
Antonio Matos, Simon Perreault, Hosnieh Rafiee, Meral Shirazipour, |
| 1074 |
Mark Smith, Dave Thaler, and Klaas Wierenga, for providing valuable |
| 1075 |
comments on earlier draft versions of this document. |
| 1076 |
|
| 1077 |
This document is based on work performed by Fernando Gont on behalf |
| 1078 |
of the UK Centre for the Protection of National Infrastructure |
| 1079 |
(CPNI). |
| 1080 |
|
| 1081 |
The author would like to thank Buffy for her love and support. |
| 1082 |
|
| 1083 |
Author's Address |
| 1084 |
|
| 1085 |
Fernando Gont |
| 1086 |
Huawei Technologies |
| 1087 |
Evaristo Carriego 2644 |
| 1088 |
Haedo, Provincia de Buenos Aires 1706 |
| 1089 |
Argentina |
| 1090 |
|
| 1091 |
Phone: +54 11 4650 8472 |
| 1092 |
Email: [email protected] |
| 1093 |
URI: <a href="http://www.si6networks.com">http://www.si6networks.com</a> |
| 1094 |
|
| 1095 |
|
| 1096 |
|
| 1097 |
|
| 1098 |
|
| 1099 |
|
| 1100 |
|
| 1101 |
|
| 1102 |
|
| 1103 |
|
| 1104 |
|
| 1105 |
|
| 1106 |
|
| 1107 |
|
| 1108 |
|
| 1109 |
|
| 1110 |
|
| 1111 |
|
| 1112 |
|
| 1113 |
|
| 1114 |
|
| 1115 |
|
| 1116 |
Gont Informational [Page 20] |
| 1117 |
</pre> |