RFC 5991
Teredo Security Updates
1. Introduction โจ
Okay bestie, welcome to RFC 5991: Teredo Security Updates ๐ฆ Published in September 2010 as a Standards Track document, it was written by D. Thaler of Microsoft, S. Krishnan of Ericsson, and J. Hoagland of Symantec. It's an IETF product with ISSN 2070-1721, and it updates RFC 4380 (it doesn't obsolete anything, so no old versions are getting replaced here ๐ ). It also comes with its own Abstract, Status of This Memo, and Copyright Notice, which I'm keeping complete because they matter ๐
Abstract โจ
The Teredo protocol defines a set of flags that are embedded in every Teredo IPv6 address ๐ธ This document specifies a set of security updates that modify the use of this flags field, but are backward compatible ๐
Status of This Memo ๐
This is an Internet Standards Track document.
This document is a product of the Internet Engineering Task Force (IETF) ๐ It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 5741.
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/rfc5991.
Copyright Notice โญ
Copyright (c) 2010 IETF Trust and the persons identified as the document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
This document may contain material from IETF Documents or IETF Contributions published or made publicly available before November 10, 2008. The person(s) controlling the copyright in some of this material may not have granted the IETF Trust the right to allow modifications of such material outside the IETF Standards Process. Without obtaining an adequate license from the person(s) controlling the copyright in such materials, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside the IETF Standards Process, except to format it for publication as an RFC or to translate it into languages other than English.
Table of Contents ๐๏ธ
1. Introduction ....................................................2
2. Terminology .....................................................3
3. Specification ...................................................4
3.1. Random Address Flags .......................................4
3.2. Deprecation of Cone Bit ....................................6
4. Security Considerations .........................................7
5. Acknowledgments .................................................7
6. References ......................................................8
6.1. Normative References .......................................8
6.2. Informative References .....................................8
Appendix A. Implementation Status .................................9
Appendix B. Resistance to Address Prediction ......................9
1. Introduction ๐ฆ
Okay so, Teredo [RFC4380] defines a set of flags that are embedded in every Teredo IPv6 address ๐ This document specifies a set of security updates that modify the use of this flags field, but are backwards compatible. This document updates RFC 4380. Main character update, literally ๐
Here's the tea ๐ซ The Flags field in a Teredo IPv6 address has 13 unused bits out of a total of 16 bits. To guard against address-scanning risks [RFC5157] from malicious users, this update randomizes 12 of the 13 unused bits when configuring the Teredo IPv6 address ๐ฅ Even if an attacker were able to determine the external (mapped) IPv4 address and port assigned by a NAT to the Teredo client, the attacker would still need to attack a range of 4,096 IPv6 addresses to determine the actual Teredo IPv6 address of the client. Not easy, not easy ๐
Now the cone bit ๐ The cone bit in a Teredo IPv6 address indicates whether a peer needs to send Teredo control messages before communicating with a Teredo IPv6 address. Unfortunately, it may also have some value in terms of profiling to the extent that it reveals the security posture of the network ๐ฌ If the cone bit is set, an attacker may decide it is fruitful to port-scan the embedded external IPv4 address and others associated with the same organization, looking for open ports. So deprecating the cone bit prevents the a priori revelation of the security posture of the NAT ๐ก๏ธโจ
2. Terminology ๐
This document uses the following terminology, for consistency with [RFC4380]. Let's get into the vocab ๐
- Cone NAT: A NAT that maps all requests from the same internal IP address and port to the same external IP address and port. Furthermore, any external host can send a packet to the internal host by sending a packet to the mapped external address and port. Open door energy ๐ช๐ธ
- Indirect Bubble: A Teredo control message that is sent to another Teredo client via the destination's Teredo server, as specified in [RFC4380], Section 5.2.4. ๐ซง
- Local Address/Port: The IPv4 address and UDP port from which a Teredo client sends Teredo packets. The local port is referred to as the Teredo service port in [RFC4380]. The local address of a node may or may not be globally routable because the node can be located behind one or more NATs ๐
- Mapped Address/Port: A global IPv4 address and a UDP port that results from the translation of a node's own local address/port by one or more NATs. The node learns these values through the Teredo protocol specified in [RFC4380]. The mapped address/port can be different for every peer with which a node tries to communicate ๐ญ
- Network Address Translation (NAT): The process of converting between IP addresses used within an intranet or other private network and Internet IP addresses. The OG translator ๐ง
- Peer: A Teredo client with which another Teredo client needs to communicate. Your bestie in the network ๐ซถ
- Port-Preserving NAT: A NAT that translates a local address/port to a mapped address/port such that the mapped port has the same value as the local port, as long as that same mapped address/port has not already been used for a different local address/port. Keeping the port number the same, iconic ๐
- Public Address: An external global address used by a NAT. ๐
- Restricted NAT: A NAT where all requests from the same internal IP address and port are mapped to the same external IP address and port. Unlike the cone NAT, an external host can send packets to an internal host (by sending a packet to the external mapped address and port) only if the internal host has first sent a packet to the external host. It's giving "you gotta knock first" ๐ช๐
- Teredo Client: A node that implements the client parts of [RFC4380], has access to the IPv4 Internet, and wants to gain access to the IPv6 Internet. ๐ป
- Teredo IPv6 Address: An IPv6 address that starts with the prefix
2001:0000:/32and is formed as specified in Section 4 of [RFC4380]. The core identity of the whole thing ๐ - Teredo Server: A node that has a globally routable address on the IPv4 Internet, and is used as a helper to provide IPv6 connectivity to Teredo clients. The helper bestie ๐ฆธโโ๏ธ
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]. โจ
3. Specification ๐
3.1. Random Address Flags ๐ฒ
Teredo addresses are structured, and some of the fields contained in them are fairly predictable ๐ This makes the addresses themselves easier to predict and opens up a vulnerability. Yikes ๐ญ
Here's how the fields break down:
- Teredo prefix: This field is 32 bits and has a single IANA-assigned value.
- Server: This field is 32 bits and is set to the server in use. The server to use is generally statically configured on the client. This means that overall entropy of the server field will be low, i.e., that the server will not be hard to predict. Attackers could confine their guessing to the most popular server IP addresses. Predictable, sus ๐
- Flags: The Flags field is 16 bits in length, but [RFC4380] provides for only one of these bits (the cone bit) to vary.
- Client port: This 16-bit field corresponds to the external port number assigned to the client's Teredo service port. Thus, the value of this field depends on two factors (the chosen Teredo service port and the NAT port assignment behavior), and it therefore is harder to predict the entropy this field will have. If clients tend to use a predictable port number and NATs are often port-preserving, then the port number can be rather predictable ๐ข
- Client IPv4 address: This 32-bit field corresponds to the external IPv4 address the NAT has assigned for the client port. In principle, this can be any address in the assigned part of the IPv4 unicast address space. However, if an attacker is looking for the address of a specific Teredo client, they will have to have the external IPv4 address pretty well narrowed down. Certain IPv4 address ranges could also become well known for having a higher concentration of Teredo clients, making it easier to find an arbitrary Teredo client. These addresses could correspond to large organizations that allow Teredo, such as a university or enterprise, or to Internet Service Providers that only provide their customers with RFC 1918 addresses. ๐ซ
Optimizations in scanning can also reduce the number of addresses that need to be checked ๐ For example, for addresses behind a cone NAT, it would likely be easy to probe if a specific port number is open on an IPv4 address, prior to trying to form a Teredo address for that address and port.
Hence, the Flags field specified in [RFC4380], Section 4 is updated as follows ๐
1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|C|z|Random1|U|G| Random2 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- C: This flag is specified in [RFC4380], and its use is modified in Section 3.2 below.
- z: This flag is reserved. It MUST be set to zero when the address is constructed, as specified in [RFC4380].
- Random1: MUST be set to a random value.
- U: This flag is specified in [RFC4380].
- G: This flag is specified in [RFC4380].
- Random2: MUST be set to a random value.
๐ That's the first half, bestie. Section 3.2 and everything after it is coming up in part 2 ๐
3.2. Deprecation of Cone Bit ๐
okay so the qualification procedure lives in [RFC4380], Section 5.2.1, and we're tweaking it a bit ๐ Teredo clients SHOULD completely skip the first phase and only do the second phase, where they use the Teredo link-local address with the cone bit set to zero ๐ฆ once you do that, you literally can't tell cone and restricted NATs apart anymore ๐ญ but Teredo still works, periodt โจ the tradeoff is that peers have to skip case 4 of the sending details in [RFC4380], Section 5.2.4, so the same number of indirect bubbles gets sent as if the other end were behind a restricted NAT. the peer behind a cone NAT doesn't even need those bubbles, but it still replies to them just like it would to any other indirect bubble ๐ skipping case 4 is already allowed for reliability reasons (also in [RFC4380], Section 5.2.4), so interop is totally fine ๐ซถ skipping phase one just forces everyone into that behavior, which is less efficient but potentially more reliable ๐ธ
also, clients and relays SHOULD ignore the cone bit in the address of a Teredo peer and treat it as if it were always clear, as specified in [RFC4380], Section 5.2.4 (last paragraph) ๐
BUT Teredo servers MUST NOT ignore the cone bit, and here's why ๐
- The cone bit in the IPv6 source address of a Router Solicitation (RS) from a client decides which IPv4 source address the server uses when it sends a Router Advertisement (RA). If this behavior isn't preserved, legacy clients will conclude they're behind a cone NAT even when they aren't, because the client will receive the RA where it previously wouldn't (a cone bit set to 1 requires the server to respond from another IP address). They'll then set their cone bit and lose connectivity ๐
- When the Teredo server sends RAs (or bubbles, if it's also a relay), the cone bit in its own Teredo address is set, which signals that it doesn't require bubbles to reach it โจ
4. Security Considerations ๐ฅ
the basic threat model for Teredo is described in detail in [RFC4380], Section 7, but the short version is that a Teredo client should be as secure as if a host were directly attached to an untrusted Internet link ๐ก๏ธ this document specifies updates to [RFC4380] that improve the security of the base Teredo mechanism against specific threats.
IPv6 address scanning [RFC5157] by off-path attackers: the Teredo IPv6 Address format defined in [RFC4380], Section 4 makes it pretty easy for a malicious user to run an address scan and figure out IPv6 addresses by guessing the external (mapped) IPv4 address and port assigned to the Teredo client ๐ฌ the random address bits save the day here by giving you a range of 4,096 IPv6 addresses per external IPv4 address/port. so even if an attacker managed to find the external (mapped) IPv4 address and port assigned to the Teredo client, they'd still have to attack a range of 4,096 IPv6 addresses to find the actual Teredo IPv6 address of the client ๐ Appendix B compares the address prediction resistance of a Teredo address following this specification to that of an address formed using standard IPv6 stateless address autoconfiguration [RFC4862].
to stop adversaries from easily guessing the values of the random bits (and therefore the address), the Random1 and Random2 bits in the Teredo Flags field MUST be constructed following the recommendations for random number generation specified in [NIST-RANDOM] and [RFC4086] ๐ฒ
Opening a hole in an enterprise firewall [TUNNEL-SEC]: Teredo is NOT RECOMMENDED as a solution for networks that want strict controls over what traffic goes to and from the Internet ๐ซ administrators of those networks may want to filter all Teredo traffic at their network boundaries ๐งฑ
5. Acknowledgments ๐
the authors would like to thank Remi Denis-Courmont, Fred Templin, Jordi Palet Martinez, James Woodyatt, Christian Huitema, Tom Yu, Jari Arkko, David Black, Tim Polk, and Sean Turner for reviewing earlier versions of this document and sharing comments that made it better ๐ซถ the authors would also like to thank Alfred Hoenes for a careful review of this document ๐
6. References ๐
6.1. Normative References
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC4380] Huitema, C., "Teredo: Tunneling IPv6 over UDP through
Network Address Translations (NATs)", RFC 4380,
February 2006.
6.2. Informative References
[NIST-RANDOM] "NIST SP 800-90, Recommendation for Random Number
Generation Using Deterministic Random Bit Generators",
March 2007, <http://csrc.nist.gov/publications/
nistpubs/800-90/SP800-90revised_March2007.pdf>.
[RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker,
"Randomness Requirements for Security", BCP 106,
RFC 4086, June 2005.
[RFC4862] Thomson, S., Narten, T., and T. Jinmei, "IPv6
Stateless Address Autoconfiguration", RFC 4862,
September 2007.
[RFC5157] Chown, T., "IPv6 Implications for Network Scanning",
RFC 5157, March 2008.
[TUNNEL-SEC] Hoagland, J., Krishnan, S., and D. Thaler, "Security
Concerns With IP Tunneling", Work in Progress, March
2010.
Appendix A. Implementation Status ๐งฉ
deprecation of the cone bit, as specified in this document, is implemented in Windows Vista and Windows Server 2008 โจ
the random flags specified in this document are implemented in Windows Vista SP1 and Windows Server 2008 ๐
all Windows implementations automatically disable Teredo if they detect that they're on a managed network with a domain controller ๐ โโ๏ธ
Appendix B. Resistance to Address Prediction ๐ฎ
this section compares the address prediction resistance of a Teredo address with an address formed using IPv6 stateless address autoconfiguration (SLAAC) [RFC4862] ๐
let's assume the attacker knows a Teredo client's external IPv4 address and the vendor of the client's Ethernet card ๐ง since they already know the external IPv4 address, they don't have to search that space. the attacker doesn't know the external port (16 bits) or the value of the random bits (12 bits), so they have to search that space. that gives them a total search space of 28 bits (16+12) ๐น this compares very favorably with the 24 bits of search space required to find an address configured using SLAAC (when the Ethernet card's vendor is known), as described in Section 2.3 of [RFC5157] ๐ without the 12 random bits, the search space is limited to only 16 bits, which is significantly worse than the 24 bits SLAAC provides ๐ฌ
as the attacker's knowledge decreases, the number of bits of search space in both cases is likely to increase in a relatively similar fashion. the predictability of Teredo addresses stays comparable to SLAAC addresses with the added 12 bits of search space, but it gets significantly worse without the random bits ๐ธ
Authors' Addresses ๐๏ธ
Dave Thaler
Microsoft Corporation
One Microsoft Way
Redmond, WA 98052
USA
Phone: +1 425 703 8835
EMail: dthaler@microsoft.com
Suresh Krishnan
Ericsson
8400 Decarie Blvd.
Town of Mount Royal, QC
Canada
Phone: +1 514 345 7900 x42871
EMail: suresh.krishnan@ericsson.com
James Hoagland
Symantec Corporation
350 Ellis St.
Mountain View, CA 94043
USA
EMail: Jim_Hoagland@symantec.com
URI: http://symantec.com/
๐ฆ where this page comes from
- ietf: rfc5991 2010-09
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms