idnits 2.17.1 draft-ietf-rtcweb-security-arch-03.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** The abstract seems to contain references ([I-D.ietf-rtcweb-security]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. -- The document has examples using IPv4 documentation addresses according to RFC6890, but does not use any IPv6 documentation addresses. Maybe there should be IPv6 examples, too? Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to contain a disclaimer for pre-RFC5378 work, but was first submitted on or after 10 November 2008. The disclaimer is usually necessary only for documents that revise or obsolete older RFCs, and that take significant amounts of text from those RFCs. If you can contact all authors of the source material and they are willing to grant the BCP78 rights to the IETF Trust, you can and should remove the disclaimer. Otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (July 16, 2012) is 4295 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Unused Reference: 'I-D.muthu-behave-consent-freshness' is defined on line 1363, but no explicit reference was found in the text == Unused Reference: 'I-D.jennings-rtcweb-signaling' is defined on line 1404, but no explicit reference was found in the text == Outdated reference: A later version (-12) exists of draft-ietf-rtcweb-security-03 == Outdated reference: A later version (-04) exists of draft-muthu-behave-consent-freshness-01 ** Obsolete normative reference: RFC 2818 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 4347 (Obsoleted by RFC 6347) ** Obsolete normative reference: RFC 4627 (Obsoleted by RFC 7158, RFC 7159) ** Obsolete normative reference: RFC 5245 (Obsoleted by RFC 8445, RFC 8839) == Outdated reference: A later version (-26) exists of draft-ietf-rtcweb-jsep-01 Summary: 6 errors (**), 0 flaws (~~), 7 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 RTCWEB E. Rescorla 3 Internet-Draft RTFM, Inc. 4 Intended status: Standards Track July 16, 2012 5 Expires: January 17, 2013 7 RTCWEB Security Architecture 8 draft-ietf-rtcweb-security-arch-03 10 Abstract 12 The Real-Time Communications on the Web (RTCWEB) working group is 13 tasked with standardizing protocols for enabling real-time 14 communications within user-agents using web technologies (e.g 15 JavaScript). The major use cases for RTCWEB technology are real-time 16 audio and/or video calls, Web conferencing, and direct data transfer. 17 Unlike most conventional real-time systems (e.g., SIP-based soft 18 phones) RTCWEB communications are directly controlled by some Web 19 server, which poses new security challenges. For instance, a Web 20 browser might expose a JavaScript API which allows a server to place 21 a video call. Unrestricted access to such an API would allow any 22 site which a user visited to "bug" a user's computer, capturing any 23 activity which passed in front of their camera. [I-D.ietf-rtcweb- 24 security] defines the RTCWEB threat model. This document defines an 25 architecture which provides security within that threat model. 27 Legal 29 THIS DOCUMENT AND THE INFORMATION CONTAINED THEREIN ARE PROVIDED ON 30 AN "AS IS" BASIS AND THE CONTRIBUTOR, THE ORGANIZATION HE/SHE 31 REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE 32 IETF TRUST, AND THE INTERNET ENGINEERING TASK FORCE, DISCLAIM ALL 33 WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY 34 WARRANTY THAT THE USE OF THE INFORMATION THEREIN WILL NOT INFRINGE 35 ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS 36 FOR A PARTICULAR PURPOSE. 38 Status of this Memo 40 This Internet-Draft is submitted in full conformance with the 41 provisions of BCP 78 and BCP 79. 43 Internet-Drafts are working documents of the Internet Engineering 44 Task Force (IETF). Note that other groups may also distribute 45 working documents as Internet-Drafts. The list of current Internet- 46 Drafts is at http://datatracker.ietf.org/drafts/current/. 48 Internet-Drafts are draft documents valid for a maximum of six months 49 and may be updated, replaced, or obsoleted by other documents at any 50 time. It is inappropriate to use Internet-Drafts as reference 51 material or to cite them other than as "work in progress." 53 This Internet-Draft will expire on January 17, 2013. 55 Copyright Notice 57 Copyright (c) 2012 IETF Trust and the persons identified as the 58 document authors. All rights reserved. 60 This document is subject to BCP 78 and the IETF Trust's Legal 61 Provisions Relating to IETF Documents 62 (http://trustee.ietf.org/license-info) in effect on the date of 63 publication of this document. Please review these documents 64 carefully, as they describe your rights and restrictions with respect 65 to this document. Code Components extracted from this document must 66 include Simplified BSD License text as described in Section 4.e of 67 the Trust Legal Provisions and are provided without warranty as 68 described in the Simplified BSD License. 70 This document may contain material from IETF Documents or IETF 71 Contributions published or made publicly available before November 72 10, 2008. The person(s) controlling the copyright in some of this 73 material may not have granted the IETF Trust the right to allow 74 modifications of such material outside the IETF Standards Process. 75 Without obtaining an adequate license from the person(s) controlling 76 the copyright in such materials, this document may not be modified 77 outside the IETF Standards Process, and derivative works of it may 78 not be created outside the IETF Standards Process, except to format 79 it for publication as an RFC or to translate it into languages other 80 than English. 82 Table of Contents 84 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 85 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4 86 3. Trust Model . . . . . . . . . . . . . . . . . . . . . . . . . 4 87 3.1. Authenticated Entities . . . . . . . . . . . . . . . . . . 5 88 3.2. Unauthenticated Entities . . . . . . . . . . . . . . . . . 5 89 4. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 90 4.1. Initial Signaling . . . . . . . . . . . . . . . . . . . . 7 91 4.2. Media Consent Verification . . . . . . . . . . . . . . . . 9 92 4.3. DTLS Handshake . . . . . . . . . . . . . . . . . . . . . . 9 93 4.4. Communications and Consent Freshness . . . . . . . . . . . 10 94 5. Detailed Technical Description . . . . . . . . . . . . . . . . 10 95 5.1. Origin and Web Security Issues . . . . . . . . . . . . . . 10 96 5.2. Device Permissions Model . . . . . . . . . . . . . . . . . 11 97 5.3. Communications Consent . . . . . . . . . . . . . . . . . . 12 98 5.4. IP Location Privacy . . . . . . . . . . . . . . . . . . . 13 99 5.5. Communications Security . . . . . . . . . . . . . . . . . 14 100 5.6. Web-Based Peer Authentication . . . . . . . . . . . . . . 15 101 5.6.1. Trust Relationships: IdPs, APs, and RPs . . . . . . . 16 102 5.6.2. Overview of Operation . . . . . . . . . . . . . . . . 17 103 5.6.3. Items for Standardization . . . . . . . . . . . . . . 19 104 5.6.4. Binding Identity Assertions to JSEP Offer/Answer 105 Transactions . . . . . . . . . . . . . . . . . . . . . 19 106 5.6.4.1. Input to Assertion Generation Process . . . . . . 19 107 5.6.4.2. Carrying Identity Assertions . . . . . . . . . . . 20 108 5.6.5. IdP Interaction Details . . . . . . . . . . . . . . . 20 109 5.6.5.1. General Message Structure . . . . . . . . . . . . 20 110 5.6.5.2. IdP Proxy Setup . . . . . . . . . . . . . . . . . 21 111 5.7. Security Considerations . . . . . . . . . . . . . . . . . 26 112 5.7.1. Communications Security . . . . . . . . . . . . . . . 26 113 5.7.2. Privacy . . . . . . . . . . . . . . . . . . . . . . . 27 114 5.7.3. Denial of Service . . . . . . . . . . . . . . . . . . 27 115 5.7.4. IdP Authentication Mechanism . . . . . . . . . . . . . 28 116 5.7.4.1. IdP Well-known URI . . . . . . . . . . . . . . . . 29 117 5.7.4.2. Privacy of IdP-generated identities and the 118 hosting site . . . . . . . . . . . . . . . . . . . 29 119 5.7.4.3. Security of Third-Party IdPs . . . . . . . . . . . 29 120 5.7.4.4. Web Security Feature Interactions . . . . . . . . 29 121 6. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 30 122 7. Changes since -02 . . . . . . . . . . . . . . . . . . . . . . 30 123 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 30 124 8.1. Normative References . . . . . . . . . . . . . . . . . . . 30 125 8.2. Informative References . . . . . . . . . . . . . . . . . . 31 126 Appendix A. Example IdP Bindings to Specific Protocols . . . . . 32 127 A.1. BrowserID . . . . . . . . . . . . . . . . . . . . . . . . 32 128 A.2. OAuth . . . . . . . . . . . . . . . . . . . . . . . . . . 35 129 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 36 131 1. Introduction 133 The Real-Time Communications on the Web (RTCWEB) working group is 134 tasked with standardizing protocols for real-time communications 135 between Web browsers. The major use cases for RTCWEB technology are 136 real-time audio and/or video calls, Web conferencing, and direct data 137 transfer. Unlike most conventional real-time systems, (e.g., SIP- 138 based[RFC3261] soft phones) RTCWEB communications are directly 139 controlled by some Web server, as shown in Figure 1. 141 +----------------+ 142 | | 143 | Web Server | 144 | | 145 +----------------+ 146 ^ ^ 147 / \ 148 HTTP / \ HTTP 149 / \ 150 / \ 151 v v 152 JS API JS API 153 +-----------+ +-----------+ 154 | | Media | | 155 | Browser |<---------->| Browser | 156 | | | | 157 +-----------+ +-----------+ 159 Figure 1: A simple RTCWEB system 161 This system presents a number of new security challenges, which are 162 analyzed in [I-D.ietf-rtcweb-security]. This document describes a 163 security architecture for RTCWEB which addresses the threats and 164 requirements described in that document. 166 2. Terminology 168 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 169 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 170 document are to be interpreted as described in RFC 2119 [RFC2119]. 172 3. Trust Model 174 The basic assumption of this architecture is that network resources 175 exist in a hierarchy of trust, rooted in the browser, which serves as 176 the user's TRUSTED COMPUTING BASE (TCB). Any security property which 177 the user wishes to have enforced must be ultimately guaranteed by the 178 browser (or transitively by some property the browser verifies). 179 Conversely, if the browser is compromised, then no security 180 guarantees are possible. Note that there are cases (e.g., Internet 181 kiosks) where the user can't really trust the browser that much. In 182 these cases, the level of security provided is limited by how much 183 they trust the browser. 185 Optimally, we would not rely on trust in any entities other than the 186 browser. However, this is unfortunately not possible if we wish to 187 have a functional system. Other network elements fall into two 188 categories: those which can be authenticated by the browser and thus 189 are partly trusted--though to the minimum extent necessary--and those 190 which cannot be authenticated and thus are untrusted. This is a 191 natural extension of the end-to-end principle. 193 3.1. Authenticated Entities 195 There are two major classes of authenticated entities in the system: 197 o Calling services: Web sites whose origin we can verify (optimally 198 via HTTPS, but in some cases because we are on a topologically 199 restricted network, such as behind a firewall). 200 o Other users: RTCWEB peers whose origin we can verify 201 cryptographically (optimally via DTLS-SRTP). 203 Note that merely being authenticated does not make these entities 204 trusted. For instance, just because we can verify that 205 https://www.evil.org/ is owned by Dr. Evil does not mean that we can 206 trust Dr. Evil to access our camera and microphone. However, it 207 gives the user an opportunity to determine whether he wishes to trust 208 Dr. Evil or not; after all, if he desires to contact Dr. Evil 209 (perhaps to arrange for ransom payment), it's safe to temporarily 210 give him access to the camera and microphone for the purpose of the 211 call, but he doesn't want Dr. Evil to be able to access his camera 212 and microphone other than during the call. The point here is that we 213 must first identify other elements before we can determine whether 214 and how much to trust them. 216 It's also worth noting that there are settings where authentication 217 is non-cryptographic, such as other machines behind a firewall. 218 Naturally, the level of trust one can have in identities verified in 219 this way depends on how strong the topology enforcement is. 221 3.2. Unauthenticated Entities 223 Other than the above entities, we are not generally able to identify 224 other network elements, thus we cannot trust them. This does not 225 mean that it is not possible to have any interaction with them, but 226 it means that we must assume that they will behave maliciously and 227 design a system which is secure even if they do so. 229 4. Overview 231 This section describes a typical RTCWeb session and shows how the 232 various security elements interact and what guarantees are provided 233 to the user. The example in this section is a "best case" scenario 234 in which we provide the maximal amount of user authentication and 235 media privacy with the minimal level of trust in the calling service. 236 Simpler versions with lower levels of security are also possible and 237 are noted in the text where applicable. It's also important to 238 recognize the tension between security (or performance) and privacy. 239 The example shown here is aimed towards settings where we are more 240 concerned about secure calling than about privacy, but as we shall 241 see, there are settings where one might wish to make different 242 tradeoffs--this architecture is still compatible with those settings. 244 For the purposes of this example, we assume the topology shown in the 245 figure below. This topology is derived from the topology shown in 246 Figure 1, but separates Alice and Bob's identities from the process 247 of signaling. Specifically, Alice and Bob have relationships with 248 some Identity Provider (IdP) that supports a protocol such OpenID or 249 BrowserID) that can be used to attest to their identity. This 250 separation isn't particularly important in "closed world" cases where 251 Alice and Bob are users on the same social network and have 252 identities based on that network. However, there are important 253 settings where that is not the case, such as federation (calls from 254 one network to another) and calling on untrusted sites, such as where 255 two users who have a relationship via a given social network want to 256 call each other on another, untrusted, site, such as a poker site. 258 +----------------+ 259 | | 260 | Signaling | 261 | Server | 262 | | 263 +----------------+ 264 ^ ^ 265 / \ 266 HTTPS / \ HTTPS 267 / \ 268 / \ 269 v v 270 JS API JS API 271 +-----------+ +-----------+ 272 | | Media | | 273 Alice | Browser |<---------->| Browser | Bob 274 | | (DTLS-SRTP)| | 275 +-----------+ +-----------+ 276 ^ ^--+ +--^ ^ 277 | | | | 278 v | | v 279 +-----------+ | | +-----------+ 280 | |<--------+ | | 281 | IdP | | | IdP | 282 | | +------->| | 283 +-----------+ +-----------+ 285 Figure 2: A call with IdP-based identity 287 4.1. Initial Signaling 289 Alice and Bob are both users of a common calling service; they both 290 have approved the calling service to make calls (we defer the 291 discussion of device access permissions till later). They are both 292 connected to the calling service via HTTPS and so know the origin 293 with some level of confidence. They also have accounts with some 294 identity provider. This sort of identity service is becoming 295 increasingly common in the Web environment in technologies such 296 (BrowserID, Federated Google Login, Facebook Connect, OAuth, OpenID, 297 WebFinger), and is often provided as a side effect service of your 298 ordinary accounts with some service. In this example, we show Alice 299 and Bob using a separate identity service, though they may actually 300 be using the same identity service as calling service or have no 301 identity service at all. 303 Alice is logged onto the calling service and decides to call Bob. She 304 can see from the calling service that he is online and the calling 305 service presents a JS UI in the form of a button next to Bob's name 306 which says "Call". Alice clicks the button, which initiates a JS 307 callback that instantiates a PeerConnection object. This does not 308 require a security check: JS from any origin is allowed to get this 309 far. 311 Once the PeerConnection is created, the calling service JS needs to 312 set up some media. Because this is an audio/video call, it creates 313 two MediaStreams, one connected to an audio input and one connected 314 to a video input. At this point the first security check is 315 required: untrusted origins are not allowed to access the camera and 316 microphone. In this case, because Alice is a long-term user of the 317 calling service, she has made a permissions grant (i.e., a setting in 318 the browser) to allow the calling service to access her camera and 319 microphone any time it wants. The browser checks this setting when 320 the camera and microphone requests are made and thus allows them. 322 In the current W3C API, once some streams have been added, Alice's 323 browser + JS generates a signaling message [I-D.ietf-rtcweb-jsep] 324 contianing: 326 o Media channel information 327 o ICE candidates 328 o A fingerprint attribute binding the communication to Alice's 329 public key [RFC5763] 331 Prior to sending out the signaling message, the PeerConnection code 332 contacts the identity service and obtains an assertion binding 333 Alice's identity to her fingerprint. The exact details depend on the 334 identity service (though as discussed in Section 5.6 PeerConnection 335 can be agnostic to them), but for now it's easiest to think of as a 336 BrowserID assertion. The assertion may bind other information to the 337 identity besides the fingerprint, but at minimum it needs to bind the 338 fingerprint. 340 This message is sent to the signaling server, e.g., by XMLHttpRequest 341 [XmlHttpRequest] or by WebSockets [RFC6455] The signaling server 342 processes the message from Alice's browser, determines that this is a 343 call to Bob and sends a signaling message to Bob's browser (again, 344 the format is currently undefined). The JS on Bob's browser 345 processes it, and alerts Bob to the incoming call and to Alice's 346 identity. In this case, Alice has provided an identity assertion and 347 so Bob's browser contacts Alice's identity provider (again, this is 348 done in a generic way so the browser has no specific knowledge of the 349 IdP) to verify the assertion. This allows the browser to display a 350 trusted element indicating that a call is coming in from Alice. If 351 Alice is in Bob's address book, then this interface might also 352 include her real name, a picture, etc. The calling site will also 353 provide some user interface element (e.g., a button) to allow Bob to 354 answer the call, though this is most likely not part of the trusted 355 UI. 357 If Bob agrees [I am ignoring early media for now], a PeerConnection 358 is instantiated with the message from Alice's side. Then, a similar 359 process occurs as on Alice's browser: Bob's browser verifies that 360 the calling service is approved, the media streams are created, and a 361 return signaling message containing media information, ICE 362 candidates, and a fingerprint is sent back to Alice via the signaling 363 service. If Bob has a relationship with an IdP, the message will 364 also come with an identity assertion. 366 At this point, Alice and Bob each know that the other party wants to 367 have a secure call with them. Based purely on the interface provided 368 by the signaling server, they know that the signaling server claims 369 that the call is from Alice to Bob. Because the far end sent an 370 identity assertion along with their message, they know that this is 371 verifiable from the IdP as well. Of course, the call works perfectly 372 well if either Alice or Bob doesn't have a relationship with an IdP; 373 they just get a lower level of assurance. Moreover, Alice might wish 374 to make an anonymous call through an anonymous calling site, in which 375 case she would of course just not provide any identity assertion and 376 the calling site would mask her identity from Bob. 378 4.2. Media Consent Verification 380 As described in ([I-D.ietf-rtcweb-security]; Section 4.2) This 381 proposal specifies that media consent verification be performed via 382 ICE. Thus, Alice and Bob perform ICE checks with each other. At the 383 completion of these checks, they are ready to send non-ICE data. 385 At this point, Alice knows that (a) Bob (assuming he is verified via 386 his IdP) or someone else who the signaling service is claiming is Bob 387 is willing to exchange traffic with her and (b) that either Bob is at 388 the IP address which she has verified via ICE or there is an attacker 389 who is on-path to that IP address detouring the traffic. Note that 390 it is not possible for an attacker who is on-path but not attached to 391 the signaling service to spoof these checks because they do not have 392 the ICE credentials. Bob's security guarantees with respect to Alice 393 are the converse of this. 395 4.3. DTLS Handshake 397 Once the ICE checks have completed [more specifically, once some ICE 398 checks have completed], Alice and Bob can set up a secure channel. 399 This is performed via DTLS [RFC4347] (for the data channel) and DTLS- 400 SRTP [RFC5763] for the media channel. Specifically, Alice and Bob 401 perform a DTLS handshake on every channel which has been established 402 by ICE. The total number of channels depends on the amount of 403 muxing; in the most likely case we are using both RTP/RTCP mux and 404 muxing multiple media streams on the same channel, in which case 405 there is only one DTLS handshake. Once the DTLS handshake has 406 completed, the keys are exported [RFC5705] and used to key SRTP for 407 the media channels. 409 At this point, Alice and Bob know that they share a set of secure 410 data and/or media channels with keys which are not known to any 411 third-party attacker. If Alice and Bob authenticated via their IdPs, 412 then they also know that the signaling service is not attacking them. 413 Even if they do not use an IdP, as long as they have minimal trust in 414 the signaling service not to perform a man-in-the-middle attack, they 415 know that their communications are secure against the signaling 416 service as well. 418 4.4. Communications and Consent Freshness 420 From a security perspective, everything from here on in is a little 421 anticlimactic: Alice and Bob exchange data protected by the keys 422 negotiated by DTLS. Because of the security guarantees discussed in 423 the previous sections, they know that the communications are 424 encrypted and authenticated. 426 The one remaining security property we need to establish is "consent 427 freshness", i.e., allowing Alice to verify that Bob is still prepared 428 to receive her communications. ICE specifies periodic STUN 429 keepalizes but only if media is not flowing. Because the consent 430 issue is more difficult here, we require RTCWeb implementations to 431 periodically send keepalives. If a keepalive fails and no new ICE 432 channels can be established, then the session is terminated. 434 5. Detailed Technical Description 436 5.1. Origin and Web Security Issues 438 The basic unit of permissions for RTCWEB is the origin [RFC6454]. 439 Because the security of the origin depends on being able to 440 authenticate content from that origin, the origin can only be 441 securely established if data is transferred over HTTPS [RFC2818]. 442 Thus, clients MUST treat HTTP and HTTPS origins as different 443 permissions domains. [Note: this follows directly from the origin 444 security model and is stated here merely for clarity.] 446 Many web browsers currently forbid by default any active mixed 447 content on HTTPS pages. I.e., when JS is loaded from an HTTP origin 448 onto an HTTPS page, an error is displayed and the content is not 449 executed unless the user overrides the error. Any browser which 450 enforces such a policy will also not permit access to RTCWEB 451 functionality from mixed content pages. It is RECOMMENDED that 452 browsers which allow active mixed content nevertheless disable RTCWEB 453 functionality in mixed content settings. [[ OPEN ISSUE: Should this 454 be a 2119 MUST? It's not clear what set of conditions would make 455 this OK, other than that browser manufacturers have traditionally 456 been permissive here here.]] Note that it is possible for a page 457 which was not mixed content to become mixed content during the 458 duration of the call. Implementations MAY choose to terminate the 459 call or display a warning at that point, but it is also permissible 460 to ignore this condition. This is a deliberate implementation 461 complexity versus security tradeoff. [[ OPEN ISSUE:: Should we be 462 more aggressive about this?]] 464 5.2. Device Permissions Model 466 Implementations MUST obtain explicit user consent prior to providing 467 access to the camera and/or microphone. Implementations MUST at 468 minimum support the following two permissions models for HTTPS 469 origins. 471 o Requests for one-time camera/microphone access. 472 o Requests for permanent access. 474 Because HTTP origins cannot be securely established against network 475 attackers, implementations MUST NOT allow the setting of permanent 476 access permissions for HTTP origins. Implementations MAY also opt to 477 refuse all permissions grants for HTTP origins, but it is RECOMMENDED 478 that currently they support one-time camera/microphone access. 480 In addition, they SHOULD support requests for access to a single 481 communicating peer. E.g., "Call customerservice@ford.com". Browsers 482 servicing such requests SHOULD clearly indicate that identity to the 483 user when asking for permission. 485 API Requirement: The API MUST provide a mechanism for the requesting 486 JS to indicate which of these forms of permissions it is 487 requesting. This allows the browser to know what sort of user 488 interface experience to provide to the user, including what 489 permissions to request from the user and hence that to enforce 490 later. For instance, browsers might display a non-invasive door 491 hanger ("some features of this site may not work..." when asking 492 for long-term permissions) but a more invasive UI ("here is your 493 own video") for single-call permissions. The API MAY grant weaker 494 permissions than the JS asked for if the user chooses to authorize 495 only those permissions, but if it intends to grant stronger ones 496 it SHOULD display the appropriate UI for those permissions and 497 MUST clearly indicate what permissions are being requested. 499 API Requirement: The API MUST provide a mechanism for the requesting 500 JS to relinquish the ability to see or modify the media (e.g., via 501 MediaStream.record()). Combined with secure authentication of the 502 communicating peer, this allows a user to be sure that the calling 503 site is not accessing or modifying their conversion. 505 UI Requirement: The UI MUST clearly indicate when the user's camera 506 and microphone are in use. This indication MUST NOT be 507 suppressable by the JS and MUST clearly indicate how to terminate 508 a call, and provide a UI means to immediately stop camera/ 509 microphone input without the JS being able to prevent it. 511 UI Requirement: If the UI indication of camera/microphone use are 512 displayed in the browser such that minimizing the browser window 513 would hide the indication, or the JS creating an overlapping 514 window would hide the indication, then the browser SHOULD stop 515 camera and microphone input. [Note: this may not be necessary in 516 systems that are non-windows-based but that have good 517 notifications support, such as phones.] 519 Clients MAY permit the formation of data channels without any direct 520 user approval. Because sites can always tunnel data through the 521 server, further restrictions on the data channel do not provide any 522 additional security. (though see Section 5.3 for a related issue). 524 Implementations which support some form of direct user authentication 525 SHOULD also provide a policy by which a user can authorize calls only 526 to specific counterparties. Specifically, the implementation SHOULD 527 provide the following interfaces/controls: 529 o Allow future calls to this verified user. 530 o Allow future calls to any verified user who is in my system 531 address book (this only works with address book integration, of 532 course). 534 Implementations SHOULD also provide a different user interface 535 indication when calls are in progress to users whose identities are 536 directly verifiable. Section 5.5 provides more on this. 538 5.3. Communications Consent 540 Browser client implementations of RTCWEB MUST implement ICE. Server 541 gateway implementations which operate only at public IP addresses 542 MUST implement either full ICE or ICE-Lite. 544 Browser implementations MUST verify reachability via ICE prior to 545 sending any non-ICE packets to a given destination. Implementations 546 MUST NOT provide the ICE transaction ID to JavaScript during the 547 lifetime of the transaction (i.e., during the period when the ICE 548 stack would accept a new response for that transaction). [Note: 549 this document takes no position on the split between ICE in JS and 550 ICE in the browser. The above text is written the way it is for 551 editorial convenience and will be modified appropriately if the WG 552 decides on ICE in the JS.] The JS MUST NOT be permitted to control 553 the local ufrag and password, though it of course knows it. 555 While continuing consent is required, that ICE [RFC5245]; Section 10 556 keepalives STUN Binding Indications are one-way and therefore not 557 sufficient. The current WG consensus is to use ICE Binding Requests 558 for continuing consent freshness. ICE already requires that 559 implementations respond to such requests, so this approach is 560 maximally compatible. A separate document will profile the ICE 561 timers to be used [[TODO: insert REF here when available.]] 563 5.4. IP Location Privacy 565 A side effect of the default ICE behavior is that the peer learns 566 one's IP address, which leaks large amounts of location information, 567 especially for mobile devices. This has negative privacy 568 consequences in some circumstances. The API requirements in this 569 section are intended to mitigate this issue. Note that these 570 requirements are NOT intended to protect the user's IP address from a 571 malicious site. In general, the site will learn at least a user's 572 server reflexive address from any HTTP transaction. Rather, these 573 requirements are intended to allow a site to cooperate with the user 574 to hide the user's IP address from the other side of the call. 575 Hiding the user's IP address from the server requires some sort of 576 explicit privacy preserving mechanism on the client (e.g., Torbutton 577 [https://www.torproject.org/torbutton/]) and is out of scope for this 578 specification. 580 API Requirement: The API MUST provide a mechanism to allow the JS to 581 suppress ICE negotiation (though perhaps to allow candidate 582 gathering) until the user has decided to answer the call [note: 583 determining when the call has been answered is a question for the 584 JS.] This enables a user to prevent a peer from learning their IP 585 address if they elect not to answer a call and also from learning 586 whether the user is online. 588 API Requirement: The API MUST provide a mechanism for the calling 589 application JS to indicate that only TURN candidates are to be 590 used. This prevents the peer from learning one's IP address at 591 all. 593 API Requirement: The API MUST provide a mechanism for the calling 594 application to reconfigure an existing call to add non-TURN 595 candidates. Taken together, this and the previous requirement 596 allow ICE negotiation to start immediately on incoming call 597 notification, thus reducing post-dial delay, but also to avoid 598 disclosing the user's IP address until they have decided to 599 answer. They also allow users to completely hide their IP address 600 for the duration of the call. Finally, they allow a mechanism for 601 the user to optimize performance by reconfiguring to allow non- 602 turn candidates during an active call if the user decides they no 603 longer need to hide their IP address 605 5.5. Communications Security 607 Implementations MUST implement DTLS [RFC4347] and DTLS-SRTP 608 [RFC5763][RFC5764]. All data channels MUST be secured via DTLS. 609 DTLS-SRTP MUST be offered for every media channel and MUST be the 610 default; i.e., if an implementation receives an offer for DTLS-SRTP 611 and SDES, DTLS-SRTP MUST be selected. Media traffic MUST NOT be sent 612 over plain (unencrypted) RTP. 614 [OPEN ISSUE: What should the settings be here? MUST?] 615 Implementations MAY support SDES for media traffic for backward 616 compatibility purposes. 618 API Requirement: The API MUST provide a mechanism to indicate that a 619 fresh DTLS key pair is to be generated for a specific call. This 620 is intended to allow for unlinkability. Note that there are also 621 settings where it is attractive to use the same keying material 622 repeatedly, especially those with key continuity-based 623 authentication. 625 API Requirement: When DTLS-SRTP is used, the API MUST NOT permit the 626 JS to obtain the negotiated keying material. This requirement 627 preserves the end-to-end security of the media. 629 UI Requirements: A user-oriented client MUST provide an 630 "inspector" interface which allows the user to determine the 631 security characteristics of the media. [largely derived from 632 [I-D.kaufman-rtcweb-security-ui] 633 The following properties SHOULD be displayed "up-front" in the 634 browser chrome, i.e., without requiring the user to ask for them: 636 * A client MUST provide a user interface through which a user may 637 determine the security characteristics for currently-displayed 638 audio and video stream(s) 640 * A client MUST provide a user interface through which a user may 641 determine the security characteristics for transmissions of 642 their microphone audio and camera video. 643 * The "security characteristics" MUST include an indication as to 644 whether the cryptographic keys were delivered out-of-band (from 645 a server) or were generated as a result of a pairwise 646 negotiation. 647 * If the far endpoint was directly verified, either via a third- 648 party verifiable X.509 certificate or via a Web IdP mechanism 649 (see Section 5.6) the "security characteristics" MUST include 650 the verified information. 652 The following properties are more likely to require some "drill- 653 down" from the user: 655 * The "security characteristics" MUST indicate the cryptographic 656 algorithms in use (For example: "AES-CBC" or "Null Cipher".) 657 * The "security characteristics" MUST indicate whether PFS is 658 provided. 659 * The "security characteristics" MUST include some mechanism to 660 allow an out-of-band verification of the peer, such as a 661 certificate fingerprint or an SAS. 663 5.6. Web-Based Peer Authentication 665 In a number of cases, it is desirable for the endpoint (i.e., the 666 browser) to be able to directly identity the endpoint on the other 667 side without trusting only the signaling service to which they are 668 connected. For instance, users may be making a call via a federated 669 system where they wish to get direct authentication of the other 670 side. Alternately, they may be making a call on a site which they 671 minimally trust (such as a poker site) but to someone who has an 672 identity on a site they do trust (such as a social network.) 674 Recently, a number of Web-based identity technologies (OAuth, 675 BrowserID, Facebook Connect), etc. have been developed. While the 676 details vary, what these technologies share is that they have a Web- 677 based (i.e., HTTP/HTTPS) identity provider which attests to your 678 identity. For instance, if I have an account at example.org, I could 679 use the example.org identity provider to prove to others that I was 680 alice@example.org. The development of these technologies allows us 681 to separate calling from identity provision: I could call you on 682 Poker Galaxy but identify myself as alice@example.org. 684 Whatever the underlying technology, the general principle is that the 685 party which is being authenticated is NOT the signaling site but 686 rather the user (and their browser). Similarly, the relying party is 687 the browser and not the signaling site. Thus, the browser MUST 688 securely generate the input to the IdP assertion process and MUST 689 securely display the results of the verification process to the user 690 in a way which cannot be imitated by the calling site. 692 The mechanisms defined in this document do not require the browser to 693 implement any particular identity protocol or to support any 694 particular IdP. Instead, this document provides a generic interface 695 which any IdP can implement. Thus, new IdPs and protocols can be 696 introduced without change to either the browser or the calling 697 service. This avoids the need to make a commitment to any particular 698 identity protocol, although browsers may opt to directly implement 699 some identity protocols in order to provide superior performance or 700 UI properties. 702 5.6.1. Trust Relationships: IdPs, APs, and RPs 704 Any federated identity protocol has three major participants: 706 Authenticating Party (AP): The entity which is trying to establish 707 its identity. 709 Identity Provider (IdP): The entity which is vouching for the AP's 710 identity. 712 Relying Party (RP): The entity which is trying to verify the AP's 713 identity. 715 The AP and the IdP have an account relationship of some kind: the AP 716 registers with the IdP and is able to subsequently authenticate 717 directly to the IdP (e.g., with a password). This means that the 718 browser must somehow know which IdP(s) the user has an account 719 relationship with. This can either be something that the user 720 configures into the browser or that is configured at the calling site 721 and then provided to the PeerConnection by the calling site. 723 At a high level there are two kinds of IdPs: 725 Authoritative: IdPs which have verifiable control of some section 726 of the identity space. For instance, in the realm of e-mail, the 727 operator of "example.com" has complete control of the namespace 728 ending in "@example.com". Thus, "alice@example.com" is whoever 729 the operator says it is. Examples of systems with authoritative 730 identity providers include DNSSEC, RFC 4474, and Facebook Connect 731 (Facebook identities only make sense within the context of the 732 Facebook system). 734 Third-Party: IdPs which don't have control of their section of the 735 identity space but instead verify user's identities via some 736 unspecified mechanism and then attest to it. Because the IdP 737 doesn't actually control the namespace, RPs need to trust that the 738 IdP is correctly verifying AP identities, and there can 739 potentially be multiple IdPs attesting to the same section of the 740 identity space. Probably the best-known example of a third-party 741 identity provider is SSL certificates, where there are a large 742 number of CAs all of whom can attest to any domain name. 744 If an AP is authenticating via an authoritative IdP, then the RP does 745 not need to explicitly trust the IdP at all: as long as the RP knows 746 how to verify that the IdP indeed made the relevant identity 747 assertion (a function provided by the mechanisms in this document), 748 then any assertion it makes about an identity for which it is 749 authoritative is directly verifiable. 751 By contrast, if an AP is authenticating via a third-party IdP, the RP 752 needs to explicitly trust that IdP (hence the need for an explicit 753 trust anchor list in PKI-based SSL/TLS clients). The list of 754 trustable IdPs needs to be configured directly into the browser, 755 either by the user or potentially by the browser manufacturer. This 756 is a significant advantage of authoritative IdPs and implies that if 757 third-party IdPs are to be supported, the potential number needs to 758 be fairly small. 760 5.6.2. Overview of Operation 762 In order to provide security without trusting the calling site, the 763 PeerConnection component of the browser must interact directly with 764 the IdP. The details of the mechanism are described in the W3C API 765 specification, but the general idea is that the PeerConnection 766 component downloads JS from a specific location on the IdP dictated 767 by the IdP domain name. That JS (the "IdP proxy") runs in an 768 isolated security context within the browser and the PeerConnection 769 talks to it via a secure message passing channel. 771 +------------------------------------+ 772 | https://calling-site.example.com | 773 | | 774 | | 775 | | 776 | Calling JS Code | 777 | ^ | 778 | | API Calls | 779 | v | 780 | PeerConnection | 781 | ^ | 782 | | postMessage() | 783 | v | 784 | +-------------------------+ | +---------------+ 785 | | https://idp.example.org | | | | 786 | | |<--------->| Identity | 787 | | IdP JS | | | Provider | 788 | | | | | | 789 | +-------------------------+ | +---------------+ 790 | | 791 +------------------------------------+ 793 When the PeerConnection object wants to interact with the IdP, the 794 sequence of events is as follows: 796 1. The browser (the PeerConnection component) instantiates an IdP 797 proxy with its source at the IdP. This allows the IdP to load 798 whatever JS is necessary into the proxy, which runs in the IdP's 799 security context. 800 2. If the user is not already logged in, the IdP does whatever is 801 required to log them in, such as soliciting a username and 802 password. 803 3. Once the user is logged in, the IdP proxy notifies the browser 804 that it is ready. 805 4. The browser and the IdP proxy communicate via a standardized 806 series of messages delivered via postMessage. For instance, the 807 browser might request the IdP proxy to sign or verify a given 808 identity assertion. 810 This approach allows us to decouple the browser from any particular 811 identity provider; the browser need only know how to load the IdP's 812 JavaScript--which is deterministic from the IdP's identity--and the 813 generic protocol for requesting and verifying assertions. The IdP 814 provides whatever logic is necessary to bridge the generic protocol 815 to the IdP's specific requirements. Thus, a single browser can 816 support any number of identity protocols, including being forward 817 compatible with IdPs which did not exist at the time the browser was 818 written. 820 5.6.3. Items for Standardization 822 In order to make this work, we must standardize the following items: 824 o The precise information from the signaling message that must be 825 cryptographically bound to the user's identity and a mechanism for 826 carrying assertions in JSEP messages. Section 5.6.4 827 o The interface to the IdP. Section 5.6.5 specifies a specific 828 protocol mechanism which allows the use of any identity protocol 829 without requiring specific further protocol support in the browser 830 o The JavaScript interfaces which the calling application can use to 831 specify the IdP to use to generate assertions and to discover what 832 assertions were received. 834 The first two items are defined in this document. The final one is 835 defined in the companion W3C WebRTC API specification [TODO:REF] 837 5.6.4. Binding Identity Assertions to JSEP Offer/Answer Transactions 839 5.6.4.1. Input to Assertion Generation Process 841 As discussed above, an identity assertion binds the user's identity 842 (as asserted by the IdP) to the JSEP offer/exchange transaction and 843 specifically to the media. In order to achieve this, the 844 PeerConnection must provide the DTLS-SRTP fingerprint to be bound to 845 the identity. This is provided in a JSON structure for 846 extensibility, as shown below: 848 { 849 "fingerprint" : 850 { 851 "algorithm":"SHA-1", 852 "digest":"4A:AD:B9:B1:3F:...:E5:7C:AB" 853 } 854 } 856 The "algorithm" and digest values correspond directly to the 857 algorithm and digest in the a=fingerprint line of the SDP. 859 Note: this structure does not need to be interpreted by the IdP or 860 the IdP proxy. It is consumed solely by the RP's browser. The IdP 861 merely treats it as an opaque value to be attested to. Thus, new 862 parameters can be added to the assertion without modifying the IdP. 864 5.6.4.2. Carrying Identity Assertions 866 Once an IdP has generated an assertion, the JSEP message. This is 867 done by adding a new a-line to the SDP, of the form a=identity. The 868 sole contents of this value are a base-64-encoded version of the 869 identity assertion. For example: 871 v=0 872 o=- 1181923068 1181923196 IN IP4 ua1.example.com 873 s=example1 874 c=IN IP4 ua1.example.com 875 a=setup:actpass 876 a=fingerprint: SHA-1 \ 877 4A:AD:B9:B1:3F:82:18:3B:54:02:12:DF:3E:5D:49:6B:19:E5:7C:AB 878 a=identity: \ 879 ImlkcCI6eyJkb21haW4iOiAiZXhhbXBsZS5vcmciLCAicHJvdG9jb2wiOiAiYm9n \ 880 dXMifSwiYXNzZXJ0aW9uIjpcIntcImlkZW50aXR5XCI6XCJib2JAZXhhbXBsZS5v \ 881 cmdcIixcImNvbnRlbnRzXCI6XCJhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3l6XCIs \ 882 XCJzaWduYXR1cmVcIjpcIjAxMDIwMzA0MDUwNlwifSJ9Cg== 883 t=0 0 884 m=audio 6056 RTP/AVP 0 885 a=sendrecv 886 a=tcap:1 UDP/TLS/RTP/SAVP RTP/AVP 887 a=pcfg:1 t=1 889 Each identity attribute should be paired (and attests to) with an 890 a=fingerprint attribute and therefore can exist either at the session 891 or media level. Multiple identity attributes may appear at either 892 level, though implementations are discouraged from doing this unless 893 they have a clear idea of what security claim they intend to be 894 making. 896 5.6.5. IdP Interaction Details 898 5.6.5.1. General Message Structure 900 Messages between the PeerConnection object and the IdP proxy are 901 formatted using JSON [RFC4627]. For instance, the PeerConnection 902 would request a signature with the following "SIGN" message: 904 { 905 "type":"SIGN", 906 "id": "1", 907 "origin":"https://calling-site.example.com", 908 "message":"012345678abcdefghijkl" 909 } 911 All messages MUST contain a "type" field which indicates the general 912 meaning of the message. 914 All requests from the PeerConnection object MUST contain an "id" 915 field which MUST be unique for that PeerConnection object. Any 916 responses from the IdP proxy MUST contain the same id in response, 917 which allows the PeerConnection to correlate requests and responses. 919 All requests from the PeerConnection object MUST contain an "origin" 920 field containing the origin of the JS which initiated the PC (i.e., 921 the URL of the calling site). This origin value can be used by the 922 IdP to make access control decisions. For instance, an IdP might 923 only issue identity assertions for certain calling services in the 924 same way that some IdPs require that relying Web sites have an API 925 key before learning user identity. 927 Any message-specific data is carried in a "message" field. Depending 928 on the message type, this may either be a string or a richer JSON 929 object. 931 5.6.5.1.1. Errors 933 If an error occurs, the IdP sends a message of type "ERROR". The 934 message MAY have an "error" field containing freeform text data which 935 containing additional information about what happened. For instance: 937 { 938 "type":"ERROR", 939 "error":"Signature verification failed" 940 } 942 Figure 3: Example error 944 5.6.5.2. IdP Proxy Setup 946 In order to perform an identity transaction, the PeerConnection must 947 first create an IdP proxy. While the details of this are specified 948 in the W3C API document, from the perspective of this specification, 949 however, the relevant facts are: 951 o The JS runs in the IdP's security context with the base page 952 retrieved from the URL specified in Section 5.6.5.2.1 953 o The usual browser sandbox isolation mechanisms MUST be enforced 954 with respect to the IdP proxy. 955 o JS running in the IdP proxy MUST be able to send and receive 956 messages to the PeerConnection and the PC and IdP proxy are able 957 to verify the source and destination of these messages. 959 Initially the IdP proxy is in an unready state; the IdP JS must be 960 loaded and there may be several round trips to the IdP server, for 961 instance to log the user in. When the IdP proxy is ready to receive 962 commands, it delivers a "ready" message. As this message is 963 unsolicited, it simply contains: 965 { "type":"READY" } 967 [[ OPEN ISSUE: if the W3C half of this converges on WebIntents, then 968 the READY message will not be necessary.]] 970 Once the PeerConnection object receives the ready message, it can 971 send commands to the IdP proxy. 973 5.6.5.2.1. Determining the IdP URI 975 Each IdP proxy instance is associated with two values: 977 domain name: The IdP's domain name 978 protocol: The specific IdP protocol which the IdP is using. This is 979 a completely IdP-specific string, but allows an IdP to implement 980 two protocols in parallel. This value may be the empty string. 982 Each IdP MUST serve its initial entry page (i.e., the one loaded by 983 the IdP proxy) from the well-known URI specified in "/.well-known/ 984 idp-proxy/" on the IdP's web site. This URI MUST be loaded 985 via HTTPS [RFC2818]. For example, for the IdP "identity.example.com" 986 and the protocol "example", the URL would be: 988 https://example.com/.well-known/idp-proxy/example 990 5.6.5.2.1.1. Authenticating Party 992 How an AP determines the appropriate IdP domain is out of scope of 993 this specification. In general, however, the AP has some actual 994 account relationship with the IdP, as this identity is what the IdP 995 is attesting to. Thus, the AP somehow supplies the IdP information 996 to the browser. Some potential mechanisms include: 998 o Provided by the user directly. 999 o Selected from some set of IdPs known to the calling site. E.g., a 1000 button that shows "Authenticate via Facebook Connect" 1002 5.6.5.2.1.2. Relying Party 1004 Unlike the AP, the RP need not have any particular relationship with 1005 the IdP. Rather, it needs to be able to process whatever assertion 1006 is provided by the AP. As the assertion contains the IdP's identity, 1007 the URI can be constructed directly from the assertion, and thus the 1008 RP can directly verify the technical validity of the assertion with 1009 no user interaction. Authoritative assertions need only be 1010 verifiable. Third-party assertions also MUST be verified against 1011 local policy, as described in Section 5.6.5.2.3.1. 1013 5.6.5.2.2. Requesting Assertions 1015 In order to request an assertion, the PeerConnection sends a "SIGN" 1016 message. Aside from the mandatory fields, this message has a 1017 "message" field containing a string. The contents of this string are 1018 defined above, but are opaque from the perspective of the IdP. 1020 A successful response to a "SIGN" message contains a message field 1021 which is a JS dictionary dictionary consisting of two fields: 1023 idp: A dictionary containing the domain name of the provider and the 1024 protocol string 1025 assertion: An opaque field containing the assertion itself. This is 1026 only interpretable by the idp or its proxy. 1028 Figure 4 shows an example transaction, with the message "abcde..." 1029 (remember, the messages are opaque at this layer) being signed and 1030 bound to identity "ekr@example.org". In this case, the message has 1031 presumably been digitally signed/MACed in some way that the IdP can 1032 later verify it, but this is an implementation detail and out of 1033 scope of this document. Line breaks are inserted solely for 1034 readability. 1036 PeerConnection -> IdP proxy: 1037 { 1038 "type":"SIGN", 1039 "id":1, 1040 "origin":"https://calling-service.example.com/", 1041 "message":"abcdefghijklmnopqrstuvwyz" 1042 } 1044 IdPProxy -> PeerConnection: 1045 { 1046 "type":"SUCCESS", 1047 "id":1, 1048 "message": { 1049 "idp":{ 1050 "domain": "example.org" 1051 "protocol": "bogus" 1052 }, 1053 "assertion":\"{\"identity\":\"bob@example.org\", 1054 \"contents\":\"abcdefghijklmnopqrstuvwyz\", 1055 \"signature\":\"010203040506\"}" 1056 } 1057 } 1059 Figure 4: Example assertion request 1061 5.6.5.2.3. Verifying Assertions 1063 In order to verify an assertion, an RP sends a "VERIFY" message to 1064 the IdP proxy containing the assertion supplied by the AP in the 1065 "message" field. 1067 The IdP proxy verifies the assertion. Depending on the identity 1068 protocol, this may require one or more round trips to the IdP. For 1069 instance, an OAuth-based protocol will likely require using the IdP 1070 as an oracle, whereas with BrowserID the IdP proxy can likely verify 1071 the signature on the assertion without contacting the IdP, provided 1072 that it has cached the IdP's public key. 1074 Regardless of the mechanism, if verification succeeds, a successful 1075 response from the IdP proxy MUST contain a message field consisting 1076 of a dictionary/hash with the following fields: 1078 identity The identity of the AP from the IdP's perspective. Details 1079 of this are provided in Section 5.6.5.2.3.1 1081 contents The original unmodified string provided by the AP in the 1082 original SIGN request. 1084 Figure 5 shows an example transaction. Line breaks are inserted 1085 solely for readability. 1087 PeerConnection -> IdP Proxy: 1088 { 1089 "type":"VERIFY", 1090 "id":2, 1091 "origin":"https://calling-service.example.com/", 1092 "message":\"{\"identity\":\"bob@example.org\", 1093 \"contents\":\"abcdefghijklmnopqrstuvwyz\", 1094 \"signature\":\"010203040506\"}" 1095 } 1097 IdP Proxy -> PeerConnection: 1098 { 1099 "type":"SUCCESS", 1100 "id":2, 1101 "message": { 1102 "identity" : { 1103 "name" : "bob@example.org", 1104 "displayname" : "Bob" 1105 }, 1106 "contents":"abcdefghijklmnopqrstuvwyz" 1107 } 1108 } 1110 Figure 5: Example verification request 1112 5.6.5.2.3.1. Identity Formats 1114 Identities passed from the IdP proxy to the PeerConnection are 1115 structured as JSON dictionaries with one mandatory field: "name". 1116 This field MUST consist of an RFC822-formatted string representing 1117 the user's identity. [[ OPEN ISSUE: Would it be better to have a 1118 typed field? ]] The PeerConnection API MUST check this string as 1119 follows: 1121 1. If the RHS of the string is equal to the domain name of the IdP 1122 proxy, then the assertion is valid, as the IdP is authoritative 1123 for this domain. 1124 2. If the RHS of the string is not equal to the domain name of the 1125 IdP proxy, then the PeerConnection object MUST reject the 1126 assertion unless (a) the IdP domain is listed as an acceptable 1127 third-party IdP and (b) local policy is configured to trust this 1128 IdP domain for the RHS of the identity string. 1130 Sites which have identities that do not fit into the RFC822 style 1131 (for instance, Facebook ids are simple numeric values) SHOULD convert 1132 them to this form by appending their IdP domain (e.g., 1133 12345@identity.facebook.com), thus ensuring that they are 1134 authoritative for the identity. 1136 The IdP proxy MAY also include a "displayname" field which contains a 1137 more user-friendly identity assertion. Browsers SHOULD take care in 1138 the UI to distinguish the "name" assertion which is verifiable 1139 directly from the "displayname" which cannot be verified and thus 1140 relies on trust in the IdP. In future, we may define other fields to 1141 allow the IdP to provide more information to the browser. [[OPEN 1142 ISSUE: Should this field exist? Is it confusing? ]] 1144 5.7. Security Considerations 1146 Much of the security analysis of this problem is contained in 1147 [I-D.ietf-rtcweb-security] or in the discussion of the particular 1148 issues above. In order to avoid repetition, this section focuses on 1149 (a) residual threats that are not addressed by this document and (b) 1150 threats produced by failure/misbehavior of one of the components in 1151 the system. 1153 5.7.1. Communications Security 1155 While this document favors DTLS-SRTP, it permits a variety of 1156 communications security mechanisms and thus the level of 1157 communications security actually provided varies considerably. Any 1158 pair of implementations which have multiple security mechanisms in 1159 common are subject to being downgraded to the weakest of those common 1160 mechanisms by any attacker who can modify the signaling traffic. If 1161 communications are over HTTP, this means any on-path attacker. If 1162 communications are over HTTPS, this means the signaling server. 1163 Implementations which wish to avoid downgrade attack should only 1164 offer the strongest available mechanism, which is DTLS/DTLS-SRTP. 1165 Note that the implication of this choice will be that interop to non- 1166 DTLS-SRTP devices will need to happen through gateways. 1168 Even if only DTLS/DTLS-SRTP are used, the signaling server can 1169 potentially mount a man-in-the-middle attack unless implementations 1170 have some mechanism for independently verifying keys. The UI 1171 requirements in Section 5.5 are designed to provide such a mechanism 1172 for motivated/security conscious users, but are not suitable for 1173 general use. The identity service mechanisms in Section 5.6 are more 1174 suitable for general use. Note, however, that a malicious signaling 1175 service can strip off any such identity assertions, though it cannot 1176 forge new ones. Note that all of the third-party security mechanisms 1177 available (whether X.509 certificates or a third-party IdP) rely on 1178 the security of the third party--this is of course also true of your 1179 connection to the Web site itself. Users who wish to assure 1180 themselves of security against a malicious identity provider can only 1181 do so by verifying peer credentials directly, e.g., by checking the 1182 peer's fingerprint against a value delivered out of band. 1184 5.7.2. Privacy 1186 The requirements in this document are intended to allow: 1188 o Users to participate in calls without revealing their location. 1189 o Potential callees to avoid revealing their location and even 1190 presence status prior to agreeing to answer a call. 1192 However, these privacy protections come at a performance cost in 1193 terms of using TURN relays and, in the latter case, delaying ICE. 1194 Sites SHOULD make users aware of these tradeoffs. 1196 Note that the protections provided here assume a non-malicious 1197 calling service. As the calling service always knows the users 1198 status and (absent the use of a technology like Tor) their IP 1199 address, they can violate the users privacy at will. Users who wish 1200 privacy against the calling sites they are using must use separate 1201 privacy enhancing technologies such as Tor. Combined RTCWEB/Tor 1202 implementations SHOULD arrange to route the media as well as the 1203 signaling through Tor. [Currently this will produce very suboptimal 1204 performance.] 1206 5.7.3. Denial of Service 1208 The consent mechanisms described in this document are intended to 1209 mitigate denial of service attacks in which an attacker uses clients 1210 to send large amounts of traffic to a victim without the consent of 1211 the victim. While these mechanisms are sufficient to protect victims 1212 who have not implemented RTCWEB at all, RTCWEB implementations need 1213 to be more careful. 1215 Consider the case of a call center which accepts calls via RTCWeb. 1216 An attacker proxies the call center's front-end and arranges for 1217 multiple clients to initiate calls to the call center. Note that 1218 this requires user consent in many cases but because the data channel 1219 does not need consent, he can use that directly. Since ICE will 1220 complete, browsers can then be induced to send large amounts of data 1221 to the victim call center if it supports the data channel at all. 1222 Preventing this attack requires that automated RTCWEB 1223 implemementations implement sensible flow control and have the 1224 ability to triage out (i.e., stop responding to ICE probes on) calls 1225 which are behaving badly, and especially to be prepared to remotely 1226 throttle the data channel in the absence of plausible audio and video 1227 (which the attacker cannot control). 1229 Another related attack is for the signaling service to swap the ICE 1230 candidates for the audio and video streams, thus forcing a browser to 1231 send video to the sink that the other victim expects will contain 1232 audio (perhaps it is only expecting audio!) potentially causing 1233 overload. Muxing multiple media flows over a single transport makes 1234 it harder to individually suppress a single flow by denying ICE 1235 keepalives. Either media-level (RTCP) mechanisms must be used or the 1236 implementation must deny responses entirely, thus termnating the 1237 call. 1239 Yet another attack, suggested by Magnus Westerlund, is for the 1240 attacker to cross-connect offers and answers as follows. It induces 1241 the victim to make a call and then uses its control of other users 1242 browsers to get them to attempt a call to someone. It then 1243 translates their offers into apparent answers to the victim, which 1244 looks like large-scale parallel forking. The victim still responds 1245 to ICE responses and now the browsers all try to send media to the 1246 victim. Implementations can defend themselves from this attack by 1247 only responding to ICE Binding Requests for a limited number of 1248 remote ufrags (this is the reason for the requirement that the JS not 1249 be able to control the ufrag and password). 1251 Note that attacks based on confusing one end or the other about 1252 consent are possible even in the face of the third-party identity 1253 mechanism as long as major parts of the signaling messages are not 1254 signed. On the other hand, signing the entire message severely 1255 restricts the capabilities of the calling application, so there are 1256 difficult tradeoffs here. 1258 5.7.4. IdP Authentication Mechanism 1260 This mechanism relies for its security on the IdP and on the 1261 PeerConnection correctly enforcing the security invariants described 1262 above. At a high level, the IdP is attesting that the user 1263 identified in the assertion wishes to be associated with the 1264 assertion. Thus, it must not be possible for arbitrary third parties 1265 to get assertions tied to a user or to produce assertions that RPs 1266 will accept. 1268 5.7.4.1. IdP Well-known URI 1270 As described in Section 5.6.5.2.1 the IdP proxy HTML/JS landing page 1271 is located at a well-known URI based on the IdP's domain name. This 1272 requirement prevents an attacker who can write some resources at the 1273 IdP (e.g., on one's Facebook wall) from being able to impersonate the 1274 IdP. 1276 5.7.4.2. Privacy of IdP-generated identities and the hosting site 1278 Depending on the structure of the IdP's assertions, the calling site 1279 may learn the user's identity from the perspective of the IdP. In 1280 many cases this is not an issue because the user is authenticating to 1281 the site via the IdP in any case, for instance when the user has 1282 logged in with Facebook Connect and is then authenticating their call 1283 with a Facebook identity. However, in other case, the user may not 1284 have already revealed their identity to the site. In general, IdPs 1285 SHOULD either verify that the user is willing to have their identity 1286 revealed to the site (e.g., through the usual IdP permissions dialog) 1287 or arrange that the identity information is only available to known 1288 RPs (e.g., social graph adjacencies) but not to the calling site. 1289 The "origin" field of the signature request can be used to check that 1290 the user has agreed to disclose their identity to the calling site; 1291 because it is supplied by the PeerConnection it can be trusted to be 1292 correct. 1294 5.7.4.3. Security of Third-Party IdPs 1296 As discussed above, each third-party IdP represents a new universal 1297 trust point and therefore the number of these IdPs needs to be quite 1298 limited. Most IdPs, even those which issue unqualified identities 1299 such as Facebook, can be recast as authoritative IdPs (e.g., 1300 123456@facebook.com). However, in such cases, the user interface 1301 implications are not entirely desirable. One intermediate approach 1302 is to have special (potentially user configurable) UI for large 1303 authoritative IdPs, thus allowing the user to instantly grasp that 1304 the call is being authenticated by Facebook, Google, etc. 1306 5.7.4.4. Web Security Feature Interactions 1308 A number of optional Web security features have the potential to 1309 cause issues for this mechanism, as discussed below. 1311 5.7.4.4.1. Popup Blocking 1313 If the user is not already logged into the IdP, the IdP proxy may 1314 need to pop up a top level window in order to prompt the user for 1315 their authentication information (it is bad practice to do this in an 1316 IFRAME inside the window because then users have no way to determine 1317 the destination for their password). If the user's browser is 1318 configured to prevent popups, this may fail (depending on the exact 1319 algorithm that the popup blocker uses to suppress popups). It may be 1320 necessary to provide a standardized mechanism to allow the IdP proxy 1321 to request popping of a login window. Note that care must be taken 1322 here to avoid PeerConnection becoming a general escape hatch from 1323 popup blocking. One possibility would be to only allow popups when 1324 the user has explicitly registered a given IdP as one of theirs (this 1325 is only relevant at the AP side in any case). This is what 1326 WebIntents does, and the problem would go away if WebIntents is used. 1328 5.7.4.4.2. Third Party Cookies 1330 Some browsers allow users to block third party cookies (cookies 1331 associated with origins other than the top level page) for privacy 1332 reasons. Any IdP which uses cookies to persist logins will be broken 1333 by third-party cookie blocking. One option is to accept this as a 1334 limitation; another is to have the PeerConnection object disable 1335 third-party cookie blocking for the IdP proxy. 1337 6. Acknowledgements 1339 Bernard Aboba, Harald Alvestrand, Dan Druta, Cullen Jennings, Hadriel 1340 Kaplan, Matthew Kaufman, Jim McEachem, Martin Thomson, Magnus 1341 Westerland. 1343 7. Changes since -02 1345 The following changes have been made since the -02 draft. 1347 o Forbid persistent HTTP permissions. 1348 o Clarified the text in S 5.4 to clearly refer to requirements on 1349 the API to provide functionality to the site. 1350 o Fold in the IETF portion of draft-rescorla-rtcweb-generic-idp 1351 o Retarget the continuing consent section to assume Binding Requests 1352 o Editorial improvements 1354 8. References 1356 8.1. Normative References 1358 [I-D.ietf-rtcweb-security] 1359 Rescorla, E., "Security Considerations for RTC-Web", 1360 draft-ietf-rtcweb-security-03 (work in progress), 1361 June 2012. 1363 [I-D.muthu-behave-consent-freshness] 1364 Perumal, M., Wing, D., and H. Kaplan, "STUN Usage for 1365 Consent Freshness and Session Liveness", 1366 draft-muthu-behave-consent-freshness-01 (work in 1367 progress), July 2012. 1369 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1370 Requirement Levels", BCP 14, RFC 2119, March 1997. 1372 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. 1374 [RFC4347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer 1375 Security", RFC 4347, April 2006. 1377 [RFC4627] Crockford, D., "The application/json Media Type for 1378 JavaScript Object Notation (JSON)", RFC 4627, July 2006. 1380 [RFC5245] Rosenberg, J., "Interactive Connectivity Establishment 1381 (ICE): A Protocol for Network Address Translator (NAT) 1382 Traversal for Offer/Answer Protocols", RFC 5245, 1383 April 2010. 1385 [RFC5763] Fischl, J., Tschofenig, H., and E. Rescorla, "Framework 1386 for Establishing a Secure Real-time Transport Protocol 1387 (SRTP) Security Context Using Datagram Transport Layer 1388 Security (DTLS)", RFC 5763, May 2010. 1390 [RFC5764] McGrew, D. and E. Rescorla, "Datagram Transport Layer 1391 Security (DTLS) Extension to Establish Keys for the Secure 1392 Real-time Transport Protocol (SRTP)", RFC 5764, May 2010. 1394 [RFC6454] Barth, A., "The Web Origin Concept", RFC 6454, 1395 December 2011. 1397 8.2. Informative References 1399 [I-D.ietf-rtcweb-jsep] 1400 Uberti, J. and C. Jennings, "Javascript Session 1401 Establishment Protocol", draft-ietf-rtcweb-jsep-01 (work 1402 in progress), June 2012. 1404 [I-D.jennings-rtcweb-signaling] 1405 Jennings, C., Rosenberg, J., and R. Jesup, "RTCWeb Offer/ 1406 Answer Protocol (ROAP)", 1407 draft-jennings-rtcweb-signaling-01 (work in progress), 1408 October 2011. 1410 [I-D.kaufman-rtcweb-security-ui] 1411 Kaufman, M., "Client Security User Interface Requirements 1412 for RTCWEB", draft-kaufman-rtcweb-security-ui-00 (work in 1413 progress), June 2011. 1415 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 1416 A., Peterson, J., Sparks, R., Handley, M., and E. 1417 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 1418 June 2002. 1420 [RFC5705] Rescorla, E., "Keying Material Exporters for Transport 1421 Layer Security (TLS)", RFC 5705, March 2010. 1423 [RFC6455] Fette, I. and A. Melnikov, "The WebSocket Protocol", 1424 RFC 6455, December 2011. 1426 [XmlHttpRequest] 1427 van Kesteren, A., "XMLHttpRequest Level 2". 1429 Appendix A. Example IdP Bindings to Specific Protocols 1431 This section provides some examples of how the mechanisms described 1432 in this document could be used with existing authentication protocols 1433 such as BrowserID or OAuth. Note that this does not require browser- 1434 level support for either protocol. Rather, the protocols can be fit 1435 into the generic framework. (Though BrowserID in particular works 1436 better with some client side support). 1438 A.1. BrowserID 1440 BrowserID [https://browserid.org/] is a technology which allows a 1441 user with a verified email address to generate an assertion 1442 (authenticated by their identity provider) attesting to their 1443 identity (phrased as an email address). The way that this is used in 1444 practice is that the relying party embeds JS in their site which 1445 talks to the BrowserID code (either hosted on a trusted intermediary 1446 or embedded in the browser). That code generates the assertion which 1447 is passed back to the relying party for verification. The assertion 1448 can be verified directly or with a Web service provided by the 1449 identity provider. It's relatively easy to extend this functionality 1450 to authenticate RTCWEB calls, as shown below. 1452 +----------------------+ +----------------------+ 1453 | | | | 1454 | Alice's Browser | | Bob's Browser | 1455 | | OFFER ------------> | | 1456 | Calling JS Code | | Calling JS Code | 1457 | ^ | | ^ | 1458 | | | | | | 1459 | v | | v | 1460 | PeerConnection | | PeerConnection | 1461 | | ^ | | | ^ | 1462 | Finger| |Signed | |Signed | | | 1463 | print | |Finger | |Finger | |"Alice"| 1464 | | |print | |print | | | 1465 | v | | | v | | 1466 | +--------------+ | | +---------------+ | 1467 | | IdP Proxy | | | | IdP Proxy | | 1468 | | to | | | | to | | 1469 | | BrowserID | | | | BrowserID | | 1470 | | Signer | | | | Verifier | | 1471 | +--------------+ | | +---------------+ | 1472 | ^ | | ^ | 1473 +-----------|----------+ +----------|-----------+ 1474 | | 1475 | Get certificate | 1476 v | Check 1477 +----------------------+ | certificate 1478 | | | 1479 | Identity |/-------------------------------+ 1480 | Provider | 1481 | | 1482 +----------------------+ 1484 The way this mechanism works is as follows. On Alice's side, Alice 1485 goes to initiate a call. 1487 1. The calling JS instantiates a PeerConnection and tells it that it 1488 is interested in having it authenticated via BrowserID (i.e., it 1489 provides "browserid.org" as the IdP name.) 1490 2. The PeerConnection instantiates the BrowserID signer in the IdP 1491 proxy 1492 3. The BrowserID signer contacts Alice's identity provider, 1493 authenticating as Alice (likely via a cookie). 1494 4. The identity provider returns a short-term certificate attesting 1495 to Alice's identity and her short-term public key. 1496 5. The Browser-ID code signs the fingerprint and returns the signed 1497 assertion + certificate to the PeerConnection. 1499 6. The PeerConnection returns the signed information to the calling 1500 JS code. 1501 7. The signed assertion gets sent over the wire to Bob's browser 1502 (via the signaling service) as part of the call setup. 1504 Obviously, the format of the signed assertion varies depending on 1505 what signaling style the WG ultimately adopts. However, for 1506 concreteness, if something like ROAP were adopted, then the entire 1507 message might look like: 1509 { 1510 "messageType":"OFFER", 1511 "callerSessionId":"13456789ABCDEF", 1512 "seq": 1 1513 "sdp":" 1514 v=0\n 1515 o=- 2890844526 2890842807 IN IP4 192.0.2.1\n 1516 s= \n 1517 c=IN IP4 192.0.2.1\n 1518 t=2873397496 2873404696\n 1519 m=audio 49170 RTP/AVP 0\n 1520 a=fingerprint: SHA-1 \ 1521 4A:AD:B9:B1:3F:82:18:3B:54:02:12:DF:3E:5D:49:6B:19:E5:7C:AB\n", 1522 "identity":{ 1523 "idp":{ // Standardized 1524 "domain":"browserid.org", 1525 "method":"default" 1526 }, 1527 "assertion": // Contents are browserid-specific 1528 "\"assertion\": { 1529 \"digest\":\"\", 1530 \"audience\": \"[TBD]\" 1531 \"valid-until\": 1308859352261, 1532 }, 1533 \"certificate\": { 1534 \"email\": \"rescorla@example.org\", 1535 \"public-key\": \"\", 1536 \"valid-until\": 1308860561861, 1537 }" // certificate is signed by example.org 1538 } 1539 } 1541 Note that while the IdP here is specified as "browserid.org", the 1542 actual certificate is signed by example.org. This is because 1543 BrowserID is a combined authoritative/third-party system in which 1544 browserid.org delegates the right to be authoritative (what BrowserID 1545 calls primary) to individual domains. 1547 On Bob's side, he receives the signed assertion as part of the call 1548 setup message and a similar procedure happens to verify it. 1550 1. The calling JS instantiates a PeerConnection and provides it the 1551 relevant signaling information, including the signed assertion. 1552 2. The PeerConnection instantiates the IdP proxy which examines the 1553 IdP name and brings up the BrowserID verification code. 1554 3. The BrowserID verifier contacts the identity provider to verify 1555 the certificate and then uses the key to verify the signed 1556 fingerprint. 1557 4. Alice's verified identity is returned to the PeerConnection (it 1558 already has the fingerprint). 1559 5. At this point, Bob's browser can display a trusted UI indication 1560 that Alice is on the other end of the call. 1562 When Bob returns his answer, he follows the converse procedure, which 1563 provides Alice with a signed assertion of Bob's identity and keying 1564 material. 1566 A.2. OAuth 1568 While OAuth is not directly designed for user-to-user authentication, 1569 with a little lateral thinking it can be made to serve. We use the 1570 following mapping of OAuth concepts to RTCWEB concepts: 1572 +----------------------+----------------------+ 1573 | OAuth | RTCWEB | 1574 +----------------------+----------------------+ 1575 | Client | Relying party | 1576 | Resource owner | Authenticating party | 1577 | Authorization server | Identity service | 1578 | Resource server | Identity service | 1579 +----------------------+----------------------+ 1581 Table 1 1583 The idea here is that when Alice wants to authenticate to Bob (i.e., 1584 for Bob to be aware that she is calling). In order to do this, she 1585 allows Bob to see a resource on the identity provider that is bound 1586 to the call, her identity, and her public key. Then Bob retrieves 1587 the resource from the identity provider, thus verifying the binding 1588 between Alice and the call. 1590 Alice IdP Bob 1591 --------------------------------------------------------- 1592 Call-Id, Fingerprint -------> 1593 <------------------- Auth Code 1594 Auth Code ----------------------------------------------> 1595 <----- Get Token + Auth Code 1596 Token ---------------------> 1597 <------------- Get call-info 1598 Call-Id, Fingerprint ------> 1600 This is a modified version of a common OAuth flow, but omits the 1601 redirects required to have the client point the resource owner to the 1602 IdP, which is acting as both the resource server and the 1603 authorization server, since Alice already has a handle to the IdP. 1605 Above, we have referred to "Alice", but really what we mean is the 1606 PeerConnection. Specifically, the PeerConnection will instantiate an 1607 IFRAME with JS from the IdP and will use that IFRAME to communicate 1608 with the IdP, authenticating with Alice's identity (e.g., cookie). 1609 Similarly, Bob's PeerConnection instantiates an IFRAME to talk to the 1610 IdP. 1612 Author's Address 1614 Eric Rescorla 1615 RTFM, Inc. 1616 2064 Edgewood Drive 1617 Palo Alto, CA 94303 1618 USA 1620 Phone: +1 650 678 2350 1621 Email: ekr@rtfm.com