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