RTC-Web E. Rescorla Internet-Draft RTFM, Inc. Intended status: Standards TrackSeptember 21,October 30, 2011 Expires:March 24,May 2, 2012 Security Considerations for RTC-Webdraft-ietf-rtcweb-security-00draft-ietf-rtcweb-security-01 Abstract The Real-Time Communications on the Web (RTC-Web) working group is tasked with standardizing protocols for real-time communications between Web browsers. The major use cases for RTC-Web technology are real-time audio and/or video calls, Web conferencing, and direct data transfer. Unlike most conventional real-time systems (e.g., SIP- based soft phones) RTC-Web communications are directly controlled by some Web server, which poses new security challenges. For instance, a Web browser might expose a JavaScript API which allows a server to place a video call. Unrestricted access to such an API would allow any site which a user visited to "bug" a user's computer, capturing any activity which passed in front of their camera. This document defines the RTC-Web threat model and defines an architecture which provides security within that threat model. Legal THIS DOCUMENT AND THE INFORMATION CONTAINED THEREIN ARE PROVIDED ON AN "AS IS" BASIS AND THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST, AND THE INTERNET ENGINEERING TASK FORCE, DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION THEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Status of this Memo 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 http://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 onMarch 24,May 2, 2012. Copyright Notice Copyright (c) 2011 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 . . . . . . . . . . . . . . . . . . . . . . . . .45 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . .56 3. The Browser Threat Model . . . . . . . . . . . . . . . . . . .56 3.1. Access to Local Resources . . . . . . . . . . . . . . . .67 3.2. Same Origin Policy . . . . . . . . . . . . . . . . . . . .67 3.3. Bypassing SOP: CORS, WebSockets, and consent to communicate . . . . . . . . . . . . . . . . . . . . . . .78 4. Security for RTC-Web Applications . . . . . . . . . . . . . .78 4.1. Access to Local Devices . . . . . . . . . . . . . . . . .78 4.1.1. Calling Scenarios and User Expectations . . . . . . .89 4.1.1.1. Dedicated Calling Services . . . . . . . . . . . .89 4.1.1.2. Calling the Site You're On . . . . . . . . . . . .89 4.1.1.3. Calling to an Ad Target . . . . . . . . . . . . .910 4.1.2. Origin-Based Security . . . . . . . . . . . . . . . .910 4.1.3. Security Properties of the Calling Page . . . . . . .1112 4.2. Communications Consent Verification . . . . . . . . . . .1213 4.2.1. ICE . . . . . . . . . . . . . . . . . . . . . . . . .1213 4.2.2. Masking . . . . . . . . . . . . . . . . . . . . . . .1214 4.2.3. Backward Compatibility . . . . . . . . . . . . . . . .1314 4.2.4. IP Location Privacy . . . . . . . . . . . . . . . . . 15 4.3. Communications Security . . . . . . . . . . . . . . . . .1415 4.3.1. Protecting Against Retrospective Compromise . . . . .1516 4.3.2. Protecting Against During-Call Attack . . . . . . . .1517 4.3.2.1. Key Continuity . . . . . . . . . . . . . . . . . .1617 4.3.2.2. Short Authentication Strings . . . . . . . . . . .1618 4.3.2.3. Recommendations . . . . . . . . . . . . . . . . .1719 5. Security Considerations . . . . . . . . . . . . . . . . . . .1719 6. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . .1819 7. References . . . . . . . . . . . . . . . . . . . . . . . . . .1819 7.1. Normative References . . . . . . . . . . . . . . . . . . .1819 7.2. Informative References . . . . . . . . . . . . . . . . . .18 Author's Address20 Appendix A. A Proposed Security Architecture [No Consensus on This] . . . . . . . . . . . . . . . . . . . . . . . . 22 A.1. Trust Hierarchy .20 1. Introduction The Real-Time. . . . . . . . . . . . . . . . . . . . 22 A.1.1. Authenticated Entities . . . . . . . . . . . . . . . . 22 A.1.2. Unauthenticated Entities . . . . . . . . . . . . . . . 23 A.2. Overview . . . . . . . . . . . . . . . . . . . . . . . . . 23 A.2.1. Initial Signaling . . . . . . . . . . . . . . . . . . 24 A.2.2. Media Consent Verification . . . . . . . . . . . . . . 26 A.2.3. DTLS Handshake . . . . . . . . . . . . . . . . . . . . 26 A.2.4. Communicationson the Web (RTC-Web) working group is tasked with standardizing protocols for real-time communications between Web browsers. The major use cases for RTC-Web technology are real-time audio and/or video calls, Web conferencing,anddirect data transfer. Unlike most conventional real-time systems, (e.g., SIP- based[RFC3261] soft phones) RTC-WebConsent Freshness . . . . . . . . . 27 A.3. Detailed Technical Description . . . . . . . . . . . . . . 27 A.3.1. Origin and Web Security Issues . . . . . . . . . . . . 27 A.3.2. Device Permissions Model . . . . . . . . . . . . . . . 28 A.3.3. Communications Consent . . . . . . . . . . . . . . . . 29 A.3.4. IP Location Privacy . . . . . . . . . . . . . . . . . 29 A.3.5. Communications Security . . . . . . . . . . . . . . . 30 A.3.6. Web-Based Peer Authentication . . . . . . . . . . . . 31 A.3.6.1. Generic Concepts . . . . . . . . . . . . . . . . . 31 A.3.6.2. BrowserID . . . . . . . . . . . . . . . . . . . . 32 A.3.6.3. OAuth . . . . . . . . . . . . . . . . . . . . . . 35 A.3.6.4. Generic Identity Support . . . . . . . . . . . . . 36 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 36 1. Introduction The Real-Time Communications on the Web (RTC-Web) working group is tasked with standardizing protocols for real-time communications between Web browsers. The major use cases for RTC-Web technology aredirectlyreal-time audio and/or video calls, Web conferencing, and direct data transfer. Unlike most conventional real-time systems, (e.g., SIP- based[RFC3261] soft phones) RTC-Web communications are directly controlled bysome Web server. A simple casesome Web server. A simple case is shown below. +----------------+ | | | Web Server | | | +----------------+ ^ ^ / \ HTTP / \ HTTP / \ / \ v v JS API JS API +-----------+ +-----------+ | | Media | | | Browser |<---------->| Browser | | | | | +-----------+ +-----------+ Figure 1: A simple RTC-Web system In the system shown in Figure 1, Alice and Bob both have RTC-Web enabled browsers and they visit some Web server which operates a calling service. Each of their browsers exposes standardized JavaScript calling APIs which are used by the Web server to set up a call between Alice and Bob. While this system is topologically similar to a conventional SIP-based system (with the Web server acting as the signaling service and browsers acting as softphones), control has moved to the central Web server; the browser simply provides API points that are used by the calling service. As with any Web application, the Web server can move logic between the server and JavaScript in the browser, but regardless of where the code is executing, it is ultimately under control of the server. It should be immediately apparent that this type of system poses new security challenges beyond those of a conventional VoIP system. In particular, it needs to contend with malicious calling services. For example, if the calling service can cause the browser to make a call at any time to any callee of its choice, then this facility can be used to bug a user's computer without their knowledge, simply by placing a call to some recording service. More subtly, if the exposed APIs allow the server to instruct the browser to send arbitrary content, then they can be used to bypass firewalls or mount denial of service attacks. Any successful system will need to be resistant to this and other attacks. 2. Terminology 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. The Browser Threat Model The security requirements for RTC-Web follow directly from the requirement that the browser's job is to protect the user. Huang et al. [huang-w2sp] summarize the core browser security guarantee as: Users can safely visit arbitrary web sites and execute scripts provided by those sites. It is important to realize that this includes sites hosting arbitrary malicious scripts. The motivation for this requirement is simple: it is trivial for attackers to divert users to sites of their choice. For instance, an attacker can purchase display advertisements which direct the user (either automatically or via user clicking) to their site, at which point the browser will execute the attacker's scripts. Thus, it is important that it be safe to view arbitrarily malicious pages. Of course, browsers inevitably have bugs which cause them to fall short of this goal, but any new RTC-Web functionality must be designed with the intent to meet this standard. The remainder of this section provides more background on the existing Web security model. In this model, then, the browser acts as a TRUSTED COMPUTING BASE (TCB) both from the user's perspective and to some extent from the server's. While HTML and JS provided by the server can cause the browser to execute a variety of actions, those scripts operate in a sandbox that isolates them both from the user's computer and from each other, as detailed below. Conventionally, we refer to either WEB ATTACKERS, who are able to induce you to visit their sites but do not control the network, and NETWORK ATTACKERS, who are able to control your network. Network attackers correspond to the [RFC3552] "Internet Threat Model". In general, it is desirable to build a system which is secure against both kinds of attackers, but realistically many sites do not run HTTPS [RFC2818] and so our ability to defend against network attackers is necessarily somewhat limited. Most of the rest of this section is devoted to web attackers, with the assumption that protection against network attackers is provided by running HTTPS. 3.1. Access to Local Resources While the browser has access to local resources such as keying material, files, the camera and the microphone, it strictly limits or forbids web servers from accessing those same resources. For instance, while it is possible to produce an HTML form which will allow file upload, a script cannot do so without user consent and in fact cannot even suggest a specific file (e.g., /etc/passwd); the user must explicitly select the file and consent to its upload. [Note: in many cases browsers are explicitly designed to avoid dialogs with the semantics of "click here to screw yourself", as extensive research shows that users are prone to consent under such circumstances.] Similarly, while Flash SWFs can access the camera and microphone, they explicitly require that the user consent to that access. In addition, some resources simply cannot be accessed from the browser at all. For instance, there is no real way to run specific executables directly from a script (though the user can of course be induced to download executable files and run them). 3.2. Same Origin Policy Many other resources are accessible but isolated. For instance, while scripts are allowed to make HTTP requests via the XMLHttpRequest() API those requests are not allowed to be made to any server, but rather solely to the same ORIGIN from whence the script came.[I-D.abarth-origin] (although CORS [CORS] and WebSockets [I-D.ietf-hybi-thewebsocketprotocol] provides a escape hatch from this restriction, as described below.) This SAME ORIGIN POLICY (SOP) prevents server A from mounting attacks on server B via the user's browser, which protects both the user (e.g., from misuse of his credentials) and the server (e.g., from DoS attack). More generally, SOP forces scripts from each site to run in their own, isolated, sandboxes. While there are techniques to allow them to interact, those interactions generally must be mutually consensual (by each site) and are limited to certain channels. For instance, multiple pages/browser panes from the same origin can read each other's JS variables, but pages from the different origins--or even iframes from different origins on the same page--cannot. 3.3. Bypassing SOP: CORS, WebSockets, and consent to communicate While SOP serves an important security function, it also makes it inconvenient to write certain classes of applications. In particular, mash-ups, in which a script from origin A uses resources from origin B, can only be achieved via a certain amount of hackery. The W3C Cross-Origin Resource Sharing (CORS) spec [CORS] is a response to this demand. In CORS, when a script from origin A executes what would otherwise be a forbidden cross-origin request, the browser instead contacts the target server to determine whether it is willing to allow cross-origin requests from A. If it is so willing, the browser then allows the request. This consent verification process is designed to safely allow cross-origin requests. While CORS is designed to allow cross-origin HTTP requests, WebSockets [I-D.ietf-hybi-thewebsocketprotocol] allows cross-origin establishment of transparent channels. Once a WebSockets connection has been established from a script to a site, the script can exchange any traffic it likes without being required to frame it as a series of HTTP request/response transactions. As with CORS, a WebSockets transaction starts with a consent verification stage to avoid allowing scripts to simply send arbitrary data to another origin. While consent verification is conceptually simple--just do a handshake before you start exchanging the real data--experience has shown that designing a correct consent verification system is difficult. In particular, Huang et al. [huang-w2sp] have shown vulnerabilities in the existing Java and Flash consent verification techniques and in a simplified version of the WebSockets handshake. In particular, it is important to be wary of CROSS-PROTOCOL attacks in which the attacking script generates traffic which is acceptable to some non-Web protocol state machine. In order to resist this form of attack, WebSockets incorporates a masking technique intended to randomize the bits on the wire, thus making it more difficult to generate traffic which resembles a given protocol. 4. Security for RTC-Web Applications 4.1. Access to Local Devices As discussed in Section 1, allowing arbitrary sites to initiate calls violates the core Web security guarantee; without some access restrictions on local devices, any malicious site could simply bug a user. At minimum, then, it MUST NOT be possible for arbitrary sites to initiate calls to arbitrary locations without user consent. This immediately raises the question, however, of what should be the scope of user consent. For the rest of this discussion we assume that the user is somehow going to grant consent to some entity (e.g., a social networking site) to initiate a call on his behalf. This consent may be limited to a single call or may be a general consent. In order for the user to make an intelligent decision about whether to allow a call (and hence his camera and microphone input to be routed somewhere), he must understand either who is requesting access, where the media is going, or both. So, for instance, one might imagine that at the time access to camera and microphone is requested, the user is shown a dialog that says "site X has requested access to camera and microphone, yes or no" (though note that this type of in-flow interface violates one of the guidelines in Section 3). The user's decision will of course be based on his opinion of Site X. However, as discussed below, this is a complicated concept. 4.1.1. Calling Scenarios and User Expectations While a large number of possible calling scenarios are possible, the scenarios discussed in this section illustrate many of the difficulties of identifying the relevant scope of consent. 4.1.1.1. Dedicated Calling Services The first scenario we consider is a dedicated calling service. In this case, the user has a relationship with a calling site and repeatedly makes calls on it. It is likely that rather than having to give permission for each call that the user will want to give the calling service long-term access to the camera and microphone. This is a natural fit for a long-term consent mechanism (e.g., installing an app store "application" to indicate permission for the calling service.) A variant of the dedicated calling service is a gaming site (e.g., a poker site) which hosts a dedicated calling service to allow players to call each other. With any kind of service where the user may use the same service to talk to many different people, there is a question about whether the user can know who they are talking to. In general, this is difficult as most of the user interface is presented by the calling site. However, communications security mechanisms can be used to give some assurance, as described in Section 4.3.2. 4.1.1.2. Calling the Site You're On Another simple scenario is calling the site you're actually visiting. The paradigmatic case here is the "click here to talk to a representative" windows that appear on many shopping sites. In this case, the user's expectation is that they are calling the site they're actually visiting. However, it is unlikely that they want to provide a general consent to such a site; just because I want some information on a car doesn't mean that I want the car manufacturer to be able to activate my microphone whenever they please. Thus, this suggests the need for a second consent mechanism where I only grant consent for the duration of a given call. As described in Section 3.1, great care must be taken in the design of this interface to avoid the users just clicking through. Note also that the user interface chrome must clearly display elements showing that the call is continuing in order to avoid attacks where the calling site just leaves it up indefinitely but shows a Web UI that implies otherwise. 4.1.1.3. Calling to an Ad Target In both of the previous cases, the user has a direct relationship (though perhaps a transient one) with the target of the call. Moreover, in both cases he is actually visiting the site of the person he is being asked to trust. However, this is not always so. Consider the case where a user is a visiting a content site which hosts an advertisement with an invitation to call for more information. When the user clicks the ad, they are connected with the advertiser or their agent. The relationships here are far more complicated: the site the user is actually visiting has no direct relationship with the advertiser; they are just hosting ads from an ad network. The user has no relationship with the ad network, but desires one with the advertiser, at least for long enough to learn about their products. At minimum, then, whatever consent dialog is shown needs to allow the user to have some idea of the organization that they are actually calling. However, because the user also has some relationship with the hosting site, it is also arguable that the hosting site should be allowed to express an opinion (e.g., to be able to allow or forbid a call) since a bad experience with an advertiser reflect negatively on the hosting site [this idea was suggested by Adam Barth]. However, this obviously presents a privacy challenge, as sites which host advertisements often learn very little about whether individual users clicked through to the ads, or even which ads were presented. 4.1.2. Origin-Based Security As discussed in Section 3.2, the basic unit of Web sandboxing is the origin, and so it is natural to scope consent to origin. Specifically, a script from origin A MUST only be allowed to initiate communications (and hence to access camera and microphone) if the user has specifically authorized access for that origin. It is of course technically possible to have coarser-scoped permissions, but because the Web model is scoped to origin, this creates a difficult mismatch. Arguably, origin is not fine-grained enough. Consider the situation where Alice visits a site and authorizes it to make a single call. If consent is expressed solely in terms of origin, then at any future visit to that site (including one induced via mash-up or ad network), the site can bug Alice's computer, use the computer to place bogus calls, etc. While in principle Alice could grant and then revoke the privilege, in practice privileges accumulate; if we are concerned about this attack, something else is needed. There are a number of potential countermeasures to this sort of issue. Individual Consent Ask the user for permission for each call. Callee-oriented Consent Only allow calls to a given user. Cryptographic Consent Only allow calls to a given set of peer keying material or to a cryptographically established identity. Unfortunately, none of these approaches is satisfactory for all cases. As discussed above, individual consent puts the user's approval in the UI flow for every call. Not only does this quickly become annoying but it can train the user to simply click "OK", at which point the consent becomes useless. Thus, while it may be necessary to have individual consent in some case, this is not a suitable solution for (for instance) the calling service case. Where necessary, in-flow user interfaces must be carefully designed to avoid the risk of the user blindly clicking through. The other two options are designed to restrict calls to a given target. Unfortunately, Callee-oriented consent does not work well because a malicious site can claim that the user is calling any user of his choice. One fix for this is to tie calls to a cryptographically established identity. While not suitable for all cases, this approach may be useful for some. If we consider the advertising case described in Section 4.1.1.3, it's not particularly convenient to require the advertiser to instantiate an iframe on the hosting site just to get permission; a more convenient approach is to cryptographically tie the advertiser's certificate to the communication directly. We're still tying permissions to origin here, but to the media origin (and-or destination) rather than to the Web origin. Another case where media-level cryptographic identity makes sense is when a user really does not trust the calling site. For instance, I might be worried that the calling service will attempt to bug my computer, but I also want to be able to conveniently call my friends. If consent is tied to particular communications endpoints, then my risk is limited. However, this is also not that convenient an interface, since managing individual user permissions can be painful. While this is primarily a question not for IETF, it should be clear that there is no really good answer. In general, if you cannot trust the site which you have authorized for calling not to bug you then your security situation is not really ideal. It is RECOMMENDED that browsers have explicit (and obvious) indicators that they are in a call in order to mitigate this risk. 4.1.3. Security Properties of the Calling Page Origin-based security is intended to secure against web attackers. However, we must also consider the case of network attackers. Consider the case where I have granted permission to a calling service by an origin that has the HTTP scheme, e.g., http://calling-service.example.com. If I ever use my computer on an unsecured network (e.g., a hotspot or if my own home wireless network is insecure), and browse any HTTP site, then an attacker can bug my computer. The attack proceeds like this: 1. I connect to http://anything.example.org/. Note that this site is unaffiliated with the calling service. 2. The attacker modifies my HTTP connection to inject an IFRAME (or a redirect) to http://calling-service.example.com 3. The attacker forges the response apparently http://calling-service.example.com/ to inject JS to initiate a call to himself. Note that this attack does not depend on the media being insecure. Because the call is to the attacker, it is also encrypted to him. Moreover, it need not be executed immediately; the attacker can "infect" the origin semi-permanently (e.g., with a web worker or a popunder) and thus be able to bug me long after I have left the infected network. This risk is created by allowing calls at all from a page fetched over HTTP. Even if calls are only possible from HTTPS sites, if the site embeds active content (e.g., JavaScript) that isshown below. +----------------+ | | | Web Server | | | +----------------+ ^ ^ / \ HTTP / \fetched over HTTP/ \ / \ v v JS API JS API +-----------+ +-----------+ | | Media | | | Browser |<---------->| Browser | | | | | +-----------+ +-----------+ Figure 1: A simple RTC-Web system In the system shownor from an untrusted site, because that JavaScript is executed inFigure 1, Alice and Bob both havethe security context of the page [finer-grained]. Thus, it is also dangerous to allow RTC-Webenabled browsers and they visit some Web serverfunctionality from HTTPS origins that embed mixed content. Note: this issue is not restricted to PAGES whichoperatescontain mixed content. If acalling service. Eachpage from a given origin ever loads mixed content then it is possible for a network attacker to infect the browser's notion oftheir browsers exposes standardized JavaScript calling APIs which are used bythat origin semi-permanently. [[ OPEN ISSUE: What recommendation should IETF make about (a) whether RTCWeb long-term consent should be available over HTTP pages and (b) How to handle origins where the consent is to an HTTPS URL but the page contains active mixed content? ]] 4.2. Communications Consent Verification As discussed in Section 3.3, allowing web applications unrestricted network access via the browser introduces theWeb serverrisk of using the browser as an attack platform against machines which would not otherwise be accessible toset up a call between Alice and Bob. While this system isthe malicious site, for instance because they are topologicallysimilar torestricted (e.g., behind aconventional SIP-based system (with the Web server actingfirewall or NAT). In order to prevent this form of attack asthe signaling service and browsers actingwell assoftphones), control has movedcross-protocol attacks it is important tothe central Web server; the browser simply provides API pointsrequire thatare used by the calling service. As with any Web application,theWeb server can move logic betweentarget of traffic explicitly consent to receiving theserver and JavaScripttraffic in question. Until that consent has been verified for a given endpoint, traffic other than thebrowser, but regardlessconsent handshake MUST NOT be sent to that endpoint. 4.2.1. ICE Verifying receiver consent requires some sort ofwhereexplicit handshake, but conveniently we already need one in order to do NAT hole- punching. ICE [RFC5245] includes a handshake designed to verify that thecodereceiving element wishes to receive traffic from the sender. It isexecuting, itimportant to remember here that the site initiating ICE isultimately under control ofpresumed malicious; in order for theserver. It shouldhandshake to beimmediately apparent that this type of system poses new security challenges beyond thosesecure the receiving element MUST demonstrate receipt/knowledge ofa conventional VoIP system. In particular, it needssome value not available to the site (thus preventing the site from forging responses). In order tocontendachieve this objective withmalicious calling services. For example, ifICE, thecalling service can causeSTUN transaction IDs must be generated by the browser and MUST NOT be made available tomakethe initiating script, even via acall at any timediagnostic interface. Verifying receiver consent also requires verifying the receiver wants toany callee of its choice, thenreceive traffic from a particular sender, and at thisfacility can be used to bugtime; for example auser's computer without their knowledge,malicious site may simplyby placing a callattempt ICE tosome recording service. More subtly, if the exposed APIs allowknown servers that are using ICE for other sessions. ICE provides this verification as well, by using theserverSTUN credentials as a form of per-session shared secret. Those credentials are known toinstructthebrowserWeb application, but would need tosend arbitrary content, then they canalso be known and usedto bypass firewalls or mount denial of service attacks. Any successful system will needby the STUN-receiving element to beresistant to this and other attacks. 2. Terminology The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document areuseful. There also needs to beinterpreted as described in RFC 2119 [RFC2119]. 3. The Browser Threat Model The security requirementssome mechanism forRTC-Web follow directly fromtherequirementbrowser to verify that thebrowser's job is to protecttarget of theuser.traffic continues to wish to receive it. Obviously, some ICE-based mechanism will work here, but it has been observed that because ICE keepalives are indications, they will not work here, so some other mechanism is needed. 4.2.2. Masking Once consent is verified, there still is some concern about misinterpretation attacks as described by Huang etal. [huang-w2sp] summarize the core browser security guarantee as: Users can safely visit arbitrary web sites and execute scripts provided by those sites. Ital.[huang-w2sp]. As long as communication isimportantlimited torealize that this includes sites hosting arbitrary malicious scripts. The motivation forUDP, then thisrequirementrisk issimple: itprobably limited, thus masking istrivialnot required forattackers to divert usersUDP. I.e., once communications consent has been verified, it is most likely safe tosites of their choice. For instance, an attacker can purchase display advertisements which directallow theuser (either automatically or via user clicking)implementation to send arbitrary UDP traffic totheir site, at which point the browser will executetheattacker's scripts. Thus, it is importantchosen destination, provided thatit be safe to view arbitrarily malicious pages. Of course, browsers inevitably have bugs which cause themthe STUN keepalives continue tofall short ofsucceed. In particular, thisgoal, but any new RTC-Web functionality must be designed withis true for theintentdata channel if DTLS is used because DTLS (with the anti-chosen plaintext mechanisms required by TLS 1.1) does not allow the attacker tomeet this standard. The remaindergenerate predictable ciphertext. However, with TCP the risk ofthis section providestransparent proxies becomes much morebackground onsevere. If TCP is to be used, then WebSockets style masking MUST be employed. 4.2.3. Backward Compatibility A requirement to use ICE limits compatibility with legacy non-ICE clients. It seems unsafe to completely remove theexisting Web security model. In this model, then,requirement for some check. All proposed checks have the common feature that the browseracts as a TRUSTED COMPUTING BASE (TCB) both fromsends some message to theuser's perspectivecandidate traffic recipient and refuses tosome extent fromsend other traffic until that message has been replied to. The message/reply pair must be generated in such a way that an attacker who controls theserver's. While HTML and JS providedWeb application cannot forge them, generally by having theserver can causemessage contain some secret value that must be incorporated (e.g., echoed, hashed into, etc.). Non-ICE candidates for this role (in cases where thebrowser to execute a variety of actions, those scripts operate inlegacy endpoint has asandbox that isolates them both frompublic address) include: o STUN checks without using ICE (i.e., theuser's computer and from each other,non-RTC-web endpoint sets up a STUN responder.) o Use or RTCP asdetailed below. Conventionally, we refer to either WEB ATTACKERS, who are ablean implicit reachability check. In the RTCP approach, the RTC-Web endpoint is allowed toinduce yousend a limited number of RTP packets prior tovisit their sites butreceiving consent. This allows a short window of attack. In addition, some legacy endpoints do notcontrol the network, and NETWORK ATTACKERS, who are ablesupport RTCP, so this is a much more expensive solution for such endpoints, for which it would likely be easier tocontrol your network. Network attackers correspondimplement ICE. For these two reasons, an RTCP-based approach does not seem to address the[RFC3552] "Internet Threat Model".security issue satisfactorily. Ingeneral, it is desirable to build a system whichthe STUN approach, the RTC-Web endpoint issecure against both kinds of attackers, but realistically many sites do not run HTTPS [RFC2818] and so our abilityable todefend against network attackersverify that the recipient isnecessarily somewhat limited. Mostrunning some kind of STUN endpoint but unless therest of this sectionSTUN responder isdevoted to web attackers,integrated with theassumptionICE username/password establishment system, the RTC-Web endpoint cannot verify thatprotection against network attackers is provided by running HTTPS. 3.1. Access to Local Resources Whilethebrowser has accessrecipient consents tolocal resources such as keying material, files,this particular call. This may be an issue if existing STUN servers are operated at addresses that are not able to handle bandwidth-based attacks. Thus, this approach does not seem satisfactory either. If thecamera andsystems are tightly integrated (i.e., themicrophone, it strictly limits or forbids web servers from accessing those same resources. For instance, while itSTUN endpoint responds with responses authenticated with ICE credentials) then this issue does not exist. However, such a design ispossiblevery close toproduceanHTML form which will allow file upload,ICE-Lite implementation (indeed, arguably is one). An intermediate approach would be to have ascript cannot do soSTUN extension that indicated that one was responding to RTC-Web checks but not computing integrity checks based on the ICE credentials. This would allow the use of standalone STUN servers withoutuser consent and in fact cannot even suggest a specific file (e.g., /etc/passwd);theuser must explicitly selectrisk of confusing them with legacy STUN servers. If a non-ICE legacy solution is needed, then this is probably thefile andbest choice. Once initial consent is verified, we also need toits upload. [Note:verify continuing consent, inmany cases browsers are explicitly designedorder to avoiddialogs withattacks where two people briefly share an IP (e.g., behind a NAT in an Internet cafe) and thesemantics of "click hereattacker arranges for a large, unstoppable, traffic flow toscrew yourself", as extensive research shows that usersthe network and then leaves. The appropriate technologies here arepronefairly similar toconsent under such circumstances.] Similarly, while Flash SWFs can accessthose for initial consent, though are perhaps weaker since thecamera and microphone, they explicitly requirethreats is less severe. [[ OPEN ISSUE: Exactly what should be the requirements here? Proposals include ICE all the time or ICE but with allowing one of these non-ICE things for legacy. ]] 4.2.4. IP Location Privacy Note that as soon as theuser consentcallee sends their ICE candidates, the callee learns the callee's IP addresses. The callee's server reflexive address reveals a lot of information about the callee's location. In order tothat access.avoid tracking, implementations may wish to suppress the start of ICE negotiation until the callee has answered. In addition,some resources simply cannot be accessedeither side may wish to hide their location entirely by forcing all traffic through a TURN server. 4.3. Communications Security Finally, we consider a problem familiar from thebrowser at all.SIP world: communications security. For obvious reasons, it MUST be possible for the communicating parties to establish a channel which is secure against both message recovery and message modification. (See [RFC5479] for more details.) This service must be provided for both data and voice/video. Ideally the same security mechanisms would be used for both types of content. Technology for providing this service (for instance,thereDTLS [RFC4347] and DTLS-SRTP [RFC5763]) is well understood. However, we must examine this technology to the RTC-Web context, where the threat model isno real waysomewhat different. In general, it is important torun specific executables directly fromunderstand that unlike ascript (thoughconventional SIP proxy, theuser can of course be induced to download executable files and run them). 3.2. Same Origin Policy Many other resources are accessible but isolated. For instance, while scripts are allowed to make HTTP requests viacalling service (i.e., theXMLHttpRequest() API those requests areWeb server) controls notallowed to be made to any server, but rather solely toonly thesame ORIGIN from whencechannel between thescript came.[I-D.abarth-origin] (although CORS [CORS] and WebSockets [I-D.ietf-hybi-thewebsocketprotocol] provides a escape hatch from this restriction, as described below. This SAME ORIGIN POLICY (SOP) prevents server A from mounting attackscommunicating endpoints but also the application running onserver B viathe user'sbrowser, which protects bothbrowser. While in principle it is possible for theuser (e.g., from misusebrowser to cut the calling service out ofhis credentials) andtheserver (e.g., from DoS attack). More generally, SOP forces scripts from each site to runloop and directly present trusted information (and perhaps get consent), practice intheir own, isolated, sandboxes. While there are techniquesmodern browsers is toallow themavoid this whenever possible. "In- flow" modal dialogs which require the user tointeract, those interactions generally must be mutually consensual (by each site) andconsent to specific actions arelimitedparticularly disfavored as human factors research indicates that unless they are made extremely invasive, users simply agree tocertain channels. For instance, multiple pages/browser panes fromthem without actually consciously giving consent. [abarth-rtcweb]. Thus, nearly all thesame origin can read each other's JS variables,UI will necessarily be rendered by the browser butpages fromunder control of thedifferent origins--or even iframes from different origins oncalling service. This likely includes thesame page--cannot. 3.3. Bypassing SOP: CORS, WebSockets,peer's identity information, which, after all, is only meaningful in the context of some calling service. This limitation does not mean that preventing attack by the calling service is completely hopeless. However, we need to distinguish between two classes of attack: Retrospective compromise of calling service. The calling service is is non-malicious during a call but subsequently is compromised andconsentwishes tocommunicate While SOP servesattack animportant security function, it also makesolder call. During-call attack by calling service. The calling service is compromised during the call itinconvenientwishes towrite certain classesattack. Providing security against the former type ofapplications. In particular, mash-ups,attack is practical using the techniques discussed inwhichSection 4.3.1. However, it is extremely difficult to prevent ascript from origin A uses resourcestrusted but malicious calling service fromorigin B, can only be achieved viaactively attacking acertain amount of hackery. The W3C Cross-Origin Resource Sharing (CORS) spec [CORS] isuser's calls, either by mounting aresponse toMITM attack or by diverting them entirely. (Note that thisdemand. In CORS, whenattack applies equally to ascript from origin A executes what would otherwisenetwork attacker if communications to the calling service are not secured.) We discuss some potential approaches and why they are likely to be impractical in Section 4.3.2. 4.3.1. Protecting Against Retrospective Compromise In aforbidden cross-origin request,retrospective attack, thebrowser instead contactscalling service was uncompromised during thetarget server to determine whether it is willingcall, but that an attacker subsequently wants toallow cross-origin requests from A. If it is so willing, the browser then allowsrecover therequest. This consent verification process is designed to safely allow cross-origin requests. While CORS is designed to allow cross-origin HTTP requests, WebSockets [I-D.ietf-hybi-thewebsocketprotocol] allows cross-origin establishmentcontent oftransparent channels. Once a WebSockets connectionthe call. We assume that the attacker hasbeen established from a scriptaccess toa site,thescript can exchange any traffic it likes without being required to frame itprotected media stream asa serieswell as having full control ofHTTP request/response transactions. As with CORS, a WebSockets transaction starts with a consent verification stage to avoid allowing scripts to simply send arbitrary data to another origin. While consent verification is conceptually simple--just do a handshake before you start exchangingthereal data--experiencecalling service. If the calling service hasshown that designing a correct consent verification system is difficult. In particular, Huang et al. [huang-w2sp] have shown vulnerabilities inaccess to theexisting Java and Flash consent verification techniques andtraffic keying material (as ina simplified versionSDES [RFC4568]), then retrospective attack is trivial. This form of attack is particularly serious in theWebSockets handshake. In particular,Web context because it isimportant to be wary of CROSS-PROTOCOL attacksstandard practice inwhichWeb services to run extensive logging and monitoring. Thus, it is highly likely that if theattacking script generatestrafficwhichkey isacceptable to some non-Web protocol state machine. In order to resist this formpart ofattack, WebSockets incorporates a masking technique intended to randomize the bits on the wire, thus makingany HTTP request itmore difficultwill be logged somewhere and thus subject togenerate traffic which resembles a given protocol. 4. Securitysubsequent compromise. It is this consideration that makes an automatic, public key-based key exchange mechanism imperative for RTC-WebApplications 4.1. Access to Local Devices As discussed in Section 1, allowing arbitrary sites(this is a good idea for any communications security system) and this mechanism SHOULD provide perfect forward secrecy (PFS). The signaling channel/calling service can be used toinitiate calls violatesauthenticate this mechanism. In addition, thecore Web security guarantee; without some access restrictions on local devices, any malicious site could simply bug a user. At minimum, then, itsystem MUST NOTbe possible for arbitrary sitesprovide any APIs toinitiate callsextract either long-term keying material or toarbitrary location without user consent. This immediately raisesdirectly access any stored traffic keys. Otherwise, an attacker who subsequently compromised thequestion, however, of what shouldcalling service might be able to use those APIs to recover thescope of user consent. Fortraffic keys and thus compromise therest of this discussion we assumetraffic. 4.3.2. Protecting Against During-Call Attack Protecting against attacks during a call is a more difficult proposition. Even if the calling service cannot directly access keying material (as recommended in the previous section), it can simply mount a man-in-the-middle attack on the connection, telling Alice that she is calling Bob and Bob that he is calling Alice, while in fact theusercalling service issomehow going to grant consent to some entity (e.g.,acting as asocial networking site)calling bridge and capturing all the traffic. While in theory it is possible toinitiate a call on his behalf. This consent may be limitedconstruct techniques which protect against this form of attack, in practice these techniques all require far too much user intervention toa single call or maybea general consent. In order forpractical, given the user interface constraints described in [abarth-rtcweb]. 4.3.2.1. Key Continuity One natural approach is tomake an intelligent decision about whether to allowuse "key continuity". While acall (and hence his camera and microphone inputmalicious calling service can present any identity it chooses tobe routed somewhere), he must understand either who is request access, wherethemedia is going, or both. So, for instance, one might imagineuser, it cannot produce a private key thatat the time accessmaps tocamera and microphonea given public key. Thus, it isrequested,possible for theuser is shown a dialog that says "site X has requested accessbrowser tocamera and microphone, yes or no" (thoughnotethat this type of in-flow interface violates one of the guidelines in Section Section 3). The user's decision will of course be based on his opinion of Site X. However, as discussed below, this isacomplicated concept. 4.1.1. Calling Scenariosgiven user's public key andUser Expectations Whilegenerate an alarm whenever that user's key changes. SSH [RFC4251] uses alarge numbersimilar technique. (Note that the need to avoid explicit user consent on every call precludes the browser requiring an immediate manual check ofpossible calling scenarios are possible,thescenarios discussed inpeer's key). Unfortunately, thissection illustrate manysort of key continuity mechanism is far less useful in thedifficultiesRTC-Web context. First, much ofidentifyingtherelevant scopevirtue ofconsent. 4.1.1.1. Dedicated Calling Services The first scenario we considerRTC-Web (and any Web application) is that it is not bound to particular piece of client software. Thus, it will be not only possible but routine for adedicated calling service. In this case, theuserhas a relationship with a calling site and repeatedly makes callsto use multiple browsers onit. Itdifferent computers which will of course have different keying material (SACRED [RFC3760] notwithstanding.) Thus, users will frequently be alerted to key mismatches which are in fact completely legitimate, with the result that they are trained to simply click through them. As it islikelyknown that users routinely will click through far more dire warnings [cranor-wolf], it seems extremely unlikely that any key continuity mechanism will be effective rather thanhavingsimply annoying. Moreover, it is trivial togive permission for each callbypass even this kind of mechanism. Recall that unlike theuser will want to givecase of SSH, thecalling service long-term access tobrowser never directly gets thecamera and microphone. Thispeer's identity from the user. Rather, it isa natural fit for a long-term consent mechanism (e.g., installing an app store "application" to indicate permission forprovided by the callingservice.) A variantservice. Even enabling a mechanism of this type would require an API to allow thededicatedcalling service to tell the browser "this is agaming site (e.g., a poker site) which hosts a dedicatedcall to user X". All the calling service needs toallow playersdo to avoid triggering a key continuity warning is to tell the browser that "this is a calleach other. With any kind of serviceto user Y" where Y is close to X. Even if the usermay useactually checks thesame serviceother side's name (which all available evidence indicates is unlikely), this would require (a) the browser totalktrusted UI tomany different people, there is a question about whetherprovide the name and (b) the usercan know who they are talking to. In general, thisto not be fooled by similar appearing names. 4.3.2.2. Short Authentication Strings ZRTP [RFC6189] uses a "short authentication string" (SAS) which isdifficult as most ofderived from theuser interfacekey agreement protocol. This SAS ispresenteddesigned to be read over the voice channel and if confirmed by both sides precludes MITM attack. The intention is that thecalling site. However, communications security mechanisms can beSAS is used once and then key continuity (though a different mechanism from that discussed above) is used thereafter. Unfortunately, the SAS does not offer a practical solution togive some assurance, as describedthe problem of a compromised calling service. "Voice conversion" systems, which modify voice from one speaker to make it sound like another, are an active area of research. These systems are already good enough to fool both automatic recognition systems [farus-conversion] and humans [kain-conversion] in many cases, and are of course likely to improve inSection 4.3.2. 4.1.1.2. Calling the Site You're On Another simple scenario is calling the site you're actually visiting. The paradigmatic case here isfuture, especially in an environment where the"click here to talkuser just wants toa representative" windows that appearget onmany shopping sites. In this case,with theuser's expectationphone call. Thus, even if SAS isthat they are calling the site they're actually visiting. However,effective today, it isunlikely that they want to provide a general consent to such a site; just because I want some information on a car doesn't mean that I want the car manufacturerlikely not to beable to activate my microphone whenever they please. Thus, this suggests the needso fora second consent mechanism where I only grant consentmuch longer. Moreover, it is possible for an attacker who controls theduration of a given call. As described in Section 3.1, great care must be taken in the design of this interfacebrowser toavoidallow theusers just clicking through. 4.1.1.3. CallingSAS toan Ad Target In both of the previous cases,succeed and then simulate call failure and reconnect, trusting that the user will not notice that the "no SAS" indicator hasa direct relationship (though perhaps a transient one) withbeen set (which seems likely). Even were SAS secure if used, it seems exceedingly unlikely that users will actually use it. As discussed above, thetarget ofbrowser UI constraints preclude requiring the SAS exchange prior to completing the call and so it must be voluntary; at most the browser will provide some UI indicator that thecall. Moreover, in both cases heSAS has not yet been checked. However, it it isactually visitingwell-known that when faced with optional mechanisms such as fingerprints, users simply do not check them [whitten-johnny] Thus, it is highly unlikely that users will ever perform thesite ofSAS exchange. Once uses have checked theperson heSAS once, key continuity isbeing askedrequired totrust.avoid them needing to check it on every call. However, this isnot always so. Consider the case where a userproblematic for reasons indicated in Section 4.3.2.1. In principle it is of course possible to render avisiting a content site which hosts an advertisement with an invitationdifferent UI element tocall for more information. When the user clicks the ad, they are connected with the advertiser or their agent. The relationships hereindicate that calls arefar more complicated: the site the user is actually visiting has no direct relationship withusing an unauthenticated set of keying material (recall that theadvertiser; they areattacker can justhosting ads from an ad network. The user has no relationship withpresent a slightly different name so that thead network, but desires one withattack shows theadvertiser, at least for long enoughsame UI as a call tolearn about their products. At minimum, then, whatever consent dialog is shown needsa new device or toallowsomeone you haven't called before) but as a practical matter, users simply ignore such indicators even in theuser to have some idearather more dire case ofthe organization that theymixed content warnings. 4.3.2.3. Recommendations [[ OPEN ISSUE: What areactually calling. However, because the user also has some relationship withthehosting site, it is also arguable thatbest UI recommendations to make? Proposal: take thehosting sitetext from [I-D.kaufman-rtcweb-security-ui] Section 2]] [[ OPEN ISSUE: Exactly what combination of media security primitives should beallowed to express an opinion (e.g., to be ablespecified and/or mandatory to implement? In particular, should we allow DTLS-SRTP only, orforbid a call) since a bad experience with an advertiser reflect negatively on the hosting site [this idea was suggested by Adam Barth]. However, this obviously presents a privacy challenge, as sites which host advertisements often learn very littleboth DTLS-SRTP and SDES. Should we allow RTP for backward compatibility? ]] 5. Security Considerations This entire document is aboutwhether individual users clicked throughsecurity. 6. Acknowledgements Bernard Aboba, Harald Alvestrand, Cullen Jennings, Hadriel Kaplan (S 4.2.1), Matthew Kaufman, Magnus Westerland. 7. References 7.1. Normative References [RFC2119] Bradner, S., "Key words for use in RFCs tothe ads, or even which ads were presented. 4.1.2. Origin-BasedIndicate Requirement Levels", BCP 14, RFC 2119, March 1997. 7.2. Informative References [CORS] van Kesteren, A., "Cross-Origin Resource Sharing". [I-D.abarth-origin] Barth, A., "The Web Origin Concept", draft-abarth-origin-09 (work in progress), November 2010. [I-D.ietf-hybi-thewebsocketprotocol] Fette, I. and A. Melnikov, "The WebSocket protocol", draft-ietf-hybi-thewebsocketprotocol-17 (work in progress), September 2011. [I-D.kaufman-rtcweb-security-ui] Kaufman, M., "Client Security User Interface Requirements for RTCWEB", draft-kaufman-rtcweb-security-ui-00 (work in progress), June 2011. [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, A., Peterson, J., Sparks, R., Handley, M., and E. Schooler, "SIP: Session Initiation Protocol", RFC 3261, June 2002. [RFC3552] Rescorla, E. and B. Korver, "Guidelines for Writing RFC Text on SecurityAs discussed in Section 3.2, the basic unit of Web sandboxing is the origin,Considerations", BCP 72, RFC 3552, July 2003. [RFC3760] Gustafson, D., Just, M., andso it is natural to scope consent to origin. Specifically, a script from origin A MUST only be allowed to initiate communications (and hence to access cameraM. Nystrom, "Securely Available Credentials (SACRED) - Credential Server Framework", RFC 3760, April 2004. [RFC4251] Ylonen, T. andmicrophone) if the user has specifically authorized accessC. Lonvick, "The Secure Shell (SSH) Protocol Architecture", RFC 4251, January 2006. [RFC4347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer Security", RFC 4347, April 2006. [RFC4568] Andreasen, F., Baugher, M., and D. Wing, "Session Description Protocol (SDP) Security Descriptions forthat origin. It isMedia Streams", RFC 4568, July 2006. [RFC5245] Rosenberg, J., "Interactive Connectivity Establishment (ICE): A Protocol for Network Address Translator (NAT) Traversal for Offer/Answer Protocols", RFC 5245, April 2010. [RFC5479] Wing, D., Fries, S., Tschofenig, H., and F. Audet, "Requirements and Analysis ofcourse technically possible to have coarser-scoped permissions, but because the Web model is scoped to origin, this createsMedia Security Management Protocols", RFC 5479, April 2009. [RFC5763] Fischl, J., Tschofenig, H., and E. Rescorla, "Framework for Establishing adifficult mismatch. Arguably, origin is not fine-grained enough. ConsiderSecure Real-time Transport Protocol (SRTP) Security Context Using Datagram Transport Layer Security (DTLS)", RFC 5763, May 2010. [RFC6189] Zimmermann, P., Johnston, A., and J. Callas, "ZRTP: Media Path Key Agreement for Unicast Secure RTP", RFC 6189, April 2011. [abarth-rtcweb] Barth, A., "Prompting thesituation where Alice visits a site and authorizes it to make a single call. If consentuser isexpressed solely in termssecurity failure", RTC- Web Workshop. [cranor-wolf] Sunshine, J., Egelman, S., Almuhimedi, H., Atri, N., and L. cranor, "Crying Wolf: An Empirical Study of SSL Warning Effectiveness", Proceedings oforigin, then at any future visit to that site (including one induced via mash-up or ad network), the site can bug Alice's computer, usethecomputer18th USENIX Security Symposium, 2009. [farus-conversion] Farrus, M., Erro, D., and J. Hernando, "Speaker Recognition Robustness toplace bogus calls, etc. While in principle Alice could grantVoice Conversion". [finer-grained] Barth, A. andthen revoke the privilege, in practice privileges accumulate; if we are concerned about this attack, something else is needed. There are a numberC. Jackson, "Beware ofpotential countermeasuresFiner-Grained Origins", W2SP, 2008. [huang-w2sp] Huang, L-S., Chen, E., Barth, A., Rescorla, E., and C. Jackson, "Talking tothis sort of issue. Individual Consent Ask the user for permissionYourself foreach call. Callee-oriented Consent Only allow calls to a given user. Cryptographic Consent Only allow calls to a given setFun and Profit", W2SP, 2011. [kain-conversion] Kain, A. and M. Macon, "Design and Evaluation ofpeer keying material or toacryptographically established identity. Unfortunately, noneVoice Conversion Algorithm based on Spectral Envelope Mapping and Residual Prediction", Proceedings of ICASSP, May 2001. [whitten-johnny] Whitten, A. and J. Tygar, "Why Johnny Can't Encrypt: A Usability Evaluation of PGP 5.0", Proceedings ofthese approaches is satisfactory for all cases. As discussed above, individual consent putstheuser's approval8th USENIX Security Symposium, 1999. Appendix A. A Proposed Security Architecture [No Consensus on This] This section contains a proposed security architecture, based on the considerations discussed in theUI flow for every call. Not only doesmain body of thisquickly become annoying but it can trainmemo. This section is currently theuser to simply click "OK", at which pointopinion of theconsent becomes useless. Thus, while it may be necssary toauthor and does not haveindividual consent inconsensus though somecase,(many?) elements of this proposal do seem to have general consensus. A.1. Trust Hierarchy The basic assumption of this proposal isnotthat network resources exist in asuitable solution for (for instance)hierarchy of trust, rooted in the browser, which serves as the user's TRUSTED COMPUTING BASE (TCB). Any security property which thecalling service case. Where necessary, in-flowuserinterfaceswishes to have enforced must becarefully designed to avoidultimately guaranteed by therisk ofbrowser (or transitively by some property the browser verifies). Conversely, if the browser is compromised, then no security guarantees are possible. Note that there are cases (e.g., Internet kiosks) where the userblindly clicking through. Thecan't really trust the browser that much. In these cases, the level of security provided is limited by how much they trust the browser. Optimally, we would not rely on trust in any entities other than the browser. However, this is unfortunately not possible if we wish to have a functional system. Other network elements fall into twooptionscategories: those which can be authenticated by the browser and thus aredesigned to restrict callspartly trusted--though to the minimum extent necessary--and those which cannot be authenticated and thus are untrusted. This is agiven target. Unfortunately, Callee-oriented consentnatural extension of the end-to-end principle. A.1.1. Authenticated Entities There are two major classes of authenticated entities in the system: o Calling services: Web sites whose origin we can verify (optimally via HTTPS). o Other users: RTC-Web peers whose origin we can verify cryptographically (optimally via DTLS-SRTP). Note that merely being authenticated does notwork wellmake these entities trusted. For instance, just becausea malicious sitewe canclaimverify thatthe user is calling any user of his choice. One fix for thishttps://www.evil.org/ isto tie calls to a cryptographically established identity. Whileowned by Dr. Evil does notsuitable for all cases, this approach may be useful for some. Ifmean that weconsider the advertising case described in Section 4.1.1.3, it's not particularly convenient to require the advertisercan trust Dr. Evil toinstantiateaccess our camera aniframe onmicrophone. However, it gives thehosting site just to get permission; a more convenient approach isuser an opportunity tocryptographically tie the advertiser's certificatedetermine whether he wishes tothe communication directly. We're still tieing permissionstrust Dr. Evil or not; after all, if he desires toorigin here, butcontact Dr. Evil, it's safe tothe media origin (and-or destination) rather thantemporarily give him access to theWeb origin. Another case where media-level cryptographic identity makes sense is when a user really does not trustcamera and microphone for thecalling site. For instance, I might be worried thatpurpose of thecalling service will attempt to bug my computer, but I also want to be able to conveniently call my friends. If consent is tied to particular communications endpoints, then my risk is limited. However, thiscall. The point here isalso notthatconvenient an interface, since managing individual user permissionswe must first identify other elements before we canbe painful. While this is primarily a question not for IETF, it should be cleardetermine whether to trust them. It's also worth noting that there are settings where authentication isno really good answer. In general, if you cannot trustnon-cryptographic, such as other machines behind a firewall. Naturally, thesite which youlevel of trust one can haveauthorized for callingin identities verified in this way depends on how strong the topology enforcement is. A.1.2. Unauthenticated Entities Other than the above entities, we are not generally able tobug you then your security situation isidentify other network elements, thus we cannot trust them. This does notreally ideal. It is RECOMMENDEDmean thatbrowsersit is not possible to haveexplicit (and obvious) indicatorsany interaction with them, but it means that we must assume that they will behave maliciously and design a system which is secure even if they do so. A.2. Overview This section describes a typical RTCWeb session and shows how the various security elements interact and what guarantees are provided to the user. The example in this section is acall"best case" scenario inorder to mitigate this risk. 4.1.3. Security Propertieswhich we provide the maximal amount of user authentication and media privacy with theCalling Page Origin-basedminimal level of trust in the calling service. Simpler versions with lower levels of securityis intendedare also possible and are noted in the text where applicable. It's also important to recognize the tension between securityagainst web attackers. However,(or performance) and privacy. The example shown here is aimed towards settings where wemust also considerare more concerned about secure calling than about privacy, but as we shall see, there are settings where one might wish to make different tradeoffs--this architecture is still compatible with those settings. For thecasepurposes ofnetwork attackers. Considerthis example, we assume thecase where Itopology shown in the figure below. This topology is derived from the topology shown in Figure 1, but separates Alice and Bob's identities from the process of signaling. Specifically, Alice and Bob havegranted permission torelationships with some Identity Provider (IDP) that supports acalling service by an originprotocol such OpenID or BrowserID) thathas the HTTP scheme, e.g., http://calling-service.example.com. If I ever use my computercan be used to attest to their identity. This separation isn't particularly important in "closed world" cases where Alice and Bob are users onan unsecured network (e.g., a hotspot or if my own home wirelessthe same social networkis insecure),andbrowse any HTTP site, then an attacker can bug my computer. The attack proceeds like this: 1. I connect to http://anything.example.org/. Notehave identities based on that network. However, there are important settings where thatthis siteisunaffiliated withnot thecalling service. 2. The attacker modifies my HTTP connectioncase, such as federation (calls from one network toinject an IFRAME (oranother) and calling on untrusted sites, such as where two users who have aredirect) to http://calling-service.example.com 3. The attacker forges the response apparently http://calling-service.example.com/ to inject JS to initiaterelationship via acallgiven social network want tohimself. Note that this attack does not dependcall each other onthe media being insecure. Because theanother, untrusted, site, such as a poker site. +----------------+ | | | Signaling | | Server | | | +----------------+ ^ ^ / \ HTTPS / \ HTTPS / \ / \ v v JS API JS API +-----------+ +-----------+ | | Media | | Alice | Browser |<---------->| Browser | Bob | | (DTLS-SRTP)| | +-----------+ +-----------+ ^ ^--+ +--^ ^ | | | | v | | v +-----------+ | | +-----------+ | |<--------+ | | | IDP | | | IDP | | | +------->| | +-----------+ +-----------+ Figure 2: A callis towith IDP-based identity A.2.1. Initial Signaling Alice and Bob are both users of a common calling service; they both have approved theattacker, it is also encryptedcalling service to make calls (we defer the discussion of device access permissions till later). They are both connected tohim. Moreover, it need not be executed immediately;theattacker can "infect"calling service via HTTPS and so know the originsemi-permanently (e.g.,witha web worker or a popunder) and thus be able to bug me long after Isome level of confidence. They also haveleft the infected network.accounts with some identity provider. Thisrisksort of identity service iscreated by allowing calls at all from a page fetched over HTTP. Even if calls are only possible from HTTPS sites, ifbecoming increasingly common in thesite embeds active content (e.g., JavaScript) thatWeb environment in technologies such (BrowserID, Federated Google Login, Facebook Connect, OAuth, OpenID, WebFinger), and isfetched over HTTPoften provided as a side effect service of your ordinary accounts with some service. In this example, we show Alice and Bob using a separate identity service, though they may actually be using the same identity service as calling service or have no identity service at all. Alice is logged onto the calling service and decides to call Bob. She can see froman untrusted site, becausethe calling service thatJavaScripthe isexecutedonline and the calling service presents a JS UI in thesecurity contextform ofthe page [finer-grained]. Thus, it is also dangerousa button next toallow RTC-Web functionality from HTTPS originsBob's name which says "Call". Alice clicks the button, which initiates a JS callback thatembed mixed content. Note: this issue isinstantiates a PeerConnection object. This does notrestricted to PAGES which contain mixed content. Ifrequire apagesecurity check: JS froma givenany originever loads mixed content then itispossible for a network attackerallowed toinfectget this far. Once thebrowser's notion of that origin semi-permanently. [[ OPEN ISSUE: What recommendation should IETF make about (a) whether RTCWeb long-term consent should be available over HTTP pagesPeerConnection is created, the calling service JS needs to set up some media. Because this is an audio/video call, it creates two MediaStreams, one connected to an audio input and(b) Howone connected tohandle origins wherea video input. At this point theconsentfirst security check is required: untrusted origins are not allowed toan HTTPS URL butaccess thepage contains active mixed content? ]] 4.2. Communications Consent Verification As discussedcamera and microphone. In this case, because Alice is a long-term user of the calling service, she has made a permissions grant (i.e., a setting inSection 3.3, allowing web applications unrestricted access totheviabrowser) to allow the calling service to access her camera and microphone any time it wants. The browsernetwork introduceschecks this setting when therisk of usingcamera and microphone requests are made and thus allows them. In the current W3C API, once some streams have been added, Alice's browseras an attack platform against machines which would not otherwise+ JS generates a signaling message The format of this data is currently undefined. It may beaccessible to the malicious site, for instance because they are topologically restricted (e.g., behindafirewallcomplete message as defined by ROAP [REF] orNAT).may be assembled piecemeal by the JS. Inorder to prevent this form of attack as well as cross-protocol attackseither case, itis importantwill contain: o Media channel information o ICE candidates o A fingerprint attribute binding the message torequire thatAlice's public key [RFC5763] Prior to sending out thetarget of traffic explicitly consentsignaling message, the PeerConnection code contacts the identity service and obtains an assertion binding Alice's identity toreceivingher fingerprint. The exact details depend on thetrafficidentity service (though as discussed inquestion. Until that consent has been verified for a given endpoint, traffic other than the consent handshake MUST NOTAppendix A.3.6.4 I believe PeerConnection can besentagnostic tothat endpoint. 4.2.1. ICE Verifying receiver consent requires some sort of explicit handshake,them), butconveniently we already need one in orderfor now it's easiest todo NAT hole- punching. ICE [RFC5245] includesthink of as ahandshake designedBrowserID assertion. This message is sent toverify thatthereceiving element wishes to receive traffic fromsignaling server, e.g., by XMLHttpRequest [REF] or by WebSockets [I-D.ietf-hybi-thewebsocketprotocol]. The signaling server processes thesender. Itmessage from Alice's browser, determines that this isimportanta call toremember here thatBob and sends a signaling message to Bob's browser (again, thesite initiating ICEformat ispresumed malicious; in order forcurrently undefined). The JS on Bob's browser processes it, and alerts Bob to thehandshakeincoming call and tobe secureAlice's identity. In this case, Alice has provided an identity assertion and so Bob's browser contacts Alice's identity provider (again, this is done in a generic way so thereceiving element MUST demonstrate receipt/knowledgebrowser has no specific knowledge ofsome value not available tothesite (thus preventing it from forging responses). In orderIDP) toachieve this objective with ICE,verity theSTUN transaction IDs must be generated byassertion. This allows the browserand MUST NOT be made availabletothe initiating script, even viadisplay adiagnostic interface. 4.2.2. Masking Once consenttrusted element indicating that a call isverified, there stillcoming in from Alice. If Alice is in Bob's address book, then this interface might also include her real name, a picture, etc. The calling site will also provide someconcern about misinterpretation attacks as described by Huang et al.[huang-w2sp]. As long as communication is limiteduser interface element (e.g., a button) toUDP, thenallow Bob to answer the call, though thisriskisprobably limited, thus maskingmost likely not part of the trusted UI. If Bob agrees [I am ignoring early media for now], a PeerConnection is instantiated with the message from Alice's side. Then, a similar process occurs as on Alice's browser: Bob's browser verifies that the calling service isnot required for UDP. I.e., once communications consent has been verified, itapproved, the media streams are created, and a return signaling message containing media information, ICE candidates, and a fingerprint ismost likely safesent back toallowAlice via theimplementation to send arbitrary UDP traffic tosignaling service. If Bob has a relationship with an IDP, thechosen destination, providedmessage will also come with an identity assertion. At this point, Alice and Bob each know that theSTUN keepalives continueother party wants tosucceed. However,have a secure call withTCPthem. Based purely on therisk of transparent proxies becomes much more severe. If TCPinterface provided by the signaling server, they know that the signaling server claims that the call is from Alice tobe used, then WebSockets style masking MUST be employed. 4.2.3. Backward Compatibility A requirement to use ICE limits compatibility with legacy non-ICE clients. It seems unsafe to completely remove the requirement for some check. All proposed checks haveBob. Because thecommon featurefar end sent an identity assertion along with their message, they know that this is verifiable from thebrowser sends some messageIDP as well. Of course, the call works perfectly well if either Alice or Bob doesn't have a relationship with an IDP; they just get a lower level of assurance. Moreover, Alice might wish to make an anonymous call through an anonymous calling site, in which case she would of course just not provide any identity assertion and thecandidate traffic recipientcalling site would mask her identity from Bob. A.2.2. Media Consent Verification As described in Section 4.2. This proposal specifies that that be performed via ICE. Thus, Alice andrefusesBob perform ICE checks with each other. At the completion of these checks, they are ready to sendother traffic until that message has been replied to. The message/reply pair must be generated in such a waynon-ICE data. At this point, Alice knows thatan attacker(a) Bob (assuming he is verified via his IDP) or someone else whocontrols the Web application cannot forge them, generally by havingthemessage contain some secret valuesignaling service is claiming is Bob is willing to exchange traffic with her and (b) thatmust be incorporated (e.g., echoed, hashed into, etc.). Non-ICE candidates for this role (in cases whereeither Bob is at thelegacy endpointIP address which she hasa public address) include: o STUN checks without usingverified via ICE(i.e., the non-RTC-web endpoint sets up a STUN responder.) o UseorRTCP asthere is animplicit reachability check. In the RTCP approach, the RTC-Web endpointattacker who isallowedon-path tosend a limited number of RTP packets prior to receiving consent. This allows a short window of attack. In addition, some legacy endpoints do not support RTCP, so thisthat IP address detouring the traffic. Note that it isa much more expensive solution for such endpoints,not possible forwhich it would likely be easier to implement ICE. For these two reasons,anRTCP-based approach doesattacker who is on-path but notseemattached toaddressthe signaling service to spoof these checks because they do not have the ICE credentials. Bob's securityissue satisfactorily. Inguarantees with respect to Alice are theSTUN approach,converse of this. A.2.3. DTLS Handshake Once theRTC-Web endpointICE checks have completed [more specifically, once some ICE checks have completed], Alice and Bob can set up a secure channel. This isable to verify thatperformed via DTLS [RFC4347] (for the data channel) and DTLS- SRTP [RFC5763] for the media channel. Specifically, Alice and Bob perform a DTLS handshake on every channel which has been established by ICE. The total number of channels depends on therecipient is running some kindamount ofSTUN endpoint but unlessmuxing; in theSTUN responder is integrated withmost likely case we are using both RTP/RTCP mux and muxing multiple media streams on theICE username/password establishment system,same channel, in which case there is only one DTLS handshake. Once theRTC-Web endpoint cannot verify thatDTLS handshake has completed, therecipient consentskeys are extracted and used to key SRTP for the media channels. At thisparticular call. This may be an issue if existing STUN servers are operated at addressespoint, Alice and Bob know that they share a set of secure data and/or media channels with keys which are notableknown tohandle bandwidth-based attacks. Thus, this approach does not seem satisfactory either.any third-party attacker. Ifthe systems are tightly integrated (i.e., the STUN endpoint responds with responsesAlice and Bob authenticatedwith ICE credentials)via their IDPs, thenthis issue doesthey also know that the signaling service is notexist. However, suchattacking them. Even if they do not use an IDP, as long as they have minimal trust in the signaling service not to perform adesignman-in-the-middle attack, they know that their communications are secure against the signaling service as well. A.2.4. Communications and Consent Freshness From a security perspective, everything from here on in isvery closea little anticlimactic: Alice and Bob exchange data protected by the keys negotiated by DTLS. Because of the security guarantees discussed in the previous sections, they know that the communications are encrypted and authenticated. The one remaining security property we need toan ICE-Lite implementation (indeed, arguablyestablish isone). An intermediate approach would be"consent freshness", i.e., allowing Alice tohave a STUN extension that indicatedverify thatone was respondingBob is still prepared toRTC-Web checks but not computing integrity checks based on thereceive her communications. ICEcredentials. This would allow the use of standalone STUN servers without the risk of confusing them with legacyspecifies periodic STUNservers. If a non-ICE legacy solution is needed, then thiskeepalizes but only if media isprobablynot flowing. Because thebest choice. [TODO: Write something aboutconsentfreshnessissue is more difficult here, we require RTCWeb implementations to periodically send keepalives. If a keepalive fails andRTCP]. [[ OPEN ISSUE: Exactly what should be the requirements here? Proposals includeno new ICEallchannels can be established, then thetime or ICE but with allowing onesession is terminated. A.3. Detailed Technical Description A.3.1. Origin and Web Security Issues The basic unit ofthese non-ICE thingspermissions forlegacy. ]] 4.3. Communications Security Finally, we consider a problem familiar fromRTC-Web is theSIP world: communications security. For obvious reasons, it MUST be possible fororigin [I-D.abarth-origin]. Because thecommunicating partiessecurity of the origin depends on being able toestablish a channel which is secure against both message recovery and message modification. (See [RFC5479] for more details.) This service mustauthenticate content from that origin, the origin can only beprovided for bothsecurely established if data is transferred over HTTPS. Thus, clients MUST treat HTTP andvoice/video. Ideally the same security mechanisms would be used for both types of content. Technology for providing this service (for instance, DTLS [RFC4347]HTTPS origins as different permissions domains andDTLS-SRTP [RFC5763]) is well understood. However, we must examine this technologySHOULD NOT permit access totheany RTC-Webcontext, where the threat model is somewhat different. In general,functionality from scripts fetched over non-secure (HTTP) origins. If an HTTPS origin contains mixed active content (regardless of whether it isimportant to understand that unlike a conventional SIP proxy, the calling service (i.e., the Web server) controls not only the channel between the communicating endpoints but also the application runningpresent on theuser's browser. While in principle it is possible for the browserspecific page attempting tocut the calling service out ofaccess RTC- Web functionality), any access MUST be treated as if it came from theloopHTTP origin. For instance, if a https://www.example.com/example.html loads https://www.example.com/example.js anddirectly present trusted information (and perhaps get consent), practice in modern browsers ishttp://www.example.org/jquery.js, any attempt by example.js toavoid this whenever possible. "In- flow" modal dialogs which require theaccess RTCWeb functionality MUST be treated as if it came from http://www.example.com/. Note that many browsers already track mixed content and either forbid it by default or display a warning. A.3.2. Device Permissions Model Implementations MUST obtain explicit usertoconsent prior tospecific actions are particularly disfavored as human factors research indicates that unless they are made extremely invasive, users simply agreeproviding access tothem without actually consciously giving consent. [abarth-rtcweb]. Thus, nearly all the UI will necessarily be rendered by the browser but under control ofthecalling service. This likely includescamera and/or microphone. Implementations MUST at minimum support thepeer'sfollowing two permissions models: o Requests for one-time camera/microphone access. o Requests for permanent access. In addition, they SHOULD support requests for access to a single communicating peer. E.g., "Call customerservice@ford.com". Browsers servicing such requests SHOULD clearly indicate that identityinformation, which, after all, is only meaningful into thecontext of some calling service. This limitation does not mean that preventing attack byuser when asking for permission. API Requirement: The API MUST provide a mechanism for thecalling service is completely hopeless. However, we needrequesting JS todistinguish between two classesindicate which ofattack: Retrospective compromisethese forms ofcalling service. The calling service ispermissions it isnon-malicious duringrequesting. This allows the client to know what sort of user interface experience to provide. In particular, browsers might display acallnon-invasive door hanger ("some features of this site may not work..." when asking for long-term permissions) butsubsequentlya more invasive UI ("here iscompromised and wishes to attack an older call. During-call attack by calling service.your own video") for single-call permissions. Thecalling service is compromised duringAPI MAY grant weaker permissions than thecallJS asked for if the user chooses to authorize only those permissions, but if itwishesintends toattack. Providing security againstgrant stronger ones SHOULD display theformer type of attack is practical usingappropriate UI for those permissions. API Requirement: The API MUST provide a mechanism for thetechniques discussed in Section 4.3.1. However, it is extremely difficultrequesting JS toprevent a trusted but malicious calling service from actively attacking a user's calls, either by mounting a MITM attackrelinquish the ability to see orby diverting them entirely. (Note thatmodify the media (e.g., via MediaStream.record()). Combined with secure authentication of the communicating peer, thisattack applies equally toallows anetwork attacker if communicationsuser to be sure that the callingservice aresite is notsecured.) We discuss some potential approachesaccessing or modifying their conversion. UI Requirement: The UI MUST clearly indicate when the user's camera andwhy theymicrophone arelikely to be impracticalinSection 4.3.2. 4.3.1. Protecting Against Retrospective Compromise In a retrospective attack, the calling service was uncompromised duringuse. This indication MUST NOT be suppressable by the JS and MUST clearly indicate how to terminate a call,but that an attacker subsequently wantsand provide a UI means torecoverimmediately stop camera/ microphone input without the JS being able to prevent it. UI Requirement: If thecontentUI indication of camera/microphone use are displayed in thecall. We assumebrowser such that minimizing theattacker has access to the protected media stream as well as having full control ofbrowser window would hide thecalling service. Ifindication, or thecalling service has access toJS creating an overlapping window would hide thetraffic keying material (as in SDES [RFC4568]),indication, thenretrospective attack is trivial. This form of attack is particularly serious intheWeb context because it is standard practice in Web services to run extensive loggingbrowser SHOULD stop camera andmonitoring. Thus, it is highly likely that ifmicrophone input. Clients MAY permit thetraffic key is partformation of data channels without anyHTTP request it will be logged somewhere and thus subject to subsequent compromise. It is this consideration that makes an automatic, public key-based key exchange mechanism imperativedirect user approval. Because sites can always tunnel data through the server, further restrictions on the data channel do not provide any additional security. (though see Appendix A.3.3 forRTC-Web (this isagood idea for any communications security system) and this mechanismrelated issue). Implementations which support some form of direct user authentication SHOULD also provideperfect forward secrecy (PFS). The signaling channel/calling servicea policy by which a user canbe usedauthorize calls only to specific counterparties. Specifically, the implementation SHOULD provide the following interfaces/controls: o Allow future calls to this verified user. o Allow future calls to any verified user who is in my system address book (this only works with address book integration, of course). Implementations SHOULD also provide a different user interface indication when calls are in progress to users whose identities are directly verifiable. Appendix A.3.5 provides more on this. A.3.3. Communications Consent Browser client implementations of RTC-Web MUST implement ICE. Server gateway implementations which operate only at public IP addresses may implement ICE-Lite. Browser implementations MUST verify reachability via ICE prior toauthenticate this mechanism. In addition, the systemsending any non-ICE packets to a given destination. Implementations MUST NOT provideany APIs to extract either long-term keying material or to directly access any stored traffic keys. Otherwise, an attacker who subsequently compromisedthecalling service might be able to use those APIsICE transaction ID torecoverJavaScript. [Note: this document takes no position on thetraffic keyssplit between ICE in JS andthus compromiseICE in thetraffic. 4.3.2. Protecting Against During-Call Attack Protecting against attacks during a callbrowser. The above text isa more difficult proposition. Evenwritten the way it is for editorial convenience and will be modified appropriately if thecalling service cannot directly access keying material (as recommendedWG decides on ICE in theprevious section), it can simply mountJS.] Implementations MUST send keepalives no less frequently than every 30 seconds regardless of whether traffic is flowing or not. If aman-in-the-middle attack onkeepalive fails then theconnection, telling Aliceimplementation MUST either attempt to find a new valid path via ICE or terminate media for thatshe is calling Bob and BobICE component. Note thathe is calling Alice, whileICE [RFC5245]; Section 10 keepalives use STUN Binding Indications which are one-way and therefore not sufficient. We will need to define a new mechanism for this. [OPEN ISSUE: what to do here.] A.3.4. IP Location Privacy As mentioned infact the calling service is acting asSection 4.2.4 above, acalling bridge and capturing allside effect of thetraffic. While in theory itdefault ICE behavior ispossible to construct techniquesthat the peer learns one's IP address, whichprotect against this formleaks large amounts ofattack,location information, especially for mobile devices. This has negative privacy consequences inpractice these techniques all require far too muchsome circumstances. The following two API requirements are intended to mitigate this issue: API Requirement: The API MUST provide a mechanism to suppress ICE negotiation (though perhaps to allow candidate gathering) until the userinterventionhas decided tobe practical, givenanswer theuser interface constraints described in [abarth-rtcweb]. 4.3.2.1. Key Continuity One natural approachcall [note: determining when the call has been answered is a question for the JS.] This enables a user touse "key continuity". Whileprevent amaliciouspeer from learning their IP address if they elect not to answer a call. API Requirement: The API MUST provide a mechanism for the callingservice can present any identity it choosesapplication to indicate that only TURN candidates are to be used. This prevents theuser, it cannot producepeer from learning one's IP address at all. A.3.5. Communications Security Implementations MUST implement DTLS and DTLS-SRTP. All data channels MUST be secured via DTLS. DTLS-SRTP MUST be offered for every media channel and MUST be the default; i.e., if an implementation receives an offer for DTLS-SRTP and SDES and/or plain RTP, DTLS-SRTP MUST be selected. [OPEN ISSUE: What should the settings be here? MUST?] Implementations MAY support SDES and RTP for media traffic for backward compatibility purposes. API Requirement: The API MUST provide aprivate keymechanism to indicate thatmapsa fresh DTLS key pair is to be generated for agiven public key. Thus, itspecific call. This ispossibleintended to allow forthe browserunlinkability. Note that there are also settings where it is attractive tonote a given user's publicuse the same keying material repeatedly, especially those with keyand generate an alarm whenevercontinuity-based authentication. API Requirement: The API MUST provide a mechanism to indicate thatuser'sa fresh DTLS keychanges. SSH [RFC4251] usespair is to be generated for asimilar technique. (Note thatspecific call. This is intended to allow for unlinkability. API Requirement: When DTLS-SRTP is used, theneedAPI MUST NOT permit the JS toavoid explicitobtain the negotiated keying material. This requirement preserves the end-to-end security of the media. UI Requirements: A user-oriented client MUST provide an "inspector" interface which allows the userconsent on every call precludesto determine thebrowser requiring an immediate manual checksecurity characteristics of thepeer's key). Unfortunately, this sort of key continuity mechanism is far less usefulmedia. [largely derived from [I-D.kaufman-rtcweb-security-ui] The following properties SHOULD be displayed "up-front" in theRTC-Web context. First, much ofbrowser chrome, i.e., without requiring thevirtue of RTC-Web (and any Web application) is that it is not bounduser toparticular piece ofask for them: * A clientsoftware. Thus, it will be not only possible but routineMUST provide a user interface through which a user may determine the security characteristics for currently-displayed audio and video stream(s) * A client MUST provide a userto use multiple browsers on different computersinterface through whichwilla user may determine the security characteristics for transmissions ofcourse have different keying material (SACRED [RFC3760] notwithstanding.) Thus, users will frequently be alertedtheir microphone audio and camera video. * The "security characteristics" MUST include an indication as tokey mismatches which are in fact completely legitimate, withwhether or not theresult that they are trained to simply click through them. As ittransmission isknown that users routinely will click through far more dire warnings [cranor-wolf], it seems extremely unlikelycryptographically protected and whether thatany key continuity mechanism will be effective rather than simply annoying. Moreover, itprotection istrivial to bypass even this kind of mechanism. Recallbased on a key thatunlike the casewas delivered out-of-band (from a server) or was generated as a result ofSSH,a pairwise negotiation. * If thebrowser neverfar endpoint was directlygets the peer's identity fromverified Appendix A.3.6 theuser. Rather, it is provided by"security characteristics" MUST include thecalling service. Even enabling a mechanism of this type would require an APIverified information. The following properties are more likely toallowrequire some "drill- down" from thecalling service to telluser: * If thebrowser "thistransmission isa call to user X". Allcryptographically protected, thecalling service needs to do to avoid triggering a key continuity warningThe algorithms in use (For example: "AES-CBC" or "Null Cipher".) * If the transmission isto tellcryptographically protected, thebrowser that "this"security characteristics" MUST indicate whether PFS isa call to user Y" where Yprovided. * If the transmission isclose to X. Even ifcryptographically protected via an end- to-end mechanism theuser actually checks"security characteristics" MUST include some mechanism to allow an out-of-band verification of theother side's name (which all available evidence indicatespeer, such as a certificate fingerprint or an SAS. A.3.6. Web-Based Peer Authentication A.3.6.1. Generic Concepts In a number of cases, it isunlikely), this would require (a)desirable for thebrowserendpoint (i.e., the browser) totrusted UIbe able toprovidedirectly identity thename and (b)endpoint on theuserother side without trusting only the signaling service tonotwhich they are connected. For instance, users may befooled by similar appearing names. 4.3.2.2. Short Authentication Strings ZRTP [RFC6189] usesmaking a"shortcall via a federated system where they wish to get direct authenticationstring" (SAS) which is derived fromof thekey agreement protocol. This SAS is designed toother side. Alternately, they may beread over the voice channel and if confirmed by both sides precludes MITM attack. The intention is that the SAS is used once and then key continuity (thoughmaking adifferent mechanism from that discussed above) is used thereafter. Unfortunately, the SAS does not offercall on apractical solutionsite which they minimally trust (such as a poker site) but to someone who has an identity on a site they do trust (such as a social network.) Recently, a number of Web-based identity technologies (OAuth, BrowserID, Facebook Connect), etc. have been developed. While theproblem ofdetails vary, what these technologies share is that they have acompromised calling service. "Voice conversion" systems,Web- based (i.e., HTTP/HTTPS identity provider) whichmodify voice from one speakerattests tomake it sound like another, areyour identity. For instance, if I have anactive area of research. These systems are already good enoughaccount at example.org, I could use the example.org identity provider tofool both automatic recognition systems [farus-conversion] and humans [kain-conversion] in many cases, and are of course likelyprove toimprove in future, especially in an environment where the user just wantsothers that I was alice@example.org. The development of these technologies allows us togetseparate calling from identity provision: I could call you onwithPoker Galaxy but identify myself as alice@example.org. Whatever thephone call. Thus, even if SASunderlying technology, the general principle iseffective today, itthat the party which islikely not to be so for much longer. Moreover, itbeing authenticated is NOT the signaling site but rather the user (and their browser). Similarly, the relying party ispossible for an attacker who controlsthe browserto allowand not theSASsignaling site. This means that the PeerConnection API MUST arrange tosucceed and then simulate call failure and reconnect, trustingtalk directly to the identity provider in a way that cannot be impersonated by the calling site. The following sections provide two examples of this. A.3.6.2. BrowserID BrowserID [https://browserid.org/] is a technology which allows a userwill not noticewith a verified email address to generate an assertion (authenticated by their identity provider) attesting to their identity (phrased as an email address). The way thatthe "no SAS" indicator has been set (which seems likely). Even were SAS secure if used, it seems exceedingly unlikelythis is used in practice is thatusers will actually use it. As discussed above,thebrowser UI constraints preclude requiringrelying party embeds JS in their site which talks to the BrowserID code (either hosted on a trusted intermediary or embedded in the browser). That code generates theSAS exchange priorassertion which is passed back tocompletingthecall and so it mustrelying party for verification. The assertion can bevoluntary; at most the browser will provide some UI indicator thatverified directly or with a Web service provided by theSAS has not yet been checked. However, it itidentity provider. It's relatively easy to extend this functionality to authenticate RTC-Web calls, as shown below. +----------------------+ +----------------------+ | | | | | Alice's Browser | | Bob's Browser | | | OFFER ------------> | | | Calling JS Code | | Calling JS Code | | ^ | | ^ | | | | | | | | v | | v | | PeerConnection | | PeerConnection | | | ^ | | | ^ | | Finger| |Signed | |Signed | | | | print | |Finger | |Finger | |"Alice"| | | |print | |print | | | | v | | | v | | | +--------------+ | | +---------------+ | | | BrowserID | | | | BrowserID | | | | Signer | | | | Verifier | | | +--------------+ | | +---------------+ | | ^ | | ^ | +-----------|----------+ +----------|-----------+ | | | Get certificate | v | Check +----------------------+ | certificate | | | | Identity |/-------------------------------+ | Provider | | | +----------------------+ The way this mechanism works iswell-known that when faced with optional mechanisms suchasfingerprints, users simply do not check them [whitten-johnny] Thus,follows. On Alice's side, Alice goes to initiate a call. 1. The calling JS instantiates a PeerConnection and tells itis highly unlikelythatusers will ever perform the SAS exchange. Once uses have checked the SAS once, key continuity is required to avoid them needing to checkiton every call. However, thisisproblematic for reasons indicatedinterested inSection 4.3.2.1. In principlehaving it authenticated via BrowserID. 2. The PeerConnection instantiates the BrowserID signer in an invisible IFRAME. The IFRAME isof course possible to render a different UI element to indicate that calls are usingtagged with anunauthenticated set of keying material (recallorigin thatthe attacker can just present a slightly different name soindicates that it was generated by theattack shows the same UI as a call to a new device or to someone you haven't called before) but as a practical matter, users simply ignore such indicators even in the rather more dire case of mixed content warnings. 4.3.2.3. Recommendations [[ OPEN ISSUE: What are the best UI recommendations to make? Proposal: take the textPeerConnection (this prevents ordinary JS from[I-D.kaufman-rtcweb-security-ui] Section 2]] [[ OPEN ISSUE: Exactly what combination of media security primitives should be specified and/or mandatory to implement? In particular, should we allow DTLS-SRTP only, or both DTLS-SRTP and SDES. Should we allow RTP for backward compatibility? ]] 5. Security Considerations This entire documentimplementing it). The BrowserID signer isabout security. 6. Acknowledgements 7. References 7.1. Normative References [RFC2119] Bradner, S., "Key words for use in RFCsprovided with Alice's fingerprint. Note that the IFRAME here does not render any UI. It is being used solely toIndicate Requirement Levels", BCP 14, RFC 2119, March 1997. 7.2. Informative References [CORS] van Kesteren, A., "Cross-Origin Resource Sharing". [I-D.abarth-origin] Barth, A., "The Web Origin Concept", draft-abarth-origin-09 (work in progress), November 2010. [I-D.ietf-hybi-thewebsocketprotocol] Fette, I. and A. Melnikov, "The WebSocket protocol", draft-ietf-hybi-thewebsocketprotocol-15 (work in progress), September 2011. [I-D.kaufman-rtcweb-security-ui] Kaufman, M., "Client Security User Interface Requirements for RTCWEB", draft-kaufman-rtcweb-security-ui-00 (workallow the browser to load the BrowserID signer inprogress), June 2011. [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, A., Peterson, J., Sparks, R., Handley, M.,isolation, especially from the calling site. 3. The BrowserID signer contacts Alice's identity provider, authenticating as Alice (likely via a cookie). 4. The identity provider returns a short-term certificate attesting to Alice's identity andE. Schooler, "SIP: Session Initiation Protocol", RFC 3261, June 2002. [RFC3552] Rescorla, E.her short-term public key. 5. The Browser-ID code signs the fingerprint andB. Korver, "Guidelinesreturns the signed assertion + certificate to the PeerConnection. [Note: there are well-understood Web mechanisms forWriting RFC Textthis that I am excluding here for simplicity.] 6. The PeerConnection returns the signed information to the calling JS code. 7. The signed assertion gets sent over the wire to Bob's browser (via the signaling service) as part of the call setup. Obviously, the format of the signed assertion varies depending onSecurity Considerations", BCP 72, RFC 3552, July 2003. [RFC3760] Gustafson, D., Just, M., and M. Nystrom, "Securely Available Credentials (SACRED) - Credential Server Framework", RFC 3760, April 2004. [RFC4251] Ylonen, T.what signaling style the WG ultimately adopts. However, for concreteness, if something like ROAP were adopted, then the entire message might look like: { "messageType":"OFFER", "callerSessionId":"13456789ABCDEF", "seq": 1 "sdp":" v=0\n o=- 2890844526 2890842807 IN IP4 192.0.2.1\n s= \n c=IN IP4 192.0.2.1\n t=2873397496 2873404696\n m=audio 49170 RTP/AVP 0\n a=fingerprint: SHA-1 \ 4A:AD:B9:B1:3F:82:18:3B:54:02:12:DF:3E:5D:49:6B:19:E5:7C:AB\n", "identity":{ "identityType":"browserid", "assertion": { "digest":"<hash of fingerprint and session IDs>", "audience": "[TBD]" "valid-until": 1308859352261, }, // signed using user's key "certificate": { "email": "rescorla@gmail.com", "public-key": "<ekrs-public-key>", "valid-until": 1308860561861, } // certificate is signed by gmail.com } } Note that we only expect to sign the fingerprint values andC. Lonvick, "The Secure Shell (SSH) Protocol Architecture", RFC 4251, January 2006. [RFC4347] Rescorla, E.the session IDs, in order to allow the JS or calling service to modify the rest of the SDP, while protecting the identity binding. [OPEN ISSUE: should we sign seq too?] [TODO: NEed to talk about Audience a bit.] On Bob's side, he receives the signed assertion as part of the call setup message andN. Modadugu, "Datagram Transport Layer Security", RFC 4347, April 2006. [RFC4568] Andreasen, F., Baugher, M.,a similar procedure happens to verify it. 1. The calling JS instantiates a PeerConnection andD. Wing, "Session Description Protocol (SDP) Security Descriptions for Media Streams", RFC 4568, July 2006. [RFC5245] Rosenberg, J., "Interactive Connectivity Establishment (ICE): A Protocol for Network Address Translator (NAT) Traversal for Offer/Answer Protocols", RFC 5245, April 2010. [RFC5479] Wing, D., Fries, S., Tschofenig, H.,provides it the relevant signaling information, including the signed assertion. 2. The PeerConnection instantiates a BrowserID verifier in an IFRAME andF. Audet, "Requirementsprovides it the signed assertion. 3. The BrowserID verifier contacts the identity provider to verify the certificate andAnalysisthen uses the key to verify the signed fingerprint. 4. Alice's verified identity is returned to the PeerConnection (it already has the fingerprint). 5. At this point, Bob's browser can display a trusted UI indication that Alice is on the other end ofMedia Security Management Protocols", RFC 5479, April 2009. [RFC5763] Fischl, J., Tschofenig, H.,the call. When Bob returns his answer, he follows the converse procedure, which provides Alice with a signed assertion of Bob's identity andE. Rescorla, "Frameworkkeying material. A.3.6.3. OAuth While OAuth is not directly designed forEstablishinguser-to-user authentication, with aSecure Real-time Transport Protocol (SRTP) Security Context Using Datagram Transport Layer Security (DTLS)", RFC 5763, May 2010. [RFC6189] Zimmermann, P., Johnston, A., and J. Callas, "ZRTP: Media Path Key Agreementlittle lateral thinking it can be made to serve. We use the following mapping of OAuth concepts to RTC-Web concepts: +----------------------+----------------------+ | OAuth | RTCWeb | +----------------------+----------------------+ | Client | Relying party | | Resource owner | Authenticating party | | Authorization server | Identity service | | Resource server | Identity service | +----------------------+----------------------+ Table 1 The idea here is that when Alice wants to authenticate to Bob (i.e., forUnicast Secure RTP", RFC 6189, April 2011. [abarth-rtcweb] Barth, A., "PromptingBob to be aware that she is calling). In order to do this, she allows Bob to see a resource on the identity provider that is bound to the call, her identity, and her public key. Then Bob retrieves theuser is security failure", RTC- Web Workshop. [cranor-wolf] Sunshine, J., Egelman, S., Almuhimedi, H., Atri, N.,resource from the identity provider, thus verifying the binding between Alice andL. cranor, "Crying Wolf: An Empirical Study of SSL Warning Effectiveness", Proceedingsthe call. Alice IDP Bob --------------------------------------------------------- Call-Id, Fingerprint -------> <------------------- Auth Code Auth Code ----------------------------------------------> <----- Get Token + Auth Code Token ---------------------> <------------- Get call-info Call-Id, Fingerprint ------> This is a modified version of a common OAuth flow, but omits the18th USENIX Security Symposium, 2009. [farus-conversion] Farrus, M., Erro, D., and J. Hernando, "Speaker Recognition Robustnessredirects required toVoice Conversion". [finer-grained] Barth, A. and C. Jackson, "Beware of Finer-Grained Origins", W2SP, 2008. [huang-w2sp] Huang, L-S., Chen, E., Barth, A., Rescorla, E., and C. Jackson, "Talkinghave the client point the resource owner toYourself for Fun and Profit", W2SP, 2011. [kain-conversion] Kain, A.the IDP, which is acting as both the resource server andM. Macon, "Designthe authorization server, since Alice already has a handle to the IDP. Above, we have referred to "Alice", but really what we mean is the PeerConnection. Specifically, the PeerConnection will instantiate an IFRAME with JS from the IDP andEvaluation ofwill use that IFRAME to communicate with the IDP, authenticating with Alice's identity (e.g., cookie). Similarly, Bob's PeerConnection instantiates an IFRAME to talk to the IDP. A.3.6.4. Generic Identity Support I believe it's possible to build aVoice Conversion Algorithm based on Spectral Envelope Mappinggeneric interface between the PeerConnection andResidual Prediction", Proceedings of ICASSP, May 2001. [whitten-johnny] Whitten, A.any identity sub-module so that the PeerConnection just gets pointed to the IDP (which the relying party either trusts or not) andJ. Tygar, "Why Johnny Can't Encrypt: A Usability Evaluation of PGP 5.0", Proceedings ofJS from the8th USENIX Security Symposium, 1999.IDP provides the concrete interfaces. However, I need to work out the details, so I'm not specifying this yet. If it works, the previous two sections will just be examples. Author's Address Eric Rescorla RTFM, Inc. 2064 Edgewood Drive Palo Alto, CA 94303 USA Phone: +1 650 678 2350 Email: ekr@rtfm.com