idnits 2.17.1 draft-ietf-rtcweb-security-arch-08.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 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 == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'MUST not' in this paragraph: o Browsers MUST not permit permanent screen or application sharing permissions to be installed as a response to a JS request for permissions. Instead, they must require some other user action such as a permissions setting or an application install experience to grant permission to a site. o Browsers MUST provide a separate dialog request for screen/ application sharing permissions even if the media request is made at the same time as camera and microphone. o The browser MUST indicate any windows which are currently being shared in some unambiguous way. Windows which are not visible MUST not be shared even if the application is being shared. If the screen is being shared, then that MUST be indicated. == 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 (January 22, 2014) is 3745 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) == Outdated reference: A later version (-12) exists of draft-ietf-rtcweb-security-05 == Outdated reference: A later version (-09) exists of draft-ietf-tsvwg-sctp-dtls-encaps-02 ** Obsolete normative reference: RFC 2818 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 4347 (Obsoleted by RFC 6347) ** Obsolete normative reference: RFC 4572 (Obsoleted by RFC 8122) ** Obsolete normative reference: RFC 4627 (Obsoleted by RFC 7158, RFC 7159) ** Obsolete normative reference: RFC 5245 (Obsoleted by RFC 8445, RFC 8839) ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) == Outdated reference: A later version (-26) exists of draft-ietf-rtcweb-jsep-05 Summary: 6 errors (**), 0 flaws (~~), 6 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 January 22, 2014 5 Expires: July 26, 2014 7 WebRTC Security Architecture 8 draft-ietf-rtcweb-security-arch-08 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 (commonly 15 called "WebRTC"). This document defines the security architecture 16 for 18 Status of this Memo 20 This Internet-Draft is submitted in full conformance with the 21 provisions of BCP 78 and BCP 79. 23 Internet-Drafts are working documents of the Internet Engineering 24 Task Force (IETF). Note that other groups may also distribute 25 working documents as Internet-Drafts. The list of current Internet- 26 Drafts is at http://datatracker.ietf.org/drafts/current/. 28 Internet-Drafts are draft documents valid for a maximum of six months 29 and may be updated, replaced, or obsoleted by other documents at any 30 time. It is inappropriate to use Internet-Drafts as reference 31 material or to cite them other than as "work in progress." 33 This Internet-Draft will expire on July 26, 2014. 35 Copyright Notice 37 Copyright (c) 2014 IETF Trust and the persons identified as the 38 document authors. All rights reserved. 40 This document is subject to BCP 78 and the IETF Trust's Legal 41 Provisions Relating to IETF Documents 42 (http://trustee.ietf.org/license-info) in effect on the date of 43 publication of this document. Please review these documents 44 carefully, as they describe your rights and restrictions with respect 45 to this document. Code Components extracted from this document must 46 include Simplified BSD License text as described in Section 4.e of 47 the Trust Legal Provisions and are provided without warranty as 48 described in the Simplified BSD License. 50 This document may contain material from IETF Documents or IETF 51 Contributions published or made publicly available before November 52 10, 2008. The person(s) controlling the copyright in some of this 53 material may not have granted the IETF Trust the right to allow 54 modifications of such material outside the IETF Standards Process. 55 Without obtaining an adequate license from the person(s) controlling 56 the copyright in such materials, this document may not be modified 57 outside the IETF Standards Process, and derivative works of it may 58 not be created outside the IETF Standards Process, except to format 59 it for publication as an RFC or to translate it into languages other 60 than English. 62 Table of Contents 64 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 65 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5 66 3. Trust Model . . . . . . . . . . . . . . . . . . . . . . . . . 5 67 3.1. Authenticated Entities . . . . . . . . . . . . . . . . . . 6 68 3.2. Unauthenticated Entities . . . . . . . . . . . . . . . . . 6 69 4. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 70 4.1. Initial Signaling . . . . . . . . . . . . . . . . . . . . 9 71 4.2. Media Consent Verification . . . . . . . . . . . . . . . . 11 72 4.3. DTLS Handshake . . . . . . . . . . . . . . . . . . . . . . 12 73 4.4. Communications and Consent Freshness . . . . . . . . . . . 12 74 5. Detailed Technical Description . . . . . . . . . . . . . . . . 13 75 5.1. Origin and Web Security Issues . . . . . . . . . . . . . . 13 76 5.2. Device Permissions Model . . . . . . . . . . . . . . . . . 13 77 5.3. Communications Consent . . . . . . . . . . . . . . . . . . 15 78 5.4. IP Location Privacy . . . . . . . . . . . . . . . . . . . 16 79 5.5. Communications Security . . . . . . . . . . . . . . . . . 17 80 5.6. Web-Based Peer Authentication . . . . . . . . . . . . . . 18 81 5.6.1. Trust Relationships: IdPs, APs, and RPs . . . . . . . 19 82 5.6.2. Overview of Operation . . . . . . . . . . . . . . . . 21 83 5.6.3. Items for Standardization . . . . . . . . . . . . . . 22 84 5.6.4. Binding Identity Assertions to JSEP Offer/Answer 85 Transactions . . . . . . . . . . . . . . . . . . . . . 22 86 5.6.4.1. Input to Assertion Generation Process . . . . . . 22 87 5.6.4.2. Carrying Identity Assertions . . . . . . . . . . . 23 88 5.6.5. IdP Interaction Details . . . . . . . . . . . . . . . 24 89 5.6.5.1. General Message Structure . . . . . . . . . . . . 24 90 5.6.5.2. IdP Proxy Setup . . . . . . . . . . . . . . . . . 25 91 5.7. Security Considerations . . . . . . . . . . . . . . . . . 29 92 5.7.1. Communications Security . . . . . . . . . . . . . . . 29 93 5.7.2. Privacy . . . . . . . . . . . . . . . . . . . . . . . 30 94 5.7.3. Denial of Service . . . . . . . . . . . . . . . . . . 31 95 5.7.4. IdP Authentication Mechanism . . . . . . . . . . . . . 32 96 5.7.4.1. PeerConnection Origin Check . . . . . . . . . . . 32 97 5.7.4.2. IdP Well-known URI . . . . . . . . . . . . . . . . 33 98 5.7.4.3. Privacy of IdP-generated identities and the 99 hosting site . . . . . . . . . . . . . . . . . . . 33 100 5.7.4.4. Security of Third-Party IdPs . . . . . . . . . . . 34 101 5.7.4.5. Web Security Feature Interactions . . . . . . . . 34 102 5.8. IANA Considerations . . . . . . . . . . . . . . . . . . . 34 103 6. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 35 104 7. Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 105 7.1. Changes since -06 . . . . . . . . . . . . . . . . . . . . 35 106 7.2. Changes since -05 . . . . . . . . . . . . . . . . . . . . 35 107 7.3. Changes since -03 . . . . . . . . . . . . . . . . . . . . 35 108 7.4. Changes since -03 . . . . . . . . . . . . . . . . . . . . 35 109 7.5. Changes since -02 . . . . . . . . . . . . . . . . . . . . 36 110 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 36 111 8.1. Normative References . . . . . . . . . . . . . . . . . . . 36 112 8.2. Informative References . . . . . . . . . . . . . . . . . . 37 113 Appendix A. Example IdP Bindings to Specific Protocols . . . . . 38 114 A.1. BrowserID . . . . . . . . . . . . . . . . . . . . . . . . 38 115 A.2. OAuth . . . . . . . . . . . . . . . . . . . . . . . . . . 41 116 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 42 118 1. Introduction 120 The Real-Time Communications on the Web (WebRTC) working group is 121 tasked with standardizing protocols for real-time communications 122 between Web browsers. The major use cases for WebRTC technology are 123 real-time audio and/or video calls, Web conferencing, and direct data 124 transfer. Unlike most conventional real-time systems, (e.g., SIP- 125 based[RFC3261] soft phones) WebRTC communications are directly 126 controlled by some Web server, via a JavaScript (JS) API as shown in 127 Figure 1. 129 +----------------+ 130 | | 131 | Web Server | 132 | | 133 +----------------+ 134 ^ ^ 135 / \ 136 HTTP / \ HTTP 137 / \ 138 / \ 139 v v 140 JS API JS API 141 +-----------+ +-----------+ 142 | | Media | | 143 | Browser |<---------->| Browser | 144 | | | | 145 +-----------+ +-----------+ 147 Figure 1: A simple WebRTC system 149 A more complicated system might allow for interdomain calling, as 150 shown in Figure 2. The protocol to be used between the domains is 151 not standardized by WebRTC, but given the installed base and the form 152 of the WebRTC API is likely to be something SDP-based like SIP. 154 +--------------+ +--------------+ 155 | | SIP,XMPP,...| | 156 | Web Server |<----------->| Web Server | 157 | | | | 158 +--------------+ +--------------+ 159 ^ ^ 160 | | 161 HTTP | | HTTP 162 | | 163 v v 164 JS API JS API 165 +-----------+ +-----------+ 166 | | Media | | 167 | Browser |<---------------->| Browser | 168 | | | | 169 +-----------+ +-----------+ 171 Figure 2: A multidomain WebRTC system 173 This system presents a number of new security challenges, which are 174 analyzed in [I-D.ietf-rtcweb-security]. This document describes a 175 security architecture for WebRTC which addresses the threats and 176 requirements described in that document. 178 2. Terminology 180 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 181 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 182 document are to be interpreted as described in RFC 2119 [RFC2119]. 184 3. Trust Model 186 The basic assumption of this architecture is that network resources 187 exist in a hierarchy of trust, rooted in the browser, which serves as 188 the user's TRUSTED COMPUTING BASE (TCB). Any security property which 189 the user wishes to have enforced must be ultimately guaranteed by the 190 browser (or transitively by some property the browser verifies). 191 Conversely, if the browser is compromised, then no security 192 guarantees are possible. Note that there are cases (e.g., Internet 193 kiosks) where the user can't really trust the browser that much. In 194 these cases, the level of security provided is limited by how much 195 they trust the browser. 197 Optimally, we would not rely on trust in any entities other than the 198 browser. However, this is unfortunately not possible if we wish to 199 have a functional system. Other network elements fall into two 200 categories: those which can be authenticated by the browser and thus 201 are partly trusted--though to the minimum extent necessary--and those 202 which cannot be authenticated and thus are untrusted. 204 3.1. Authenticated Entities 206 There are two major classes of authenticated entities in the system: 208 o Calling services: Web sites whose origin we can verify (optimally 209 via HTTPS, but in some cases because we are on a topologically 210 restricted network, such as behind a firewall, and can infer 211 authentication from firewall behavior). 212 o Other users: WebRTC peers whose origin we can verify 213 cryptographically (optimally via DTLS-SRTP). 215 Note that merely being authenticated does not make these entities 216 trusted. For instance, just because we can verify that 217 https://www.evil.org/ is owned by Dr. Evil does not mean that we can 218 trust Dr. Evil to access our camera and microphone. However, it 219 gives the user an opportunity to determine whether he wishes to trust 220 Dr. Evil or not; after all, if he desires to contact Dr. Evil 221 (perhaps to arrange for ransom payment), it's safe to temporarily 222 give him access to the camera and microphone for the purpose of the 223 call, but he doesn't want Dr. Evil to be able to access his camera 224 and microphone other than during the call. The point here is that we 225 must first identify other elements before we can determine whether 226 and how much to trust them. Additionally, sometimes we need to 227 identify the communicating peer before we know what policies to 228 apply. 230 It's also worth noting that there are settings where authentication 231 is non-cryptographic, such as other machines behind a firewall. 232 Naturally, the level of trust one can have in identities verified in 233 this way depends on how strong the topology enforcement is. 235 3.2. Unauthenticated Entities 237 Other than the above entities, we are not generally able to identify 238 other network elements, thus we cannot trust them. This does not 239 mean that it is not possible to have any interaction with them, but 240 it means that we must assume that they will behave maliciously and 241 design a system which is secure even if they do so. 243 4. Overview 245 This section describes a typical RTCWeb session and shows how the 246 various security elements interact and what guarantees are provided 247 to the user. The example in this section is a "best case" scenario 248 in which we provide the maximal amount of user authentication and 249 media privacy with the minimal level of trust in the calling service. 250 Simpler versions with lower levels of security are also possible and 251 are noted in the text where applicable. It's also important to 252 recognize the tension between security (or performance) and privacy. 253 The example shown here is aimed towards settings where we are more 254 concerned about secure calling than about privacy, but as we shall 255 see, there are settings where one might wish to make different 256 tradeoffs--this architecture is still compatible with those settings. 258 For the purposes of this example, we assume the topology shown in the 259 figures below. This topology is derived from the topology shown in 260 Figure 1, but separates Alice and Bob's identities from the process 261 of signaling. Specifically, Alice and Bob have relationships with 262 some Identity Provider (IdP) that supports a protocol such as OpenID 263 or BrowserID) that can be used to demonstrate their identity to other 264 parties. For instance, Alice might have an account with a social 265 network which she can then use to authenticate to other web sites 266 without explicitly having an account with those sites; this is a 267 fairly conventional pattern on the Web. Section 5.6.1 provides an 268 overview of Identity Providers and the relevant terminology. Alice 269 and Bob might have relationships with different IdPs as well. 271 This separation of identity provision and signaling isn't 272 particularly important in "closed world" cases where Alice and Bob 273 are users on the same social network and have identities based on 274 that domain (Figure 3) However, there are important settings where 275 that is not the case, such as federation (calls from one domain to 276 another; Figure 4) and calling on untrusted sites, such as where two 277 users who have a relationship via a given social network want to call 278 each other on another, untrusted, site, such as a poker site. 280 Note that the servers themselves are also authenticated by an 281 external identity service, the SSL/TLS certificate infrastructure 282 (not shown). As is conventional in the Web, all identities are 283 ultimately rooted in that system. For instance, when an IdP makes an 284 identity assertion, the Relying Party consuming that assertion is 285 able to verify because it is able to connect to the IdP via HTTPS. 287 +----------------+ 288 | | 289 | Signaling | 290 | Server | 291 | | 292 +----------------+ 293 ^ ^ 294 / \ 295 HTTPS / \ HTTPS 296 / \ 297 / \ 298 v v 299 JS API JS API 300 +-----------+ +-----------+ 301 | | Media | | 302 Alice | Browser |<---------->| Browser | Bob 303 | | (DTLS+SRTP)| | 304 +-----------+ +-----------+ 305 ^ ^--+ +--^ ^ 306 | | | | 307 v | | v 308 +-----------+ | | +-----------+ 309 | |<--------+ | | 310 | IdP1 | | | IdP2 | 311 | | +------->| | 312 +-----------+ +-----------+ 314 Figure 3: A call with IdP-based identity 316 Figure 4 shows essentially the same calling scenario but with a call 317 between two separate domains (i.e., a federated case), as in 318 Figure 2. As mentioned above, the domains communicate by some 319 unspecified protocol and providing separate signaling and identity 320 allows for calls to be authenticated regardless of the details of the 321 inter-domain protocol. 323 +----------------+ Unspecified +----------------+ 324 | | protocol | | 325 | Signaling |<----------------->| Signaling | 326 | Server | (SIP, XMPP, ...) | Server | 327 | | | | 328 +----------------+ +----------------+ 329 ^ ^ 330 | | 331 HTTPS | | HTTPS 332 | | 333 | | 334 v v 335 JS API JS API 336 +-----------+ +-----------+ 337 | | Media | | 338 Alice | Browser |<--------------------------->| Browser | Bob 339 | | DTLS+SRTP | | 340 +-----------+ +-----------+ 341 ^ ^--+ +--^ ^ 342 | | | | 343 v | | v 344 +-----------+ | | +-----------+ 345 | |<-------------------------+ | | 346 | IdP1 | | | IdP2 | 347 | | +------------------------>| | 348 +-----------+ +-----------+ 350 Figure 4: A federated call with IdP-based identity 352 4.1. Initial Signaling 354 For simplicity, assume the topology in Figure 3. Alice and Bob are 355 both users of a common calling service; they both have approved the 356 calling service to make calls (we defer the discussion of device 357 access permissions till later). They are both connected to the 358 calling service via HTTPS and so know the origin with some level of 359 confidence. They also have accounts with some identity provider. 360 This sort of identity service is becoming increasingly common in the 361 Web environment in technologies such (BrowserID, Federated Google 362 Login, Facebook Connect, OAuth, OpenID, WebFinger), and is often 363 provided as a side effect service of a user's ordinary accounts with 364 some service. In this example, we show Alice and Bob using a 365 separate identity service, though the identity service may be the 366 same entity as the calling service or there may be no identity 367 service at all. 369 Alice is logged onto the calling service and decides to call Bob. She 370 can see from the calling service that he is online and the calling 371 service presents a JS UI in the form of a button next to Bob's name 372 which says "Call". Alice clicks the button, which initiates a JS 373 callback that instantiates a PeerConnection object. This does not 374 require a security check: JS from any origin is allowed to get this 375 far. 377 Once the PeerConnection is created, the calling service JS needs to 378 set up some media. Because this is an audio/video call, it creates a 379 MediaStream with two MediaStreamTracks, one connected to an audio 380 input and one connected to a video input. At this point the first 381 security check is required: untrusted origins are not allowed to 382 access the camera and microphone, so the browser prompts Alice for 383 permission. 385 In the current W3C API, once some streams have been added, Alice's 386 browser + JS generates a signaling message [I-D.ietf-rtcweb-jsep] 387 containing: 389 o Media channel information 390 o Interactive Connectivity Establishment (ICE) [RFC5245] candidates 391 o A fingerprint attribute binding the communication to a key pair 392 [RFC5763]. Note that this key may simply be ephemerally generated 393 for this call or specific to this domain, and Alice may have a 394 large number of such keys. 396 Prior to sending out the signaling message, the PeerConnection code 397 contacts the identity service and obtains an assertion binding 398 Alice's identity to her fingerprint. The exact details depend on the 399 identity service (though as discussed in Section 5.6 PeerConnection 400 can be agnostic to them), but for now it's easiest to think of as a 401 BrowserID assertion. The assertion may bind other information to the 402 identity besides the fingerprint, but at minimum it needs to bind the 403 fingerprint. 405 This message is sent to the signaling server, e.g., by XMLHttpRequest 406 [XmlHttpRequest] or by WebSockets [RFC6455]. preferably over TLS 407 [RFC5246]. The signaling server processes the message from Alice's 408 browser, determines that this is a call to Bob and sends a signaling 409 message to Bob's browser (again, the format is currently undefined). 410 The JS on Bob's browser processes it, and alerts Bob to the incoming 411 call and to Alice's identity. In this case, Alice has provided an 412 identity assertion and so Bob's browser contacts Alice's identity 413 provider (again, this is done in a generic way so the browser has no 414 specific knowledge of the IdP) to verify the assertion. This allows 415 the browser to display a trusted element in the browser chrome 416 indicating that a call is coming in from Alice. If Alice is in Bob's 417 address book, then this interface might also include her real name, a 418 picture, etc. The calling site will also provide some user interface 419 element (e.g., a button) to allow Bob to answer the call, though this 420 is most likely not part of the trusted UI. 422 If Bob agrees a PeerConnection is instantiated with the message from 423 Alice's side. Then, a similar process occurs as on Alice's browser: 424 Bob's browser prompts him for device permission, the media streams 425 are created, and a return signaling message containing media 426 information, ICE candidates, and a fingerprint is sent back to Alice 427 via the signaling service. If Bob has a relationship with an IdP, 428 the message will also come with an identity assertion. 430 At this point, Alice and Bob each know that the other party wants to 431 have a secure call with them. Based purely on the interface provided 432 by the signaling server, they know that the signaling server claims 433 that the call is from Alice to Bob. This level of security is 434 provided merely by having the fingerprint in the message and having 435 that message received securely from the signaling server. Because 436 the far end sent an identity assertion along with their message, they 437 know that this is verifiable from the IdP as well. Note that if the 438 call is federated, as shown in Figure 4 then Alice is able to verify 439 Bob's identity in a way that is not mediated by either her signaling 440 server or Bob's. Rather, she verifies it directly with Bob's IdP. 442 Of course, the call works perfectly well if either Alice or Bob 443 doesn't have a relationship with an IdP; they just get a lower level 444 of assurance. I.e., they simply have whatever information their 445 calling site claims about the caller/calllee's identity. Moreover, 446 Alice might wish to make an anonymous call through an anonymous 447 calling site, in which case she would of course just not provide any 448 identity assertion and the calling site would mask her identity from 449 Bob. 451 4.2. Media Consent Verification 453 As described in ([I-D.ietf-rtcweb-security]; Section 4.2) media 454 consent verification is provided via ICE. Thus, Alice and Bob 455 perform ICE checks with each other. At the completion of these 456 checks, they are ready to send non-ICE data. 458 At this point, Alice knows that (a) Bob (assuming he is verified via 459 his IdP) or someone else who the signaling service is claiming is Bob 460 is willing to exchange traffic with her and (b) that either Bob is at 461 the IP address which she has verified via ICE or there is an attacker 462 who is on-path to that IP address detouring the traffic. Note that 463 it is not possible for an attacker who is on-path between Alice and 464 Bob but not attached to the signaling service to spoof these checks 465 because they do not have the ICE credentials. Bob has the same 466 security guarantees with respect to Alice. 468 4.3. DTLS Handshake 470 Once the ICE checks have completed [more specifically, once some ICE 471 checks have completed], Alice and Bob can set up a secure channel or 472 channels. This is performed via DTLS [RFC4347] (for the data 473 channel) and DTLS-SRTP [RFC5763] keying for SRTP [RFC3711] for the 474 media channel and SCTP over DTLS [I-D.ietf-tsvwg-sctp-dtls-encaps] 475 for data channels. Specifically, Alice and Bob perform a DTLS 476 handshake on every channel which has been established by ICE. The 477 total number of channels depends on the amount of muxing; in the most 478 likely case we are using both RTP/RTCP mux and muxing multiple media 479 streams on the same channel, in which case there is only one DTLS 480 handshake. Once the DTLS handshake has completed, the keys are 481 exported [RFC5705] and used to key SRTP for the media channels. 483 At this point, Alice and Bob know that they share a set of secure 484 data and/or media channels with keys which are not known to any 485 third-party attacker. If Alice and Bob authenticated via their IdPs, 486 then they also know that the signaling service is not mounting a man- 487 in-the-middle attack on their traffic. Even if they do not use an 488 IdP, as long as they have minimal trust in the signaling service not 489 to perform a man-in-the-middle attack, they know that their 490 communications are secure against the signaling service as well 491 (i.e., that the signaling service cannot mount a passive attack on 492 the communications). 494 4.4. Communications and Consent Freshness 496 From a security perspective, everything from here on in is a little 497 anticlimactic: Alice and Bob exchange data protected by the keys 498 negotiated by DTLS. Because of the security guarantees discussed in 499 the previous sections, they know that the communications are 500 encrypted and authenticated. 502 The one remaining security property we need to establish is "consent 503 freshness", i.e., allowing Alice to verify that Bob is still prepared 504 to receive her communications so that Alice does not continue to send 505 large traffic volumes to entities which went abruptly offline. ICE 506 specifies periodic STUN keepalizes but only if media is not flowing. 507 Because the consent issue is more difficult here, we require RTCWeb 508 implementations to periodically send keepalives. As described in 509 Section 5.3, these keepalives MUST be based on the consent freshness 510 mechanism specified in [I-D.muthu-behave-consent-freshness]. If a 511 keepalive fails and no new ICE channels can be established, then the 512 session is terminated. 514 5. Detailed Technical Description 516 5.1. Origin and Web Security Issues 518 The basic unit of permissions for WebRTC is the origin [RFC6454]. 519 Because the security of the origin depends on being able to 520 authenticate content from that origin, the origin can only be 521 securely established if data is transferred over HTTPS [RFC2818]. 522 Thus, clients MUST treat HTTP and HTTPS origins as different 523 permissions domains. [Note: this follows directly from the origin 524 security model and is stated here merely for clarity.] 526 Many web browsers currently forbid by default any active mixed 527 content on HTTPS pages. That is, when JavaScript is loaded from an 528 HTTP origin onto an HTTPS page, an error is displayed and the HTTP 529 content is not executed unless the user overrides the error. Any 530 browser which enforces such a policy will also not permit access to 531 WebRTC functionality from mixed content pages (because they never 532 display mixed content). Browsers which allow active mixed content 533 MUST nevertheless disable WebRTC functionality in mixed content 534 settings. 536 Note that it is possible for a page which was not mixed content to 537 become mixed content during the duration of the call. The major risk 538 here is that the newly arrived insecure JS might redirect media to a 539 location controlled by the attacker. Implementations MUST either 540 choose to terminate the call or display a warning at that point. 542 5.2. Device Permissions Model 544 Implementations MUST obtain explicit user consent prior to providing 545 access to the camera and/or microphone. Implementations MUST at 546 minimum support the following two permissions models for HTTPS 547 origins. 549 o Requests for one-time camera/microphone access. 550 o Requests for permanent access. 552 Because HTTP origins cannot be securely established against network 553 attackers, implementations MUST NOT allow the setting of permanent 554 access permissions for HTTP origins. Implementations MAY also opt to 555 refuse all permissions grants for HTTP origins, but it is RECOMMENDED 556 that currently they support one-time camera/microphone access. 558 In addition, they SHOULD support requests for access that promise 559 that media from this grant will be sent to a single communicating 560 peer (obviously there could be other requests for other peers). 561 E.g., "Call customerservice@ford.com". The semantics of this request 562 are that the media stream from the camera and microphone will only be 563 routed through a connection which has been cryptographically verified 564 (through the IdP mechanism or an X.509 certificate in the DTLS-SRTP 565 handshake) as being associated with the stated identity. Note that 566 it is unlikely that browsers would have an X.509 certificate, but 567 servers might. Browsers servicing such requests SHOULD clearly 568 indicate that identity to the user when asking for permission. The 569 idea behind this type of permissions is that a user might have a 570 fairly narrow list of peers he is willing to communicate with, e.g., 571 "my mother" rather than "anyone on Facebook". Narrow permissions 572 grants allow the browser to do that enforcement. 574 API Requirement: The API MUST provide a mechanism for the requesting 575 JS to indicate which of these forms of permissions it is 576 requesting. This allows the browser client to know what sort of 577 user interface experience to provide to the user, including what 578 permissions to request from the user and hence what to enforce 579 later. For instance, browsers might display a non-invasive door 580 hanger ("some features of this site may not work..." when asking 581 for long-term permissions) but a more invasive UI ("here is your 582 own video") for single-call permissions. The API MAY grant weaker 583 permissions than the JS asked for if the user chooses to authorize 584 only those permissions, but if it intends to grant stronger ones 585 it SHOULD display the appropriate UI for those permissions and 586 MUST clearly indicate what permissions are being requested. 588 API Requirement: The API MUST provide a mechanism for the requesting 589 JS to relinquish the ability to see or modify the media (e.g., via 590 MediaStream.record()). Combined with secure authentication of the 591 communicating peer, this allows a user to be sure that the calling 592 site is not accessing or modifying their conversion. 594 UI Requirement: The UI MUST clearly indicate when the user's camera 595 and microphone are in use. This indication MUST NOT be 596 suppressable by the JS and MUST clearly indicate how to terminate 597 device access, and provide a UI means to immediately stop camera/ 598 microphone input without the JS being able to prevent it. 600 UI Requirement: If the UI indication of camera/microphone use are 601 displayed in the browser such that minimizing the browser window 602 would hide the indication, or the JS creating an overlapping 603 window would hide the indication, then the browser SHOULD stop 604 camera and microphone input when the indication is hidden. [Note: 605 this may not be necessary in systems that are non-windows-based 606 but that have good notifications support, such as phones.] 608 [[OPEN ISSUE: This section does not have WG consensus. Because 609 screen/application sharing presents a more significant risk than 610 camera and microphone access (see the discussion in 611 [I-D.ietf-rtcweb-security] S 4.1.1), we require a higher level of 612 user consent. 614 o Browsers MUST not permit permanent screen or application sharing 615 permissions to be installed as a response to a JS request for 616 permissions. Instead, they must require some other user action 617 such as a permissions setting or an application install experience 618 to grant permission to a site. 619 o Browsers MUST provide a separate dialog request for screen/ 620 application sharing permissions even if the media request is made 621 at the same time as camera and microphone. 622 o The browser MUST indicate any windows which are currently being 623 shared in some unambiguous way. Windows which are not visible 624 MUST not be shared even if the application is being shared. If 625 the screen is being shared, then that MUST be indicated. 627 -- END OF OPEN ISSUE]] 629 Clients MAY permit the formation of data channels without any direct 630 user approval. Because sites can always tunnel data through the 631 server, further restrictions on the data channel do not provide any 632 additional security. (though see Section 5.3 for a related issue). 634 Implementations which support some form of direct user authentication 635 SHOULD also provide a policy by which a user can authorize calls only 636 to specific communicating peers. Specifically, the implementation 637 SHOULD provide the following interfaces/controls: 639 o Allow future calls to this verified user. 640 o Allow future calls to any verified user who is in my system 641 address book (this only works with address book integration, of 642 course). 644 Implementations SHOULD also provide a different user interface 645 indication when calls are in progress to users whose identities are 646 directly verifiable. Section 5.5 provides more on this. 648 5.3. Communications Consent 650 Browser client implementations of WebRTC MUST implement ICE. Server 651 gateway implementations which operate only at public IP addresses 652 MUST implement either full ICE or ICE-Lite [RFC5245]. 654 Browser implementations MUST verify reachability via ICE prior to 655 sending any non-ICE packets to a given destination. Implementations 656 MUST NOT provide the ICE transaction ID to JavaScript during the 657 lifetime of the transaction (i.e., during the period when the ICE 658 stack would accept a new response for that transaction). The JS MUST 659 NOT be permitted to control the local ufrag and password, though it 660 of course knows it. 662 While continuing consent is required, that ICE [RFC5245]; Section 10 663 keepalives STUN Binding Indications are one-way and therefore not 664 sufficient. The current WG consensus is to use ICE Binding Requests 665 for continuing consent freshness. ICE already requires that 666 implementations respond to such requests, so this approach is 667 maximally compatible. A separate document will profile the ICE 668 timers to be used; see [I-D.muthu-behave-consent-freshness]. 670 5.4. IP Location Privacy 672 A side effect of the default ICE behavior is that the peer learns 673 one's IP address, which leaks large amounts of location information. 674 This has negative privacy consequences in some circumstances. The 675 API requirements in this section are intended to mitigate this issue. 676 Note that these requirements are NOT intended to protect the user's 677 IP address from a malicious site. In general, the site will learn at 678 least a user's server reflexive address from any HTTP transaction. 679 Rather, these requirements are intended to allow a site to cooperate 680 with the user to hide the user's IP address from the other side of 681 the call. Hiding the user's IP address from the server requires some 682 sort of explicit privacy preserving mechanism on the client (e.g., 683 Torbutton [https://www.torproject.org/torbutton/]) and is out of 684 scope for this specification. 686 API Requirement: The API MUST provide a mechanism to allow the JS to 687 suppress ICE negotiation (though perhaps to allow candidate 688 gathering) until the user has decided to answer the call [note: 689 determining when the call has been answered is a question for the 690 JS.] This enables a user to prevent a peer from learning their IP 691 address if they elect not to answer a call and also from learning 692 whether the user is online. 694 API Requirement: The API MUST provide a mechanism for the calling 695 application JS to indicate that only TURN candidates are to be 696 used. This prevents the peer from learning one's IP address at 697 all. This mechanism MUST also permit suppression of the related 698 address field, since that leaks local addresses. 700 API Requirement: The API MUST provide a mechanism for the calling 701 application to reconfigure an existing call to add non-TURN 702 candidates. Taken together, this and the previous requirement 703 allow ICE negotiation to start immediately on incoming call 704 notification, thus reducing post-dial delay, but also to avoid 705 disclosing the user's IP address until they have decided to 706 answer. They also allow users to completely hide their IP address 707 for the duration of the call. Finally, they allow a mechanism for 708 the user to optimize performance by reconfiguring to allow non- 709 turn candidates during an active call if the user decides they no 710 longer need to hide their IP address 712 Note that some enterprises may operate proxies and/or NATs designed 713 to hide internal IP addresses from the outside world. WebRTC 714 provides no explicit mechanism to allow this function. Either such 715 enterprises need to proxy the HTTP/HTTPS and modify the SDP and/or 716 the JS, or there needs to be browser support to set the "TURN-only" 717 policy regardless of the site's preferences. 719 5.5. Communications Security 721 Implementations MUST implement SRTP [RFC3711]. Implementations MUST 722 implement DTLS [RFC4347] and DTLS-SRTP [RFC5763][RFC5764] for SRTP 723 keying. Implementations MUST implement 724 [I-D.ietf-tsvwg-sctp-dtls-encaps]. 726 All media channels MUST be secured via SRTP. Media traffic MUST NOT 727 be sent over plain (unencrypted) RTP. DTLS-SRTP MUST be offered for 728 every media channel. WebRTC implements MUST NOT offer SDES or select 729 it if offered. 731 All data channels MUST be secured via DTLS. 733 [[OPEN ISSUE: Are these the right cipher suites?]] All 734 implementations MUST implement the following two cipher suites: 735 TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 and 736 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 and the DTLS-SRTP protection 737 profile SRTP_AES128_CM_HMAC_SHA1_80. Implementations SHOULD favor 738 cipher suites which support PFS over non-PFS cipher suites. 740 API Requirement: The API MUST provide a mechanism to indicate that a 741 fresh DTLS key pair is to be generated for a specific call. This 742 is intended to allow for unlinkability. Note that there are also 743 settings where it is attractive to use the same keying material 744 repeatedly, especially those with key continuity-based 745 authentication. Unless the user specifically configures an 746 external key pair, different key pairs MUST be used for each 747 origin. (This avoids creating a super-cookie.) 749 API Requirement: When DTLS-SRTP is used, the API MUST NOT permit the 750 JS to obtain the negotiated keying material. This requirement 751 preserves the end-to-end security of the media. 753 UI Requirements: A user-oriented client MUST provide an 754 "inspector" interface which allows the user to determine the 755 security characteristics of the media. 756 The following properties SHOULD be displayed "up-front" in the 757 browser chrome, i.e., without requiring the user to ask for them: 759 * A client MUST provide a user interface through which a user may 760 determine the security characteristics for currently-displayed 761 audio and video stream(s) 762 * A client MUST provide a user interface through which a user may 763 determine the security characteristics for transmissions of 764 their microphone audio and camera video. 765 * The "security characteristics" MUST include an indication as to 766 whether the cryptographic keys were delivered out-of-band (from 767 a server) or were generated as a result of a pairwise 768 negotiation. 769 * If the far endpoint was directly verified, either via a third- 770 party verifiable X.509 certificate or via a Web IdP mechanism 771 (see Section 5.6) the "security characteristics" MUST include 772 the verified information. X.509 identities and Web IdP 773 identities have similar semantics and should be displayed in a 774 similar way. 776 The following properties are more likely to require some "drill- 777 down" from the user: 779 * The "security characteristics" MUST indicate the cryptographic 780 algorithms in use (For example: "AES-CBC" or "Null Cipher".) 781 However, if Null ciphers are used, that MUST be presented to 782 the user at the top-level UI. 783 * The "security characteristics" MUST indicate whether PFS is 784 provided. 785 * The "security characteristics" MUST include some mechanism to 786 allow an out-of-band verification of the peer, such as a 787 certificate fingerprint or an SAS. 789 5.6. Web-Based Peer Authentication 791 In a number of cases, it is desirable for the endpoint (i.e., the 792 browser) to be able to directly identity the endpoint on the other 793 side without trusting only the signaling service to which they are 794 connected. For instance, users may be making a call via a federated 795 system where they wish to get direct authentication of the other 796 side. Alternately, they may be making a call on a site which they 797 minimally trust (such as a poker site) but to someone who has an 798 identity on a site they do trust (such as a social network.) 800 Recently, a number of Web-based identity technologies (OAuth, 801 BrowserID, Facebook Connect), etc. have been developed. While the 802 details vary, what these technologies share is that they have a Web- 803 based (i.e., HTTP/HTTPS) identity provider which attests to your 804 identity. For instance, if I have an account at example.org, I could 805 use the example.org identity provider to prove to others that I was 806 alice@example.org. The development of these technologies allows us 807 to separate calling from identity provision: I could call you on 808 Poker Galaxy but identify myself as alice@example.org. 810 Whatever the underlying technology, the general principle is that the 811 party which is being authenticated is NOT the signaling site but 812 rather the user (and their browser). Similarly, the relying party is 813 the browser and not the signaling site. Thus, the browser MUST 814 securely generate the input to the IdP assertion process and MUST 815 securely display the results of the verification process to the user 816 in a way which cannot be imitated by the calling site. 818 The mechanisms defined in this document do not require the browser to 819 implement any particular identity protocol or to support any 820 particular IdP. Instead, this document provides a generic interface 821 which any IdP can implement. Thus, new IdPs and protocols can be 822 introduced without change to either the browser or the calling 823 service. This avoids the need to make a commitment to any particular 824 identity protocol, although browsers may opt to directly implement 825 some identity protocols in order to provide superior performance or 826 UI properties. 828 5.6.1. Trust Relationships: IdPs, APs, and RPs 830 Any federated identity protocol has three major participants: 832 Authenticating Party (AP): The entity which is trying to establish 833 its identity. 835 Identity Provider (IdP): The entity which is vouching for the AP's 836 identity. 838 Relying Party (RP): The entity which is trying to verify the AP's 839 identity. 841 The AP and the IdP have an account relationship of some kind: the AP 842 registers with the IdP and is able to subsequently authenticate 843 directly to the IdP (e.g., with a password). This means that the 844 browser must somehow know which IdP(s) the user has an account 845 relationship with. This can either be something that the user 846 configures into the browser or that is configured at the calling site 847 and then provided to the PeerConnection by the Web application at the 848 calling site. The use case for having this information configured 849 into the browser is that the user may "log into" the browser to bind 850 it to some identity. This is becoming common in new browsers. 851 However, it should also be possible for the IdP information to simply 852 be provided by the calling application. 854 At a high level there are two kinds of IdPs: 856 Authoritative: IdPs which have verifiable control of some section 857 of the identity space. For instance, in the realm of e-mail, the 858 operator of "example.com" has complete control of the namespace 859 ending in "@example.com". Thus, "alice@example.com" is whoever 860 the operator says it is. Examples of systems with authoritative 861 identity providers include DNSSEC, RFC 4474, and Facebook Connect 862 (Facebook identities only make sense within the context of the 863 Facebook system). 865 Third-Party: IdPs which don't have control of their section of the 866 identity space but instead verify user's identities via some 867 unspecified mechanism and then attest to it. Because the IdP 868 doesn't actually control the namespace, RPs need to trust that the 869 IdP is correctly verifying AP identities, and there can 870 potentially be multiple IdPs attesting to the same section of the 871 identity space. Probably the best-known example of a third-party 872 identity provider is SSL certificates, where there are a large 873 number of CAs all of whom can attest to any domain name. 875 If an AP is authenticating via an authoritative IdP, then the RP does 876 not need to explicitly configure trust in the IdP at all. The 877 identity mechanism can directly verify that the IdP indeed made the 878 relevant identity assertion (a function provided by the mechanisms in 879 this document), and any assertion it makes about an identity for 880 which it is authoritative is directly verifiable. Note that this 881 does not mean that the IdP might not lie, but that is a 882 trustworthiness judgement that the user can make at the time he looks 883 at the identity. 885 By contrast, if an AP is authenticating via a third-party IdP, the RP 886 needs to explicitly trust that IdP (hence the need for an explicit 887 trust anchor list in PKI-based SSL/TLS clients). The list of 888 trustable IdPs needs to be configured directly into the browser, 889 either by the user or potentially by the browser manufacturer. This 890 is a significant advantage of authoritative IdPs and implies that if 891 third-party IdPs are to be supported, the potential number needs to 892 be fairly small. 894 5.6.2. Overview of Operation 896 In order to provide security without trusting the calling site, the 897 PeerConnection component of the browser must interact directly with 898 the IdP. The details of the mechanism are described in the W3C API 899 specification, but the general idea is that the PeerConnection 900 component downloads JS from a specific location on the IdP dictated 901 by the IdP domain name. That JS (the "IdP proxy") runs in an 902 isolated security context within the browser and the PeerConnection 903 talks to it via a secure message passing channel. 905 Note that there are two logically separate functions here: 907 o Identity assertion generation. 908 o Identity assertion verification. 910 The same IdP JS "endpoint" is used for both functions but of course a 911 given IdP might behave differently and load new JS to perform one 912 function or the other. 914 +------------------------------------+ 915 | https://calling-site.example.com | 916 | | 917 | | 918 | | 919 | Calling JS Code | 920 | ^ | 921 | | API Calls | 922 | v | 923 | PeerConnection | 924 | ^ | 925 | | postMessage() | 926 | v | 927 | +-------------------------+ | +---------------+ 928 | | https://idp.example.org | | | | 929 | | |<--------->| Identity | 930 | | IdP JS | | | Provider | 931 | | | | | | 932 | +-------------------------+ | +---------------+ 933 | | 934 +------------------------------------+ 936 When the PeerConnection object wants to interact with the IdP, the 937 sequence of events is as follows: 939 1. The browser (the PeerConnection component) instantiates an IdP 940 proxy with its source at the IdP. This allows the IdP to load 941 whatever JS is necessary into the proxy, which runs in the IdP's 942 security context. 943 2. If the user is not already logged in, the IdP does whatever is 944 required to log them in, such as soliciting a username and 945 password. 946 3. Once the user is logged in, the IdP proxy notifies the browser 947 that it is ready. 948 4. The browser and the IdP proxy communicate via a standardized 949 series of messages delivered via postMessage. For instance, the 950 browser might request the IdP proxy to sign or verify a given 951 identity assertion. 953 This approach allows us to decouple the browser from any particular 954 identity provider; the browser need only know how to load the IdP's 955 JavaScript--which is deterministic from the IdP's identity--and the 956 generic protocol for requesting and verifying assertions. The IdP 957 provides whatever logic is necessary to bridge the generic protocol 958 to the IdP's specific requirements. Thus, a single browser can 959 support any number of identity protocols, including being forward 960 compatible with IdPs which did not exist at the time the browser was 961 written. 963 5.6.3. Items for Standardization 965 In order to make this work, we must standardize the following items: 967 o The precise information from the signaling message that must be 968 cryptographically bound to the user's identity and a mechanism for 969 carrying assertions in JSEP messages. Section 5.6.4 970 o The interface to the IdP. Section 5.6.5 specifies a specific 971 protocol mechanism which allows the use of any identity protocol 972 without requiring specific further protocol support in the browser 973 o The JavaScript interfaces which the calling application can use to 974 specify the IdP to use to generate assertions and to discover what 975 assertions were received. 977 The first two items are defined in this document. The final one is 978 defined in the companion W3C WebRTC API specification [webrtc-api]. 980 5.6.4. Binding Identity Assertions to JSEP Offer/Answer Transactions 982 5.6.4.1. Input to Assertion Generation Process 984 As discussed above, an identity assertion binds the user's identity 985 (as asserted by the IdP) to the JSEP offer/exchange transaction and 986 specifically to the media. In order to achieve this, the 987 PeerConnection must provide the DTLS-SRTP fingerprint to be bound to 988 the identity. This is provided in a JSON structure for 989 extensibility, as shown below: 991 { 992 "fingerprint" : 993 { 994 "algorithm":"SHA-1", 995 "digest":"4A:AD:B9:B1:3F:...:E5:7C:AB" 996 } 997 } 999 The "algorithm" and digest values correspond directly to the 1000 algorithm and digest values in the a=fingerprint line of the SDP. 1001 [RFC4572]. 1003 Note: this structure does not need to be interpreted by the IdP or 1004 the IdP proxy. It is consumed solely by the RP's browser. The IdP 1005 merely treats it as an opaque value to be attested to. Thus, new 1006 parameters can be added to the assertion without modifying the IdP. 1008 5.6.4.2. Carrying Identity Assertions 1010 Once an IdP has generated an assertion, it is attached to the JSEP 1011 message. This is done by adding a new a-line to the SDP, of the form 1012 a=identity. The sole contents of this value are a base-64-encoded 1013 version of the identity assertion. For example: 1015 v=0 1016 o=- 1181923068 1181923196 IN IP4 ua1.example.com 1017 s=example1 1018 c=IN IP4 ua1.example.com 1019 a=setup:actpass 1020 a=fingerprint:sha-1 \ 1021 4A:AD:B9:B1:3F:82:18:3B:54:02:12:DF:3E:5D:49:6B:19:E5:7C:AB 1022 a=identity:\ 1023 ImlkcCI6eyJkb21haW4iOiAiZXhhbXBsZS5vcmciLCAicHJvdG9jb2wiOiAiYm9n\ 1024 dXMifSwiYXNzZXJ0aW9uIjpcIntcImlkZW50aXR5XCI6XCJib2JAZXhhbXBsZS5v\ 1025 cmdcIixcImNvbnRlbnRzXCI6XCJhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3l6XCIs\ 1026 XCJzaWduYXR1cmVcIjpcIjAxMDIwMzA0MDUwNlwifSJ9Cg== 1027 t=0 0 1028 m=audio 6056 RTP/SAVP 0 1029 a=sendrecv 1030 ... 1032 Each identity attribute should be paired (and attests to) with an 1033 a=fingerprint attribute and therefore can exist either at the session 1034 or media level. Multiple identity attributes may appear at either 1035 level, though it is RECOMMENDED that implementations not do this, 1036 because it becomes very unclear what security claim that they are 1037 making and the UI guidelines above become unclear. Browsers MAY 1038 choose refuse to display any identity indicators in the face of 1039 multiple identity attributes with different identities but SHOULD 1040 process multiple attributes with the same identity as described 1041 above. 1043 5.6.5. IdP Interaction Details 1045 5.6.5.1. General Message Structure 1047 Messages between the PeerConnection object and the IdP proxy are 1048 formatted using JSON [RFC4627]. For instance, the PeerConnection 1049 would request a signature with the following "SIGN" message: 1051 { 1052 "type":"SIGN", 1053 "id": "1", 1054 "origin":"https://calling-site.example.com", 1055 "message":"012345678abcdefghijkl" 1056 } 1058 All messages MUST contain a "type" field which indicates the general 1059 meaning of the message. 1061 All requests from the PeerConnection object MUST contain an "id" 1062 field which MUST be unique for that PeerConnection object. Any 1063 responses from the IdP proxy MUST contain the same id in response, 1064 which allows the PeerConnection to correlate requests and responses, 1065 in case there are multiple requests/responses outstanding to the same 1066 proxy. 1068 All requests from the PeerConnection object MUST contain an "origin" 1069 field containing the origin of the JS which initiated the PC (i.e., 1070 the URL of the calling site). This origin value can be used by the 1071 IdP to make access control decisions. For instance, an IdP might 1072 only issue identity assertions for certain calling services in the 1073 same way that some IdPs require that relying Web sites have an API 1074 key before learning user identity. 1076 Any message-specific data is carried in a "message" field. Depending 1077 on the message type, this may either be a string or a richer JSON 1078 object. 1080 5.6.5.1.1. Errors 1082 If an error occurs, the IdP sends a message of type "ERROR". The 1083 message MAY have an "error" field containing freeform text data which 1084 containing additional information about what happened. For instance: 1086 { 1087 "id":"1", 1088 "type":"ERROR", 1089 "error":"Signature verification failed" 1090 } 1092 Figure 5: Example error 1094 5.6.5.2. IdP Proxy Setup 1096 In order to perform an identity transaction, the PeerConnection must 1097 first create an IdP proxy. While the details of this are specified 1098 in the W3C API document, from the perspective of this specification, 1099 however, the relevant facts are: 1101 o The JS runs in the IdP's security context with the base page 1102 retrieved from the URL specified in Section 5.6.5.2.1 1103 o The usual browser sandbox isolation mechanisms MUST be enforced 1104 with respect to the IdP proxy. 1105 o JS running in the IdP proxy MUST be able to send and receive 1106 messages to the PeerConnection and the PC and IdP proxy are able 1107 to verify the source and destination of these messages. 1109 Initially the IdP proxy is in an unready state; the IdP JS must be 1110 loaded and there may be several round trips to the IdP server, for 1111 instance to log the user in. When the IdP proxy is ready to receive 1112 commands, it delivers a "ready" message. As this message is 1113 unsolicited, it simply contains: 1115 { "type":"READY" } 1117 Once the PeerConnection object receives the ready message, it can 1118 send commands to the IdP proxy. 1120 5.6.5.2.1. Determining the IdP URI 1122 In order to ensure that the IdP is under control of the domain owner 1123 rather than someone who merely has an account on the domain owner's 1124 server (e.g., in shared hosting scenarios), the IdP JavaScript is 1125 hosted at a deterministic location based on the IdP's domain name. 1126 Each IdP proxy instance is associated with two values: 1128 domain name: The IdP's domain name 1129 protocol: The specific IdP protocol which the IdP is using. This is 1130 a completely IdP-specific string, but allows an IdP to implement 1131 two protocols in parallel. This value may be the empty string. 1133 Each IdP MUST serve its initial entry page (i.e., the one loaded by 1134 the IdP proxy) from the well-known URI specified in "/.well-known/ 1135 idp-proxy/" on the IdP's web site. This URI MUST be loaded 1136 via HTTPS [RFC2818]. For example, for the IdP "identity.example.com" 1137 and the protocol "example", the URL would be: 1139 https://example.com/.well-known/idp-proxy/example 1141 5.6.5.2.1.1. Authenticating Party 1143 How an AP determines the appropriate IdP domain is out of scope of 1144 this specification. In general, however, the AP has some actual 1145 account relationship with the IdP, as this identity is what the IdP 1146 is attesting to. Thus, the AP somehow supplies the IdP information 1147 to the browser. Some potential mechanisms include: 1149 o Provided by the user directly. 1150 o Selected from some set of IdPs known to the calling site. E.g., a 1151 button that shows "Authenticate via Facebook Connect" 1153 5.6.5.2.1.2. Relying Party 1155 Unlike the AP, the RP need not have any particular relationship with 1156 the IdP. Rather, it needs to be able to process whatever assertion 1157 is provided by the AP. As the assertion contains the IdP's identity, 1158 the URI can be constructed directly from the assertion, and thus the 1159 RP can directly verify the technical validity of the assertion with 1160 no user interaction. Authoritative assertions need only be 1161 verifiable. Third-party assertions also MUST be verified against 1162 local policy, as described in Section 5.6.5.2.3.1. 1164 5.6.5.2.2. Requesting Assertions 1166 In order to request an assertion, the PeerConnection sends a "SIGN" 1167 message. Aside from the mandatory fields, this message has a 1168 "message" field containing a string. The contents of this string are 1169 defined above, but are opaque from the perspective of the IdP. 1171 A successful response to a "SIGN" message contains a message field 1172 which is a JS dictionary consisting of two fields: 1174 idp: A dictionary containing the domain name of the provider and the 1175 protocol string 1176 assertion: An opaque field containing the assertion itself. This is 1177 only interpretable by the idp or its proxy. 1179 Figure 6 shows an example transaction, with the message "abcde..." 1180 (remember, the messages are opaque at this layer) being signed and 1181 bound to identity "ekr@example.org". In this case, the message has 1182 presumably been digitally signed/MACed in some way that the IdP can 1183 later verify it, but this is an implementation detail and out of 1184 scope of this document. Line breaks are inserted solely for 1185 readability. 1187 PeerConnection -> IdP proxy: 1188 { 1189 "type":"SIGN", 1190 "id":1, 1191 "origin":"https://calling-service.example.com/", 1192 "message":"abcdefghijklmnopqrstuvwyz" 1193 } 1195 IdPProxy -> PeerConnection: 1196 { 1197 "type":"SUCCESS", 1198 "id":1, 1199 "message": { 1200 "idp":{ 1201 "domain": "example.org" 1202 "protocol": "bogus" 1203 }, 1204 "assertion": "{\"identity\":\"bob@example.org\", 1205 \"contents\":\"abcdefghijklmnopqrstuvwyz\", 1206 \"request_origin\":\"rtcweb://peerconnection\", 1207 \"signature\":\"010203040506\"}" 1208 } 1209 } 1211 Figure 6: Example assertion request 1213 The message structure is serialized, base64-encoded, and placed in an 1214 a=identity attribute. 1216 5.6.5.2.3. Verifying Assertions 1218 In order to verify an assertion, an RP sends a "VERIFY" message to 1219 the IdP proxy containing the assertion supplied by the AP in the 1220 "message" field. 1222 The IdP proxy verifies the assertion. Depending on the identity 1223 protocol, this may require one or more round trips to the IdP. For 1224 instance, an OAuth-based protocol will likely require using the IdP 1225 as an oracle, whereas with BrowserID the IdP proxy can likely verify 1226 the signature on the assertion without contacting the IdP, provided 1227 that it has cached the IdP's public key. 1229 Regardless of the mechanism, if verification succeeds, a successful 1230 response from the IdP proxy MUST contain a message field consisting 1231 of a dictionary/hash with the following fields: 1233 identity The identity of the AP from the IdP's perspective. Details 1234 of this are provided in Section 5.6.5.2.3.1 1235 contents The original unmodified string provided by the AP in the 1236 original SIGN request. 1237 request_origin The original origin of the SIGN request on the AP 1238 side as determined by the origin of the PostMessage call. The IdP 1239 MUST somehow arrange to propagate this information as part of the 1240 assertion. The receiving PeerConnection MUST verify that this 1241 value is "rtcweb://peerconnection" (which implies that 1242 PeerConnection must arrange that its messages to the IdP proxy are 1243 from this origin.) See Section 5.7.4.1 for the security purpose 1244 of this field. [[ OPEN ISSUE: Can a URI person help make a better 1245 URI.]] 1247 Figure 7 shows an example transaction. Line breaks are inserted 1248 solely for readability. 1250 PeerConnection -> IdP Proxy: 1251 { 1252 "type":"VERIFY", 1253 "id":2, 1254 "origin":"https://calling-service.example.com/", 1255 "message":\"{\"identity\":\"bob@example.org\", 1256 \"contents\":\"abcdefghijklmnopqrstuvwyz\", 1257 \"request_origin\":\"rtcweb://peerconnection\", 1258 \"signature\":\"010203040506\"}" 1259 } 1261 IdP Proxy -> PeerConnection: 1262 { 1263 "type":"SUCCESS", 1264 "id":2, 1265 "message": { 1266 "identity" : { 1267 "name" : "bob@example.org", 1268 "displayname" : "Bob" 1269 }, 1270 "request_origin":"rtcweb://peerconnection", 1271 "contents":"abcdefghijklmnopqrstuvwyz" 1272 } 1273 } 1274 Figure 7: Example verification request 1276 5.6.5.2.3.1. Identity Formats 1278 Identities passed from the IdP proxy to the PeerConnection are 1279 structured as JSON dictionaries with one mandatory field: "name". 1280 This field MUST consist of an RFC822-formatted string representing 1281 the user's identity. [[ OPEN ISSUE: Would it be better to have a 1282 typed field? ]] The PeerConnection API MUST check this string as 1283 follows: 1285 1. If the RHS of the string is equal to the domain name of the IdP 1286 proxy, then the assertion is valid, as the IdP is authoritative 1287 for this domain. 1288 2. If the RHS of the string is not equal to the domain name of the 1289 IdP proxy, then the PeerConnection object MUST reject the 1290 assertion unless (a) the IdP domain is listed as an acceptable 1291 third-party IdP and (b) local policy is configured to trust this 1292 IdP domain for the RHS of the identity string. 1294 Sites which have identities that do not fit into the RFC822 style 1295 (for instance, Facebook ids are simple numeric values) SHOULD convert 1296 them to this form by appending their IdP domain (e.g., 1297 12345@identity.facebook.com), thus ensuring that they are 1298 authoritative for the identity. 1300 The IdP proxy MAY also include a "displayname" field which contains a 1301 more user-friendly identity assertion. Browsers SHOULD take care in 1302 the UI to distinguish the "name" assertion which is verifiable 1303 directly from the "displayname" which cannot be verified and thus 1304 relies on trust in the IdP. In future, we may define other fields to 1305 allow the IdP to provide more information to the browser. [[OPEN 1306 ISSUE: Should this field exist? Is it confusing? ]] 1308 5.7. Security Considerations 1310 Much of the security analysis of this problem is contained in 1311 [I-D.ietf-rtcweb-security] or in the discussion of the particular 1312 issues above. In order to avoid repetition, this section focuses on 1313 (a) residual threats that are not addressed by this document and (b) 1314 threats produced by failure/misbehavior of one of the components in 1315 the system. 1317 5.7.1. Communications Security 1319 While this document favors DTLS-SRTP, it permits a variety of 1320 communications security mechanisms and thus the level of 1321 communications security actually provided varies considerably. Any 1322 pair of implementations which have multiple security mechanisms in 1323 common are subject to being downgraded to the weakest of those common 1324 mechanisms by any attacker who can modify the signaling traffic. If 1325 communications are over HTTP, this means any on-path attacker. If 1326 communications are over HTTPS, this means the signaling server. 1327 Implementations which wish to avoid downgrade attack should only 1328 offer the strongest available mechanism, which is DTLS/DTLS-SRTP. 1329 Note that the implication of this choice will be that interop to non- 1330 DTLS-SRTP devices will need to happen through gateways. 1332 Even if only DTLS/DTLS-SRTP are used, the signaling server can 1333 potentially mount a man-in-the-middle attack unless implementations 1334 have some mechanism for independently verifying keys. The UI 1335 requirements in Section 5.5 are designed to provide such a mechanism 1336 for motivated/security conscious users, but are not suitable for 1337 general use. The identity service mechanisms in Section 5.6 are more 1338 suitable for general use. Note, however, that a malicious signaling 1339 service can strip off any such identity assertions, though it cannot 1340 forge new ones. Note that all of the third-party security mechanisms 1341 available (whether X.509 certificates or a third-party IdP) rely on 1342 the security of the third party--this is of course also true of your 1343 connection to the Web site itself. Users who wish to assure 1344 themselves of security against a malicious identity provider can only 1345 do so by verifying peer credentials directly, e.g., by checking the 1346 peer's fingerprint against a value delivered out of band. 1348 In order to protect against malicious content JavaScript, that 1349 JavaScript MUST NOT be allowed to have direct access to---or perform 1350 computations with---DTLS keys. For instance, if content JS were able 1351 to compute digital signatures, then it would be possible for content 1352 JS to get an identity assertion for a browser's generated key and 1353 then use that assertion plus a signature by the key to authenticate a 1354 call protected under an ephemeral DH key controlled by the content 1355 JS, thus violating the security guarantees otherwise provided by the 1356 IdP mechanism. Note that it is not sufficient merely to deny the 1357 content JS direct access to the keys, as some have suggested doing 1358 with the WebCrypto API. [webcrypto]. The JS must also not be allowed 1359 to perform operations that would be valid for a DTLS endpoint. By 1360 far the safest approach is simply to deny the ability to perform any 1361 operations that depend on secret information associated with the key. 1362 Operations that depend on public information, such as exporting the 1363 public key are of course safe. 1365 5.7.2. Privacy 1367 The requirements in this document are intended to allow: 1369 o Users to participate in calls without revealing their location. 1370 o Potential callees to avoid revealing their location and even 1371 presence status prior to agreeing to answer a call. 1373 However, these privacy protections come at a performance cost in 1374 terms of using TURN relays and, in the latter case, delaying ICE. 1375 Sites SHOULD make users aware of these tradeoffs. 1377 Note that the protections provided here assume a non-malicious 1378 calling service. As the calling service always knows the users 1379 status and (absent the use of a technology like Tor) their IP 1380 address, they can violate the users privacy at will. Users who wish 1381 privacy against the calling sites they are using must use separate 1382 privacy enhancing technologies such as Tor. Combined WebRTC/Tor 1383 implementations SHOULD arrange to route the media as well as the 1384 signaling through Tor. Currently this will produce very suboptimal 1385 performance. 1387 Additionally, any identifier which persists across multiple calls is 1388 potentially a problem for privacy, especially for anonymous calling 1389 services. Such services SHOULD instruct the browser to use separate 1390 DTLS keys for each call and also to use TURN throughout the call. 1391 Otherwise, the other side will learn linkable information. 1392 Additionally, browsers SHOULD implement the privacy-preserving CNAME 1393 generation mode of [I-D.ietf-avtcore-6222bis]. 1395 5.7.3. Denial of Service 1397 The consent mechanisms described in this document are intended to 1398 mitigate denial of service attacks in which an attacker uses clients 1399 to send large amounts of traffic to a victim without the consent of 1400 the victim. While these mechanisms are sufficient to protect victims 1401 who have not implemented WebRTC at all, WebRTC implementations need 1402 to be more careful. 1404 Consider the case of a call center which accepts calls via RTCWeb. 1405 An attacker proxies the call center's front-end and arranges for 1406 multiple clients to initiate calls to the call center. Note that 1407 this requires user consent in many cases but because the data channel 1408 does not need consent, he can use that directly. Since ICE will 1409 complete, browsers can then be induced to send large amounts of data 1410 to the victim call center if it supports the data channel at all. 1411 Preventing this attack requires that automated WebRTC implementations 1412 implement sensible flow control and have the ability to triage out 1413 (i.e., stop responding to ICE probes on) calls which are behaving 1414 badly, and especially to be prepared to remotely throttle the data 1415 channel in the absence of plausible audio and video (which the 1416 attacker cannot control). 1418 Another related attack is for the signaling service to swap the ICE 1419 candidates for the audio and video streams, thus forcing a browser to 1420 send video to the sink that the other victim expects will contain 1421 audio (perhaps it is only expecting audio!) potentially causing 1422 overload. Muxing multiple media flows over a single transport makes 1423 it harder to individually suppress a single flow by denying ICE 1424 keepalives. Either media-level (RTCP) mechanisms must be used or the 1425 implementation must deny responses entirely, thus terminating the 1426 call. 1428 Yet another attack, suggested by Magnus Westerlund, is for the 1429 attacker to cross-connect offers and answers as follows. It induces 1430 the victim to make a call and then uses its control of other users 1431 browsers to get them to attempt a call to someone. It then 1432 translates their offers into apparent answers to the victim, which 1433 looks like large-scale parallel forking. The victim still responds 1434 to ICE responses and now the browsers all try to send media to the 1435 victim. Implementations can defend themselves from this attack by 1436 only responding to ICE Binding Requests for a limited number of 1437 remote ufrags (this is the reason for the requirement that the JS not 1438 be able to control the ufrag and password). 1440 Note that attacks based on confusing one end or the other about 1441 consent are possible even in the face of the third-party identity 1442 mechanism as long as major parts of the signaling messages are not 1443 signed. On the other hand, signing the entire message severely 1444 restricts the capabilities of the calling application, so there are 1445 difficult tradeoffs here. 1447 5.7.4. IdP Authentication Mechanism 1449 This mechanism relies for its security on the IdP and on the 1450 PeerConnection correctly enforcing the security invariants described 1451 above. At a high level, the IdP is attesting that the user 1452 identified in the assertion wishes to be associated with the 1453 assertion. Thus, it must not be possible for arbitrary third parties 1454 to get assertions tied to a user or to produce assertions that RPs 1455 will accept. 1457 5.7.4.1. PeerConnection Origin Check 1459 Fundamentally, the IdP proxy is just a piece of HTML and JS loaded by 1460 the browser, so nothing stops a Web attacker o from creating their 1461 own IFRAME, loading the IdP proxy HTML/JS, and requesting a 1462 signature. In order to prevent this attack, we require that all 1463 signatures be tied to a specific origin ("rtcweb://...") which cannot 1464 be produced by content JavaScript. Thus, while an attacker can 1465 instantiate the IdP proxy, they cannot send messages from an 1466 appropriate origin and so cannot create acceptable assertions. I.e., 1467 the assertion request must have come from the browser. This origin 1468 check is enforced on the relying party side, not on the 1469 authenticating party side. The reason for this is to take the burden 1470 of knowing which origins are valid off of the IdP, thus making this 1471 mechanism extensible to other applications besides WebRTC. The IdP 1472 simply needs to gather the origin information (from the posted 1473 message) and attach it to the assertion. 1475 Note that although this origin check is enforced on the RP side and 1476 not at the IdP, it is absolutely imperative that it be done. The 1477 mechanisms in this document rely on the browser enforcing access 1478 restrictions on the DTLS keys and assertion requests which do not 1479 come with the right origin may be from content JS rather than from 1480 browsers, and therefore those access restrictions cannot be assumed. 1482 Note that this check only asserts that the browser (or some other 1483 entity with access to the user's authentication data) attests to the 1484 request and hence to the fingerprint. It does not demonstrate that 1485 the browser has access to the associated private key. However, 1486 attaching one's identity to a key that the user does not control does 1487 not appear to provide substantial leverage to an attacker, so a proof 1488 of possession is omitted for simplicity. 1490 5.7.4.2. IdP Well-known URI 1492 As described in Section 5.6.5.2.1 the IdP proxy HTML/JS landing page 1493 is located at a well-known URI based on the IdP's domain name. This 1494 requirement prevents an attacker who can write some resources at the 1495 IdP (e.g., on one's Facebook wall) from being able to impersonate the 1496 IdP. 1498 5.7.4.3. Privacy of IdP-generated identities and the hosting site 1500 Depending on the structure of the IdP's assertions, the calling site 1501 may learn the user's identity from the perspective of the IdP. In 1502 many cases this is not an issue because the user is authenticating to 1503 the site via the IdP in any case, for instance when the user has 1504 logged in with Facebook Connect and is then authenticating their call 1505 with a Facebook identity. However, in other case, the user may not 1506 have already revealed their identity to the site. In general, IdPs 1507 SHOULD either verify that the user is willing to have their identity 1508 revealed to the site (e.g., through the usual IdP permissions dialog) 1509 or arrange that the identity information is only available to known 1510 RPs (e.g., social graph adjacencies) but not to the calling site. 1511 The "origin" field of the signature request can be used to check that 1512 the user has agreed to disclose their identity to the calling site; 1513 because it is supplied by the PeerConnection it can be trusted to be 1514 correct. 1516 5.7.4.4. Security of Third-Party IdPs 1518 As discussed above, each third-party IdP represents a new universal 1519 trust point and therefore the number of these IdPs needs to be quite 1520 limited. Most IdPs, even those which issue unqualified identities 1521 such as Facebook, can be recast as authoritative IdPs (e.g., 1522 123456@facebook.com). However, in such cases, the user interface 1523 implications are not entirely desirable. One intermediate approach 1524 is to have special (potentially user configurable) UI for large 1525 authoritative IdPs, thus allowing the user to instantly grasp that 1526 the call is being authenticated by Facebook, Google, etc. 1528 5.7.4.5. Web Security Feature Interactions 1530 A number of optional Web security features have the potential to 1531 cause issues for this mechanism, as discussed below. 1533 5.7.4.5.1. Popup Blocking 1535 If the user is not already logged into the IdP, the IdP proxy may 1536 need to pop up a top level window in order to prompt the user for 1537 their authentication information (it is bad practice to do this in an 1538 IFRAME inside the window because then users have no way to determine 1539 the destination for their password). If the user's browser is 1540 configured to prevent popups, this may fail (depending on the exact 1541 algorithm that the popup blocker uses to suppress popups). It may be 1542 necessary to provide a standardized mechanism to allow the IdP proxy 1543 to request popping of a login window. Note that care must be taken 1544 here to avoid PeerConnection becoming a general escape hatch from 1545 popup blocking. One possibility would be to only allow popups when 1546 the user has explicitly registered a given IdP as one of theirs (this 1547 is only relevant at the AP side in any case). 1549 5.7.4.5.2. Third Party Cookies 1551 Some browsers allow users to block third party cookies (cookies 1552 associated with origins other than the top level page) for privacy 1553 reasons. Any IdP which uses cookies to persist logins will be broken 1554 by third-party cookie blocking. One option is to accept this as a 1555 limitation; another is to have the PeerConnection object disable 1556 third-party cookie blocking for the IdP proxy. 1558 5.8. IANA Considerations 1560 [TODO: IANA registration for Identity header. Or should this be in 1561 MMUSIC?] 1563 6. Acknowledgements 1565 Bernard Aboba, Harald Alvestrand, Richard Barnes, Dan Druta, Cullen 1566 Jennings, Hadriel Kaplan, Matthew Kaufman, Jim McEachern, Martin 1567 Thomson, Magnus Westerland. Matthew Kaufman provided the UI material 1568 in Section 5.5. 1570 7. Changes 1572 7.1. Changes since -06 1574 Replaced RTCWEB and RTC-Web with WebRTC, except when referring to the 1575 IETF WG 1577 Forbade use in mixed content as discussed in Orlando. 1579 Added a requirement to surface NULL ciphers to the top-level. 1581 Tried to clarify SRTP versus DTLS-SRTP. 1583 Added a section on screen sharing permissions. 1585 Assorted editorial work. 1587 7.2. Changes since -05 1589 The following changes have been made since the -05 draft. 1591 o Response to comments from Richard Barnes 1592 o More explanation of the IdP security properties and the federation 1593 use case. 1594 o Editorial cleanup. 1596 7.3. Changes since -03 1598 Version -04 was a version control mistake. Please ignore. 1600 The following changes have been made since the -04 draft. 1602 o Move origin check from IdP to RP per discussion in YVR. 1603 o Clarified treatment of X.509-level identities. 1604 o Editorial cleanup. 1606 7.4. Changes since -03 1607 7.5. Changes since -02 1609 The following changes have been made since the -02 draft. 1611 o Forbid persistent HTTP permissions. 1612 o Clarified the text in S 5.4 to clearly refer to requirements on 1613 the API to provide functionality to the site. 1614 o Fold in the IETF portion of draft-rescorla-rtcweb-generic-idp 1615 o Retarget the continuing consent section to assume Binding Requests 1616 o Added some more privacy and linkage text in various places. 1617 o Editorial improvements 1619 8. References 1621 8.1. Normative References 1623 [I-D.ietf-avtcore-6222bis] 1624 Begen, A., Perkins, C., Wing, D., and E. Rescorla, 1625 "Guidelines for Choosing RTP Control Protocol (RTCP) 1626 Canonical Names (CNAMEs)", draft-ietf-avtcore-6222bis-06 1627 (work in progress), July 2013. 1629 [I-D.ietf-rtcweb-security] 1630 Rescorla, E., "Security Considerations for WebRTC", 1631 draft-ietf-rtcweb-security-05 (work in progress), 1632 July 2013. 1634 [I-D.ietf-tsvwg-sctp-dtls-encaps] 1635 Tuexen, M., Stewart, R., Jesup, R., and S. Loreto, "DTLS 1636 Encapsulation of SCTP Packets", 1637 draft-ietf-tsvwg-sctp-dtls-encaps-02 (work in progress), 1638 October 2013. 1640 [I-D.muthu-behave-consent-freshness] 1641 Perumal, M., Wing, D., R, R., and T. Reddy, "STUN Usage 1642 for Consent Freshness", 1643 draft-muthu-behave-consent-freshness-04 (work in 1644 progress), July 2013. 1646 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1647 Requirement Levels", BCP 14, RFC 2119, March 1997. 1649 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. 1651 [RFC3711] Baugher, M., McGrew, D., Naslund, M., Carrara, E., and K. 1652 Norrman, "The Secure Real-time Transport Protocol (SRTP)", 1653 RFC 3711, March 2004. 1655 [RFC4347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer 1656 Security", RFC 4347, April 2006. 1658 [RFC4572] Lennox, J., "Connection-Oriented Media Transport over the 1659 Transport Layer Security (TLS) Protocol in the Session 1660 Description Protocol (SDP)", RFC 4572, July 2006. 1662 [RFC4627] Crockford, D., "The application/json Media Type for 1663 JavaScript Object Notation (JSON)", RFC 4627, July 2006. 1665 [RFC5245] Rosenberg, J., "Interactive Connectivity Establishment 1666 (ICE): A Protocol for Network Address Translator (NAT) 1667 Traversal for Offer/Answer Protocols", RFC 5245, 1668 April 2010. 1670 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 1671 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 1673 [RFC5763] Fischl, J., Tschofenig, H., and E. Rescorla, "Framework 1674 for Establishing a Secure Real-time Transport Protocol 1675 (SRTP) Security Context Using Datagram Transport Layer 1676 Security (DTLS)", RFC 5763, May 2010. 1678 [RFC5764] McGrew, D. and E. Rescorla, "Datagram Transport Layer 1679 Security (DTLS) Extension to Establish Keys for the Secure 1680 Real-time Transport Protocol (SRTP)", RFC 5764, May 2010. 1682 [RFC6454] Barth, A., "The Web Origin Concept", RFC 6454, 1683 December 2011. 1685 [webcrypto] 1686 Dahl, Sleevi, "Web Cryptography API", June 2013. 1688 Available at http://www.w3.org/TR/WebCryptoAPI/ 1690 [webrtc-api] 1691 Bergkvist, Burnett, Jennings, Narayanan, "WebRTC 1.0: 1692 Real-time Communication Between Browsers", October 2011. 1694 Available at 1695 http://dev.w3.org/2011/webrtc/editor/webrtc.html 1697 8.2. Informative References 1699 [I-D.ietf-rtcweb-jsep] 1700 Uberti, J. and C. Jennings, "Javascript Session 1701 Establishment Protocol", draft-ietf-rtcweb-jsep-05 (work 1702 in progress), October 2013. 1704 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 1705 A., Peterson, J., Sparks, R., Handley, M., and E. 1706 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 1707 June 2002. 1709 [RFC5705] Rescorla, E., "Keying Material Exporters for Transport 1710 Layer Security (TLS)", RFC 5705, March 2010. 1712 [RFC6455] Fette, I. and A. Melnikov, "The WebSocket Protocol", 1713 RFC 6455, December 2011. 1715 [XmlHttpRequest] 1716 van Kesteren, A., "XMLHttpRequest Level 2". 1718 Appendix A. Example IdP Bindings to Specific Protocols 1720 [[TODO: These still need some cleanup.]] 1722 This section provides some examples of how the mechanisms described 1723 in this document could be used with existing authentication protocols 1724 such as BrowserID or OAuth. Note that this does not require browser- 1725 level support for either protocol. Rather, the protocols can be fit 1726 into the generic framework. (Though BrowserID in particular works 1727 better with some client side support). 1729 A.1. BrowserID 1731 BrowserID [https://browserid.org/] is a technology which allows a 1732 user with a verified email address to generate an assertion 1733 (authenticated by their identity provider) attesting to their 1734 identity (phrased as an email address). The way that this is used in 1735 practice is that the relying party embeds JS in their site which 1736 talks to the BrowserID code (either hosted on a trusted intermediary 1737 or embedded in the browser). That code generates the assertion which 1738 is passed back to the relying party for verification. The assertion 1739 can be verified directly or with a Web service provided by the 1740 identity provider. It's relatively easy to extend this functionality 1741 to authenticate WebRTC calls, as shown below. 1743 +----------------------+ +----------------------+ 1744 | | | | 1745 | Alice's Browser | | Bob's Browser | 1746 | | OFFER ------------> | | 1747 | Calling JS Code | | Calling JS Code | 1748 | ^ | | ^ | 1749 | | | | | | 1750 | v | | v | 1751 | PeerConnection | | PeerConnection | 1752 | | ^ | | | ^ | 1753 | Finger| |Signed | |Signed | | | 1754 | print | |Finger | |Finger | |"Alice"| 1755 | | |print | |print | | | 1756 | v | | | v | | 1757 | +--------------+ | | +---------------+ | 1758 | | IdP Proxy | | | | IdP Proxy | | 1759 | | to | | | | to | | 1760 | | BrowserID | | | | BrowserID | | 1761 | | Signer | | | | Verifier | | 1762 | +--------------+ | | +---------------+ | 1763 | ^ | | ^ | 1764 +-----------|----------+ +----------|-----------+ 1765 | | 1766 | Get certificate | 1767 v | Check 1768 +----------------------+ | certificate 1769 | | | 1770 | Identity |/-------------------------------+ 1771 | Provider | 1772 | | 1773 +----------------------+ 1775 The way this mechanism works is as follows. On Alice's side, Alice 1776 goes to initiate a call. 1778 1. The calling JS instantiates a PeerConnection and tells it that it 1779 is interested in having it authenticated via BrowserID (i.e., it 1780 provides "browserid.org" as the IdP name.) 1781 2. The PeerConnection instantiates the BrowserID signer in the IdP 1782 proxy 1783 3. The BrowserID signer contacts Alice's identity provider, 1784 authenticating as Alice (likely via a cookie). 1785 4. The identity provider returns a short-term certificate attesting 1786 to Alice's identity and her short-term public key. 1787 5. The Browser-ID code signs the fingerprint and returns the signed 1788 assertion + certificate to the PeerConnection. 1790 6. The PeerConnection returns the signed information to the calling 1791 JS code. 1792 7. The signed assertion gets sent over the wire to Bob's browser 1793 (via the signaling service) as part of the call setup. 1795 The offer might look something like: 1797 { 1798 "type":"OFFER", 1799 "sdp": 1800 "v=0\n 1801 o=- 2890844526 2890842807 IN IP4 192.0.2.1\n 1802 s= \n 1803 c=IN IP4 192.0.2.1\n 1804 t=2873397496 2873404696\n 1805 a=fingerprint:SHA-1 ...\n 1806 4A:AD:B9:B1:3F:82:18:3B:54:02:12:DF:3E:5D:49:6B:19:E5:7C:AB\n 1807 a=identity [[base-64 encoding of identity assertion: 1808 { 1809 "idp":{ // Standardized 1810 "domain":"browserid.org", 1811 "method":"default" 1812 }, 1813 // Assertion contents are browserid-specific 1814 "assertion": "{ 1815 \"assertion\": { 1816 \"digest\":\"\", 1817 \"audience\": \"\" 1818 \"valid-until\": 1308859352261, 1819 }, 1820 \"certificate\": { 1821 \"email\": \"rescorla@example.org\", 1822 \"public-key\": \"\", 1823 \"valid-until\": 1308860561861, 1824 \"signature\": \"\" 1825 }, 1826 \"content\": \"\" 1827 }" 1828 } 1829 ]]\n 1830 m=audio 49170 RTP/AVP 0\n 1831 ..." 1832 } 1834 Note that while the IdP here is specified as "browserid.org", the 1835 actual certificate is signed by example.org. This is because 1836 BrowserID is a combined authoritative/third-party system in which 1837 browserid.org delegates the right to be authoritative (what BrowserID 1838 calls primary) to individual domains. 1840 On Bob's side, he receives the signed assertion as part of the call 1841 setup message and a similar procedure happens to verify it. 1843 1. The calling JS instantiates a PeerConnection and provides it the 1844 relevant signaling information, including the signed assertion. 1845 2. The PeerConnection instantiates the IdP proxy which examines the 1846 IdP name and brings up the BrowserID verification code. 1847 3. The BrowserID verifier contacts the identity provider to verify 1848 the certificate and then uses the key to verify the signed 1849 fingerprint. 1850 4. Alice's verified identity is returned to the PeerConnection (it 1851 already has the fingerprint). 1852 5. At this point, Bob's browser can display a trusted UI indication 1853 that Alice is on the other end of the call. 1855 When Bob returns his answer, he follows the converse procedure, which 1856 provides Alice with a signed assertion of Bob's identity and keying 1857 material. 1859 A.2. OAuth 1861 While OAuth is not directly designed for user-to-user authentication, 1862 with a little lateral thinking it can be made to serve. We use the 1863 following mapping of OAuth concepts to WebRTC concepts: 1865 +----------------------+----------------------+ 1866 | OAuth | WebRTC | 1867 +----------------------+----------------------+ 1868 | Client | Relying party | 1869 | Resource owner | Authenticating party | 1870 | Authorization server | Identity service | 1871 | Resource server | Identity service | 1872 +----------------------+----------------------+ 1874 Table 1 1876 The idea here is that when Alice wants to authenticate to Bob (i.e., 1877 for Bob to be aware that she is calling). In order to do this, she 1878 allows Bob to see a resource on the identity provider that is bound 1879 to the call, her identity, and her public key. Then Bob retrieves 1880 the resource from the identity provider, thus verifying the binding 1881 between Alice and the call. 1883 Alice IdP Bob 1884 --------------------------------------------------------- 1885 Call-Id, Fingerprint -------> 1886 <------------------- Auth Code 1887 Auth Code ----------------------------------------------> 1888 <----- Get Token + Auth Code 1889 Token ---------------------> 1890 <------------- Get call-info 1891 Call-Id, Fingerprint ------> 1893 This is a modified version of a common OAuth flow, but omits the 1894 redirects required to have the client point the resource owner to the 1895 IdP, which is acting as both the resource server and the 1896 authorization server, since Alice already has a handle to the IdP. 1898 Above, we have referred to "Alice", but really what we mean is the 1899 PeerConnection. Specifically, the PeerConnection will instantiate an 1900 IFRAME with JS from the IdP and will use that IFRAME to communicate 1901 with the IdP, authenticating with Alice's identity (e.g., cookie). 1902 Similarly, Bob's PeerConnection instantiates an IFRAME to talk to the 1903 IdP. 1905 Author's Address 1907 Eric Rescorla 1908 RTFM, Inc. 1909 2064 Edgewood Drive 1910 Palo Alto, CA 94303 1911 USA 1913 Phone: +1 650 678 2350 1914 Email: ekr@rtfm.com