idnits 2.17.1 draft-ietf-rtcweb-ip-handling-11.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 1 instance of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. == There are 1 instance of lines with private range IPv4 addresses in the document. If these are generic example addresses, they should be changed to use any of the ranges defined in RFC 6890 (or successor): 192.0.2.x, 198.51.100.x or 203.0.113.x. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (November 2, 2018) is 1994 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Obsolete informational reference (is this intentional?): RFC 4941 (Obsoleted by RFC 8981) -- Obsolete informational reference (is this intentional?): RFC 5389 (Obsoleted by RFC 8489) -- Obsolete informational reference (is this intentional?): RFC 5766 (Obsoleted by RFC 8656) -- Obsolete informational reference (is this intentional?): RFC 7230 (Obsoleted by RFC 9110, RFC 9112) Summary: 0 errors (**), 0 flaws (~~), 3 warnings (==), 6 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group J. Uberti 3 Internet-Draft Google 4 Intended status: Standards Track November 2, 2018 5 Expires: May 6, 2019 7 WebRTC IP Address Handling Requirements 8 draft-ietf-rtcweb-ip-handling-11 10 Abstract 12 This document provides information and requirements for how IP 13 addresses should be handled by WebRTC implementations. 15 Status of This Memo 17 This Internet-Draft is submitted in full conformance with the 18 provisions of BCP 78 and BCP 79. 20 Internet-Drafts are working documents of the Internet Engineering 21 Task Force (IETF). Note that other groups may also distribute 22 working documents as Internet-Drafts. The list of current Internet- 23 Drafts is at https://datatracker.ietf.org/drafts/current/. 25 Internet-Drafts are draft documents valid for a maximum of six months 26 and may be updated, replaced, or obsoleted by other documents at any 27 time. It is inappropriate to use Internet-Drafts as reference 28 material or to cite them other than as "work in progress." 30 This Internet-Draft will expire on May 6, 2019. 32 Copyright Notice 34 Copyright (c) 2018 IETF Trust and the persons identified as the 35 document authors. All rights reserved. 37 This document is subject to BCP 78 and the IETF Trust's Legal 38 Provisions Relating to IETF Documents 39 (https://trustee.ietf.org/license-info) in effect on the date of 40 publication of this document. Please review these documents 41 carefully, as they describe your rights and restrictions with respect 42 to this document. Code Components extracted from this document must 43 include Simplified BSD License text as described in Section 4.e of 44 the Trust Legal Provisions and are provided without warranty as 45 described in the Simplified BSD License. 47 Table of Contents 49 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 50 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 2 51 3. Problem Statement . . . . . . . . . . . . . . . . . . . . . . 2 52 4. Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 53 5. Detailed Design . . . . . . . . . . . . . . . . . . . . . . . 4 54 5.1. Principles . . . . . . . . . . . . . . . . . . . . . . . 5 55 5.2. Modes and Recommendations . . . . . . . . . . . . . . . . 5 56 6. Implementation Guidance . . . . . . . . . . . . . . . . . . . 7 57 6.1. Ensuring Normal Routing . . . . . . . . . . . . . . . . . 7 58 6.2. Determining Host Candidates . . . . . . . . . . . . . . . 7 59 7. Application Guidance . . . . . . . . . . . . . . . . . . . . 8 60 8. Security Considerations . . . . . . . . . . . . . . . . . . . 8 61 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 8 62 10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 8 63 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 8 64 11.1. Normative References . . . . . . . . . . . . . . . . . . 8 65 11.2. Informative References . . . . . . . . . . . . . . . . . 9 66 Appendix A. Change log . . . . . . . . . . . . . . . . . . . . . 10 67 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 12 69 1. Introduction 71 One of WebRTC's key features is its support of peer-to-peer 72 connections. However, when establishing such a connection, which 73 involves connection attempts from various IP addresses, WebRTC may 74 allow a web application to learn additional information about the 75 user compared to an application that only uses the Hypertext Transfer 76 Protocol (HTTP) [RFC7230]. This may be problematic in certain cases. 77 This document summarizes the concerns, and makes recommendations on 78 how WebRTC implementations should best handle the tradeoff between 79 privacy and media performance. 81 2. Terminology 83 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 84 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 85 "OPTIONAL" in this document are to be interpreted as described in BCP 86 14 [RFC2119] [RFC8174] when, and only when, they appear in all 87 capitals, as shown here. 89 3. Problem Statement 91 In order to establish a peer-to-peer connection, WebRTC 92 implementations use Interactive Connectivity Establishment (ICE) 93 [RFC8445], which attempts to discover multiple IP addresses using 94 techniques such as Session Traversal Utilities for NAT (STUN) 96 [RFC5389] and Traversal Using Relays around NAT (TURN) [RFC5766], and 97 then checks the connectivity of each local-address-remote-address 98 pair in order to select the best one. The addresses that are 99 collected usually consist of an endpoint's private physical/virtual 100 addresses and its public Internet addresses. 102 These addresses are exposed upwards to the web application, so that 103 they can be communicated to the remote endpoint for its checks. This 104 allows the application to learn more about the local network 105 configuration than it would from a typical HTTP scenario, in which 106 the web server would only see a single public Internet address, i.e., 107 the address from which the HTTP request was sent. 109 The information revealed falls into three categories: 111 1. If the client is multihomed, additional public IP addresses for 112 the client can be learned. In particular, if the client tries to 113 hide its physical location through a Virtual Private Network 114 (VPN), and the VPN and local OS support routing over multiple 115 interfaces (a "split-tunnel" VPN), WebRTC will discover not only 116 the public address for the VPN, but also the ISP public address 117 over which the VPN is running. 119 2. If the client is behind a Network Address Translator (NAT), the 120 client's private IP addresses, often [RFC1918] addresses, can be 121 learned. 123 3. If the client is behind a proxy (a client-configured "classical 124 application proxy", as defined in [RFC1919], Section 3), but 125 direct access to the Internet is permitted, WebRTC's STUN checks 126 will bypass the proxy and reveal the public IP address of the 127 client. This concern also applies to the "enterprise TURN 128 server" scenario described in [RFC7478], Section 2.3.5.1, if, as 129 above, direct Internet access is permitted. However, when the 130 term "proxy" is used in this document, it is always in reference 131 to an [RFC1919] proxy server. 133 Of these three concerns, #1 is the most significant, because for some 134 users, the purpose of using a VPN is for anonymity. However, 135 different VPN users will have different needs, and some VPN users 136 (e.g., corporate VPN users) may in fact prefer WebRTC to send media 137 traffic directly, i.e., not through the VPN. 139 #2 is a less significant but valid concern. While the [RFC4941] IPv6 140 addresses recommended by [I-D.ietf-rtcweb-transports] are fairly 141 benign due to their intentionally short lifetimes, IPv4 addresses 142 present some challenges. Although they typically contain minimal 143 entropy (e.g., 192.168.0.2, a fairly common address), in the worst 144 case, they can contain 24 bits of entropy with an indefinite 145 lifetime. As such, they can be a fairly significant fingerprinting 146 surface. In addition, intranet web sites can be attacked more easily 147 when their IPv4 address range is externally known. 149 Private local IP addresses can also act as an identifier that allows 150 web applications running in isolated browsing contexts (e.g., normal 151 and private browsing) to learn that they are running on the same 152 device. This could allow the application sessions to be correlated, 153 defeating some of the privacy protections provided by isolation. It 154 should be noted that local addresses are just one potential mechanism 155 for this correlation and this is an area for further study. 157 #3 is the least common concern, as proxy administrators can already 158 control this behavior through organizational firewall policy, and 159 generally, forcing WebRTC traffic through a proxy server will have 160 negative effects on both the proxy and on media quality. 162 Note also that these concerns predate WebRTC; Adobe Flash Player has 163 provided similar functionality since the introduction of RTMFP 164 [RFC7016] in 2008. 166 4. Goals 168 WebRTC's support of secure peer-to-peer connections facilitates 169 deployment of decentralized systems, which can have privacy benefits. 170 As a result, we want to avoid blunt solutions that disable WebRTC or 171 make it significantly harder to use. This document takes a more 172 nuanced approach, with the following goals: 174 o Provide a framework for understanding the problem so that controls 175 might be provided to make different tradeoffs regarding 176 performance and privacy concerns with WebRTC. 178 o Using that framework, define settings that enable peer-to-peer 179 communications, each with a different balance between performance 180 and privacy. 182 o Finally, provide recommendations for default settings that provide 183 reasonable performance without also exposing addressing 184 information in a way that might violate user expectations. 186 5. Detailed Design 187 5.1. Principles 189 The key principles for our framework are stated below: 191 1. By default, WebRTC traffic should follow typical IP routing, 192 i.e., WebRTC should use the same interface used for HTTP traffic, 193 and only the system's 'typical' public addresses (or those of an 194 enterprise TURN server, if present) should be visible to the 195 application. However, in the interest of optimal media quality, 196 it should be possible to enable WebRTC to make use of all network 197 interfaces to determine the ideal route. 199 2. By default, WebRTC should be able to negotiate direct peer-to- 200 peer connections between endpoints (i.e., without traversing a 201 NAT or relay server). This ensures that applications that need 202 true peer-to-peer routing for bandwidth or latency reasons can 203 operate successfully. 205 3. It should be possible to configure WebRTC to not disclose private 206 local IP addresses, to avoid the issues associated with web 207 applications learning such addresses. This document does not 208 require this to be the default state, as there is no currently 209 defined mechanism that can satisfy this requirement as well as 210 the aforementioned requirement to allow direct peer-to-peer 211 connections. 213 4. By default, WebRTC traffic should not be sent through proxy 214 servers, due to the media quality problems associated with 215 sending WebRTC traffic over TCP, which is almost always used when 216 communicating with such proxies, as well as proxy performance 217 issues that may result from proxying WebRTC's long-lived, high- 218 bandwidth connections. However, it should be possible to force 219 WebRTC to send its traffic through a configured proxy if desired. 221 5.2. Modes and Recommendations 223 Based on these ideas, we define four specific modes of WebRTC 224 behavior, reflecting different media quality/privacy tradeoffs: 226 Mode 1: Enumerate all addresses: WebRTC MUST use all network 227 interfaces to attempt communication with STUN servers, TURN 228 servers, or peers. This will converge on the best media 229 path, and is ideal when media performance is the highest 230 priority, but it discloses the most information. 232 Mode 2: Default route + associated local addresses: WebRTC MUST 233 follow the kernel routing table rules, which will typically 234 cause media packets to take the same route as the 235 application's HTTP traffic. If an enterprise TURN server is 236 present, the preferred route MUST be through this TURN 237 server. Once an interface has been chosen, the private IPv4 238 and IPv6 addresses associated with this interface MUST be 239 discovered and provided to the application. This ensures 240 that direct connections can still be established in this 241 mode. 243 Mode 3: Default route only: This is the the same as Mode 2, except 244 that the associated private addresses MUST NOT be provided; 245 the only IP addresses gathered are those discovered via 246 mechanisms like STUN and TURN (on the default route). This 247 may cause traffic to hairpin through a NAT, fall back to an 248 application TURN server, or fail altogether, with resulting 249 quality implications. 251 Mode 4: Force proxy: This is the same as Mode 3, but when the 252 application's HTTP traffic is sent through a proxy, WebRTC 253 media traffic MUST also be proxied. If the proxy does not 254 support UDP (as is the case for all HTTP and most SOCKS 255 [RFC1928] proxies), or the WebRTC implementation does not 256 support UDP proxying, the use of UDP will be disabled, and 257 TCP will be used to send and receive media through the 258 proxy. Use of TCP will result in reduced media quality, in 259 addition to any performance considerations associated with 260 sending all WebRTC media through the proxy server. 262 Mode 1 MUST only be used when user consent has been provided. The 263 details of this consent are left to the implementation; one potential 264 mechanism is to tie this consent to getUserMedia consent. 265 Alternatively, implementations can provide a specific mechanism to 266 obtain user consent. 268 In cases where user consent has not been obtained, Mode 2 SHOULD be 269 used. 271 These defaults provide a reasonable tradeoff that permits trusted 272 WebRTC applications to achieve optimal network performance, but gives 273 applications without consent (e.g., 1-way streaming or data channel 274 applications) only the minimum information needed to achieve direct 275 connections, as defined in Mode 2. However, implementations MAY 276 choose stricter modes if desired, e.g., if a user indicates they want 277 all WebRTC traffic to follow the default route. 279 Future documents may define additional modes and/or update the 280 recommended default modes. 282 Note that the suggested defaults can still be used even for 283 organizations that want all external WebRTC traffic to traverse a 284 proxy or enterprise TURN server, simply by setting an organizational 285 firewall policy that allows WebRTC traffic to only leave through the 286 proxy or TURN server. This provides a way to ensure the proxy or 287 TURN server is used for any external traffic, but still allows direct 288 connections (and, in the proxy case, avoids the performance issues 289 associated with forcing media through said proxy) for intra- 290 organization traffic. 292 6. Implementation Guidance 294 This section provides guidance to WebRTC implementations on how to 295 implement the policies described above. 297 6.1. Ensuring Normal Routing 299 When trying to follow typical IP routing, the simplest approach is to 300 bind the sockets used for peer-to-peer connections to the wildcard 301 addresses (0.0.0.0 for IPv4, :: for IPv6), which allows the OS to 302 route WebRTC traffic the same way as it would HTTP traffic. STUN and 303 TURN will work as usual, and host candidates can still be determined 304 as mentioned below. 306 6.2. Determining Host Candidates 308 When binding to a wildcard address, some extra work is needed to 309 determine a suitable host candidate, which we define as the source 310 address that would be used for any packets sent to the web 311 application host (assuming that UDP and TCP get the same routing). 312 Use of the web application host as a destination ensures the right 313 source address is selected, regardless of where the application 314 resides (e.g., on an intranet). 316 First, the appropriate remote IPv4/IPv6 address is obtained by 317 resolving the host component of the web application URI [RFC3986]. 318 If the client is behind a proxy and cannot resolve these IPs via DNS, 319 the address of the proxy can be used instead. Or, if the web 320 application was loaded from a file:// URI [RFC8089], rather than over 321 the network, the implementation can fall back to a well-known DNS 322 name or IP address. 324 Once a suitable remote IP has been determined, the implementation can 325 create a UDP socket, bind it to the appropriate wildcard address, and 326 tell it to connect to the remote IP. Generally, this results in the 327 socket being assigned a local address based on the kernel routing 328 table, without sending any packets over the network. 330 Finally, the socket can be queried using getsockname() or the 331 equivalent to determine the appropriate host candidate. 333 7. Application Guidance 335 The recommendations mentioned in this document may cause certain 336 WebRTC applications to malfunction. In order to be robust in all 337 scenarios, the following guidelines are provided for applications: 339 o Applications SHOULD deploy a TURN server with support for both UDP 340 and TCP connections to the server. This ensures that connectivity 341 can still be established, even when Mode 3 or 4 are in use, 342 assuming the TURN server can be reached. 344 o Applications SHOULD detect when they don't have access to the full 345 set of ICE candidates by checking for the presence of host 346 candidates. If no host candidates are present, Mode 3 or 4 above 347 is in use; this knowledge can be useful for diagnostic purposes. 349 8. Security Considerations 351 This document is entirely devoted to security considerations. 353 9. IANA Considerations 355 This document requires no actions from IANA. 357 10. Acknowledgements 359 Several people provided input into this document, including Bernard 360 Aboba, Harald Alvestrand, Youenn Fablet, Ted Hardie, Matthew 361 Kaufmann, Eric Rescorla, Adam Roach, and Martin Thomson. 363 11. References 365 11.1. Normative References 367 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 368 Requirement Levels", BCP 14, RFC 2119, 369 DOI 10.17487/RFC2119, March 1997, 370 . 372 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 373 Resource Identifier (URI): Generic Syntax", STD 66, 374 RFC 3986, DOI 10.17487/RFC3986, January 2005, 375 . 377 [RFC8089] Kerwin, M., "The "file" URI Scheme", RFC 8089, 378 DOI 10.17487/RFC8089, February 2017, 379 . 381 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 382 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 383 May 2017, . 385 [RFC8445] Keranen, A., Holmberg, C., and J. Rosenberg, "Interactive 386 Connectivity Establishment (ICE): A Protocol for Network 387 Address Translator (NAT) Traversal", RFC 8445, 388 DOI 10.17487/RFC8445, July 2018, 389 . 391 11.2. Informative References 393 [I-D.ietf-rtcweb-transports] 394 Alvestrand, H., "Transports for WebRTC", draft-ietf- 395 rtcweb-transports-17 (work in progress), October 2016. 397 [RFC1918] Rekhter, Y., Moskowitz, B., Karrenberg, D., de Groot, G., 398 and E. Lear, "Address Allocation for Private Internets", 399 BCP 5, RFC 1918, DOI 10.17487/RFC1918, February 1996, 400 . 402 [RFC1919] Chatel, M., "Classical versus Transparent IP Proxies", 403 RFC 1919, DOI 10.17487/RFC1919, March 1996, 404 . 406 [RFC1928] Leech, M., Ganis, M., Lee, Y., Kuris, R., Koblas, D., and 407 L. Jones, "SOCKS Protocol Version 5", RFC 1928, 408 DOI 10.17487/RFC1928, March 1996, 409 . 411 [RFC4941] Narten, T., Draves, R., and S. Krishnan, "Privacy 412 Extensions for Stateless Address Autoconfiguration in 413 IPv6", RFC 4941, DOI 10.17487/RFC4941, September 2007, 414 . 416 [RFC5389] Rosenberg, J., Mahy, R., Matthews, P., and D. Wing, 417 "Session Traversal Utilities for NAT (STUN)", RFC 5389, 418 DOI 10.17487/RFC5389, October 2008, 419 . 421 [RFC5766] Mahy, R., Matthews, P., and J. Rosenberg, "Traversal Using 422 Relays around NAT (TURN): Relay Extensions to Session 423 Traversal Utilities for NAT (STUN)", RFC 5766, 424 DOI 10.17487/RFC5766, April 2010, 425 . 427 [RFC7016] Thornburgh, M., "Adobe's Secure Real-Time Media Flow 428 Protocol", RFC 7016, DOI 10.17487/RFC7016, November 2013, 429 . 431 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 432 Protocol (HTTP/1.1): Message Syntax and Routing", 433 RFC 7230, DOI 10.17487/RFC7230, June 2014, 434 . 436 [RFC7478] Holmberg, C., Hakansson, S., and G. Eriksson, "Web Real- 437 Time Communication Use Cases and Requirements", RFC 7478, 438 DOI 10.17487/RFC7478, March 2015, 439 . 441 Appendix A. Change log 443 Changes in draft -11: 445 o Editorial updates from AD review. 447 Changes in draft -10: 449 o Incorporate feedback from IETF 102 on the problem space. 451 o Note that future versions of the document may define new modes. 453 Changes in draft -09: 455 o Fixed confusing text regarding enterprise TURN servers. 457 Changes in draft -08: 459 o Discuss how enterprise TURN servers should be handled. 461 Changes in draft -07: 463 o Clarify consent guidance. 465 Changes in draft -06: 467 o Clarify recommendations. 469 o Split implementation guidance into two sections. 471 Changes in draft -05: 473 o Separated framework definition from implementation techniques. 475 o Removed RETURN references. 477 o Use origin when determining local IPs, rather than a well-known 478 IP. 480 Changes in draft -04: 482 o Rewording and cleanup in abstract, intro, and problem statement. 484 o Added 2119 boilerplate. 486 o Fixed weird reference spacing. 488 o Expanded acronyms on first use. 490 o Removed 8.8.8.8 mention. 492 o Removed mention of future browser considerations. 494 Changes in draft -03: 496 o Clarified when to use which modes. 498 o Added 2119 qualifiers to make normative statements. 500 o Defined 'proxy'. 502 o Mentioned split tunnels in problem statement. 504 Changes in draft -02: 506 o Recommendations -> Requirements 508 o Updated text regarding consent. 510 Changes in draft -01: 512 o Incorporated feedback from Adam Roach; changes to discussion of 513 cam/mic permission, as well as use of proxies, and various 514 editorial changes. 516 o Added several more references. 518 Changes in draft -00: 520 o Published as WG draft. 522 Author's Address 524 Justin Uberti 525 Google 526 747 6th St S 527 Kirkland, WA 98033 528 USA 530 Email: justin@uberti.name