Network Working Group | J. Uberti |
Internet-Draft | |
Intended status: Standards Track | G. Shieh |
Expires: August 15, 2018 | |
February 11, 2018 |
WebRTC IP Address Handling Requirements
draft-ietf-rtcweb-ip-handling-05
This document provides information and requirements for how IP addresses should be handled by WebRTC implementations.
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."
This Internet-Draft will expire on August 15, 2018.
Copyright (c) 2018 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 (https://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.
One of WebRTC's key features is its support of peer-to-peer connections. However, when establishing such a connection, which involves connection attempts from various IP addresses, WebRTC may allow a web application to learn additional information about the user compared to an application that only uses the Hypertext Transfer Protocol (HTTP) [RFC7230]. This may be problematic in certain cases. This document summarizes the concerns, and makes recommendations on how WebRTC implementations should best handle the tradeoff between privacy and media performance.
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 [RFC2119].
In order to establish a peer-to-peer connection, WebRTC implementations use Interactive Connectivity Establishment (ICE) [RFC5245], which attempts to discover multiple IP addresses using techniques such as Session Traversal Utilities for NAT (STUN) [RFC5389] and Traversal Using Relays around NAT (TURN) [RFC5766], and then checks the connectivity of each local-address-remote-address pair in order to select the best one. The addresses that are collected usually consist of an endpoint's private physical/virtual addresses and its public Internet addresses.
These addresses are exposed upwards to the web application, so that they can be communicated to the remote endpoint for its checks. This allows the application to learn more about the local network configuration than it would from a typical HTTP scenario, in which the web server would only see a single public Internet address, i.e., the address from which the HTTP request was sent.
The information revealed falls into three categories:
Of these three concerns, #1 is the most significant, because for some users, the purpose of using a VPN is for anonymity. However, different VPN users will have different needs, and some VPN users (e.g., corporate VPN users) may in fact prefer WebRTC to send media traffic directly, i.e., not through the VPN.
#2 is considered to be a less significant concern, given that the local address values often contain minimal information (e.g., 192.168.0.2), or have built-in privacy protection (e.g., the [RFC4941] IPv6 addresses recommended by [I-D.ietf-rtcweb-transports]).
#3 is the least common concern, as proxy administrators can already control this behavior through organizational firewall policy, and generally, forcing WebRTC traffic through a proxy server will have negative effects on both the proxy and on media quality.
Note also that these concerns predate WebRTC; Adobe Flash Player has provided similar functionality since the introduction of RTMFP [RFC7016] in 2008.
WebRTC's support of secure peer-to-peer connections facilitates deployment of decentralized systems, which can have privacy benefits. As a result, we want to avoid blunt solutions that disable WebRTC or make it significantly harder to use. This document takes a more nuanced approach, with the following goals:
The key principles for our framework are stated below:
Based on these ideas, we define four specific modes of WebRTC behavior, reflecting different media quality/privacy tradeoffs:
The recommended defaults are as follows:
Mode 1 MUST only be used when user consent has been provided; this allows trusted WebRTC applications to achieve optimal network performance, but significanly limites the network information exposed to arbitrary web pages. The details of this consent are left to the implementation; one potential mechanism is to tie this consent to getUserMedia consent.
In cases where user consent has not been obtained, Mode 2 SHOULD be used. This allows applications to still achieve direct connections in many cases, even without consent (e.g., streaming or data channel applications). However, implementations MAY choose a stricter default policy in certain circumstances.
Note that these defaults can still be used even for organizations that want all external WebRTC traffic to traverse a proxy, simply by setting an organizational firewall policy that allows WebRTC traffic to only leave through the proxy. This provides a way to ensure the proxy is used for any external traffic, but avoids the performance issues of Mode 4 (where all media is forced through said proxy) for intra-organization traffic.
This section provides guidance to WebRTC implementations on how to implement the policies described above.
When trying to follow typical IP routing, the simplest approach is to bind the sockets used for p2p connections to the wildcard addresses (0.0.0.0 for IPv4, :: for IPv6), which allows the OS to route WebRTC traffic the same way as it would HTTP traffic. STUN and TURN will work as usual, and host candidates can be determined as mentioned below.
In order to discover the correct local IP addresses, implementations can use the common trick of binding sockets to the wildcard addresses, connect()ing those sockets to the IPv4/IPv6 addresses of the web application (obtained by resolving the host component of its URI [RFC3986]) and then reading the bound local addresses via getsockname(). This requires no data exchange; it simply provides a mechanism for applications to retrieve the desired information from the kernel routing table.
Use of the web application IPs ensures the right local IPs are selected, regardless of where the application is hosted (e.g., on an intranet). If the client is behind a proxy and cannot resolve the IPs via DNS, the IPv4/v6 addresses of the proxy can be used instead. If the web application was loaded from a file:// URI [RFC8089], the implementation can fall back to a well-known DNS name or IP address.
The recommendations mentioned in this document may cause certain WebRTC applications to malfunction. In order to be robust in all scenarios, the following guidelines are provided for applications:
This document is entirely devoted to security considerations.
This document requires no actions from IANA.
Several people provided input into this document, including Bernard Aboba, Harald Alvestrand, Ted Hardie, Matthew Kaufmann, Eric Rescorla, Adam Roach, and Martin Thomson.
[RFC2119] | Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997. |
Changes in draft -05:
Changes in draft -04:
Changes in draft -03:
Changes in draft -02:
Changes in draft -01:
Changes in draft -00: