idnits 2.17.1 draft-ietf-rtcweb-security-arch-10.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 4, 2014) is 3583 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Outdated reference: A later version (-26) exists of draft-ietf-rtcweb-rtp-usage-15 == Outdated reference: A later version (-12) exists of draft-ietf-rtcweb-security-06 == Outdated reference: A later version (-09) exists of draft-ietf-tsvwg-sctp-dtls-encaps-04 ** Obsolete normative reference: RFC 2818 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 4347 (Obsoleted by RFC 6347) ** Obsolete normative reference: RFC 4566 (Obsoleted by RFC 8866) ** 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) ** Obsolete normative reference: RFC 5785 (Obsoleted by RFC 8615) -- Possible downref: Non-RFC (?) normative reference: ref. 'WebMessaging' == Outdated reference: A later version (-26) exists of draft-ietf-rtcweb-jsep-06 -- Obsolete informational reference (is this intentional?): RFC 2617 (Obsoleted by RFC 7235, RFC 7615, RFC 7616, RFC 7617) Summary: 8 errors (**), 0 flaws (~~), 7 warnings (==), 4 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 4, 2014 5 Expires: January 5, 2015 7 WebRTC Security Architecture 8 draft-ietf-rtcweb-security-arch-10 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 WebRTC. 18 Status of this Memo 20 This Internet-Draft is submitted in full conformance with the 21 provisions of BCP 78 and BCP 79. 23 Internet-Drafts are working documents of the Internet Engineering 24 Task Force (IETF). Note that other groups may also distribute 25 working documents as Internet-Drafts. The list of current Internet- 26 Drafts is at http://datatracker.ietf.org/drafts/current/. 28 Internet-Drafts are draft documents valid for a maximum of six months 29 and may be updated, replaced, or obsoleted by other documents at any 30 time. It is inappropriate to use Internet-Drafts as reference 31 material or to cite them other than as "work in progress." 33 This Internet-Draft will expire on January 5, 2015. 35 Copyright Notice 37 Copyright (c) 2014 IETF Trust and the persons identified as the 38 document authors. All rights reserved. 40 This document is subject to BCP 78 and the IETF Trust's Legal 41 Provisions Relating to IETF Documents 42 (http://trustee.ietf.org/license-info) in effect on the date of 43 publication of this document. Please review these documents 44 carefully, as they describe your rights and restrictions with respect 45 to this document. Code Components extracted from this document must 46 include Simplified BSD License text as described in Section 4.e of 47 the Trust Legal Provisions and are provided without warranty as 48 described in the Simplified BSD License. 50 This document may contain material from IETF Documents or IETF 51 Contributions published or made publicly available before November 52 10, 2008. The person(s) controlling the copyright in some of this 53 material may not have granted the IETF Trust the right to allow 54 modifications of such material outside the IETF Standards Process. 55 Without obtaining an adequate license from the person(s) controlling 56 the copyright in such materials, this document may not be modified 57 outside the IETF Standards Process, and derivative works of it may 58 not be created outside the IETF Standards Process, except to format 59 it for publication as an RFC or to translate it into languages other 60 than English. 62 Table of Contents 64 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 65 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5 66 3. Trust Model . . . . . . . . . . . . . . . . . . . . . . . . . 5 67 3.1. Authenticated Entities . . . . . . . . . . . . . . . . . . 6 68 3.2. Unauthenticated Entities . . . . . . . . . . . . . . . . . 6 69 4. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 70 4.1. Initial Signaling . . . . . . . . . . . . . . . . . . . . 9 71 4.2. Media Consent Verification . . . . . . . . . . . . . . . . 11 72 4.3. DTLS Handshake . . . . . . . . . . . . . . . . . . . . . . 12 73 4.4. Communications and Consent Freshness . . . . . . . . . . . 12 74 5. Detailed Technical Description . . . . . . . . . . . . . . . . 13 75 5.1. Origin and Web Security Issues . . . . . . . . . . . . . . 13 76 5.2. Device Permissions Model . . . . . . . . . . . . . . . . . 13 77 5.3. Communications Consent . . . . . . . . . . . . . . . . . . 15 78 5.4. IP Location Privacy . . . . . . . . . . . . . . . . . . . 16 79 5.5. Communications Security . . . . . . . . . . . . . . . . . 17 80 5.6. Web-Based Peer Authentication . . . . . . . . . . . . . . 18 81 5.6.1. Trust Relationships: IdPs, APs, and RPs . . . . . . . 19 82 5.6.2. Overview of Operation . . . . . . . . . . . . . . . . 21 83 5.6.3. Items for Standardization . . . . . . . . . . . . . . 22 84 5.6.4. Binding Identity Assertions to JSEP Offer/Answer 85 Transactions . . . . . . . . . . . . . . . . . . . . . 22 86 5.6.4.1. Input to Assertion Generation Process . . . . . . 22 87 5.6.4.2. Carrying Identity Assertions . . . . . . . . . . . 23 88 5.6.4.3. a=identity Attribute . . . . . . . . . . . . . . . 24 89 5.6.5. IdP Interaction Details . . . . . . . . . . . . . . . 24 90 5.6.5.1. General Message Structure . . . . . . . . . . . . 24 91 5.6.5.2. Errors . . . . . . . . . . . . . . . . . . . . . . 25 92 5.6.5.3. IdP Proxy Setup . . . . . . . . . . . . . . . . . 26 93 5.6.5.4. Verifying Assertions . . . . . . . . . . . . . . . 30 94 6. Security Considerations . . . . . . . . . . . . . . . . . . . 31 95 6.1. Communications Security . . . . . . . . . . . . . . . . . 31 96 6.2. Privacy . . . . . . . . . . . . . . . . . . . . . . . . . 32 97 6.3. Denial of Service . . . . . . . . . . . . . . . . . . . . 33 98 6.4. IdP Authentication Mechanism . . . . . . . . . . . . . . . 34 99 6.4.1. PeerConnection Origin Check . . . . . . . . . . . . . 34 100 6.4.2. IdP Well-known URI . . . . . . . . . . . . . . . . . . 35 101 6.4.3. Privacy of IdP-generated identities and the 102 hosting site . . . . . . . . . . . . . . . . . . . . . 35 103 6.4.4. Security of Third-Party IdPs . . . . . . . . . . . . . 36 104 6.4.5. Web Security Feature Interactions . . . . . . . . . . 36 105 6.4.5.1. Popup Blocking . . . . . . . . . . . . . . . . . . 36 106 6.4.5.2. Third Party Cookies . . . . . . . . . . . . . . . 36 107 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 36 108 8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 37 109 9. Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 110 9.1. Changes since -06 . . . . . . . . . . . . . . . . . . . . 37 111 9.2. Changes since -05 . . . . . . . . . . . . . . . . . . . . 37 112 9.3. Changes since -03 . . . . . . . . . . . . . . . . . . . . 37 113 9.4. Changes since -03 . . . . . . . . . . . . . . . . . . . . 38 114 9.5. Changes since -02 . . . . . . . . . . . . . . . . . . . . 38 115 10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 38 116 10.1. Normative References . . . . . . . . . . . . . . . . . . . 38 117 10.2. Informative References . . . . . . . . . . . . . . . . . . 40 118 Appendix A. Example IdP Bindings to Specific Protocols . . . . . 41 119 A.1. BrowserID . . . . . . . . . . . . . . . . . . . . . . . . 41 120 A.2. OAuth . . . . . . . . . . . . . . . . . . . . . . . . . . 44 121 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 45 123 1. Introduction 125 The Real-Time Communications on the Web (WebRTC) working group is 126 tasked with standardizing protocols for real-time communications 127 between Web browsers. The major use cases for WebRTC technology are 128 real-time audio and/or video calls, Web conferencing, and direct data 129 transfer. Unlike most conventional real-time systems, (e.g., SIP- 130 based[RFC3261] soft phones) WebRTC communications are directly 131 controlled by some Web server, via a JavaScript (JS) API as shown in 132 Figure 1. 134 +----------------+ 135 | | 136 | Web Server | 137 | | 138 +----------------+ 139 ^ ^ 140 / \ 141 HTTP / \ HTTP 142 / \ 143 / \ 144 v v 145 JS API JS API 146 +-----------+ +-----------+ 147 | | Media | | 148 | Browser |<---------->| Browser | 149 | | | | 150 +-----------+ +-----------+ 152 Figure 1: A simple WebRTC system 154 A more complicated system might allow for interdomain calling, as 155 shown in Figure 2. The protocol to be used between the domains is 156 not standardized by WebRTC, but given the installed base and the form 157 of the WebRTC API is likely to be something SDP-based like SIP. 159 +--------------+ +--------------+ 160 | | SIP,XMPP,...| | 161 | Web Server |<----------->| Web Server | 162 | | | | 163 +--------------+ +--------------+ 164 ^ ^ 165 | | 166 HTTP | | HTTP 167 | | 168 v v 169 JS API JS API 170 +-----------+ +-----------+ 171 | | Media | | 172 | Browser |<---------------->| Browser | 173 | | | | 174 +-----------+ +-----------+ 176 Figure 2: A multidomain WebRTC system 178 This system presents a number of new security challenges, which are 179 analyzed in [I-D.ietf-rtcweb-security]. This document describes a 180 security architecture for WebRTC which addresses the threats and 181 requirements described in that document. 183 2. Terminology 185 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 186 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 187 document are to be interpreted as described in RFC 2119 [RFC2119]. 189 3. Trust Model 191 The basic assumption of this architecture is that network resources 192 exist in a hierarchy of trust, rooted in the browser, which serves as 193 the user's TRUSTED COMPUTING BASE (TCB). Any security property which 194 the user wishes to have enforced must be ultimately guaranteed by the 195 browser (or transitively by some property the browser verifies). 196 Conversely, if the browser is compromised, then no security 197 guarantees are possible. Note that there are cases (e.g., Internet 198 kiosks) where the user can't really trust the browser that much. In 199 these cases, the level of security provided is limited by how much 200 they trust the browser. 202 Optimally, we would not rely on trust in any entities other than the 203 browser. However, this is unfortunately not possible if we wish to 204 have a functional system. Other network elements fall into two 205 categories: those which can be authenticated by the browser and thus 206 are partly trusted--though to the minimum extent necessary--and those 207 which cannot be authenticated and thus are untrusted. 209 3.1. Authenticated Entities 211 There are two major classes of authenticated entities in the system: 213 o Calling services: Web sites whose origin we can verify (optimally 214 via HTTPS, but in some cases because we are on a topologically 215 restricted network, such as behind a firewall, and can infer 216 authentication from firewall behavior). 217 o Other users: WebRTC peers whose origin we can verify 218 cryptographically (optimally via DTLS-SRTP). 220 Note that merely being authenticated does not make these entities 221 trusted. For instance, just because we can verify that 222 https://www.evil.org/ is owned by Dr. Evil does not mean that we can 223 trust Dr. Evil to access our camera and microphone. However, it 224 gives the user an opportunity to determine whether he wishes to trust 225 Dr. Evil or not; after all, if he desires to contact Dr. Evil 226 (perhaps to arrange for ransom payment), it's safe to temporarily 227 give him access to the camera and microphone for the purpose of the 228 call, but he doesn't want Dr. Evil to be able to access his camera 229 and microphone other than during the call. The point here is that we 230 must first identify other elements before we can determine whether 231 and how much to trust them. Additionally, sometimes we need to 232 identify the communicating peer before we know what policies to 233 apply. 235 It's also worth noting that there are settings where authentication 236 is non-cryptographic, such as other machines behind a firewall. 237 Naturally, the level of trust one can have in identities verified in 238 this way depends on how strong the topology enforcement is. 240 3.2. Unauthenticated Entities 242 Other than the above entities, we are not generally able to identify 243 other network elements, thus we cannot trust them. This does not 244 mean that it is not possible to have any interaction with them, but 245 it means that we must assume that they will behave maliciously and 246 design a system which is secure even if they do so. 248 4. Overview 250 This section describes a typical RTCWeb session and shows how the 251 various security elements interact and what guarantees are provided 252 to the user. The example in this section is a "best case" scenario 253 in which we provide the maximal amount of user authentication and 254 media privacy with the minimal level of trust in the calling service. 255 Simpler versions with lower levels of security are also possible and 256 are noted in the text where applicable. It's also important to 257 recognize the tension between security (or performance) and privacy. 258 The example shown here is aimed towards settings where we are more 259 concerned about secure calling than about privacy, but as we shall 260 see, there are settings where one might wish to make different 261 tradeoffs--this architecture is still compatible with those settings. 263 For the purposes of this example, we assume the topology shown in the 264 figures below. This topology is derived from the topology shown in 265 Figure 1, but separates Alice and Bob's identities from the process 266 of signaling. Specifically, Alice and Bob have relationships with 267 some Identity Provider (IdP) that supports a protocol such as OpenID 268 or BrowserID) that can be used to demonstrate their identity to other 269 parties. For instance, Alice might have an account with a social 270 network which she can then use to authenticate to other web sites 271 without explicitly having an account with those sites; this is a 272 fairly conventional pattern on the Web. Section 5.6.1 provides an 273 overview of Identity Providers and the relevant terminology. Alice 274 and Bob might have relationships with different IdPs as well. 276 This separation of identity provision and signaling isn't 277 particularly important in "closed world" cases where Alice and Bob 278 are users on the same social network and have identities based on 279 that domain (Figure 3) However, there are important settings where 280 that is not the case, such as federation (calls from one domain to 281 another; Figure 4) and calling on untrusted sites, such as where two 282 users who have a relationship via a given social network want to call 283 each other on another, untrusted, site, such as a poker site. 285 Note that the servers themselves are also authenticated by an 286 external identity service, the SSL/TLS certificate infrastructure 287 (not shown). As is conventional in the Web, all identities are 288 ultimately rooted in that system. For instance, when an IdP makes an 289 identity assertion, the Relying Party consuming that assertion is 290 able to verify because it is able to connect to the IdP via HTTPS. 292 +----------------+ 293 | | 294 | Signaling | 295 | Server | 296 | | 297 +----------------+ 298 ^ ^ 299 / \ 300 HTTPS / \ HTTPS 301 / \ 302 / \ 303 v v 304 JS API JS API 305 +-----------+ +-----------+ 306 | | Media | | 307 Alice | Browser |<---------->| Browser | Bob 308 | | (DTLS+SRTP)| | 309 +-----------+ +-----------+ 310 ^ ^--+ +--^ ^ 311 | | | | 312 v | | v 313 +-----------+ | | +-----------+ 314 | |<--------+ | | 315 | IdP1 | | | IdP2 | 316 | | +------->| | 317 +-----------+ +-----------+ 319 Figure 3: A call with IdP-based identity 321 Figure 4 shows essentially the same calling scenario but with a call 322 between two separate domains (i.e., a federated case), as in 323 Figure 2. As mentioned above, the domains communicate by some 324 unspecified protocol and providing separate signaling and identity 325 allows for calls to be authenticated regardless of the details of the 326 inter-domain protocol. 328 +----------------+ Unspecified +----------------+ 329 | | protocol | | 330 | Signaling |<----------------->| Signaling | 331 | Server | (SIP, XMPP, ...) | Server | 332 | | | | 333 +----------------+ +----------------+ 334 ^ ^ 335 | | 336 HTTPS | | HTTPS 337 | | 338 | | 339 v v 340 JS API JS API 341 +-----------+ +-----------+ 342 | | Media | | 343 Alice | Browser |<--------------------------->| Browser | Bob 344 | | DTLS+SRTP | | 345 +-----------+ +-----------+ 346 ^ ^--+ +--^ ^ 347 | | | | 348 v | | v 349 +-----------+ | | +-----------+ 350 | |<-------------------------+ | | 351 | IdP1 | | | IdP2 | 352 | | +------------------------>| | 353 +-----------+ +-----------+ 355 Figure 4: A federated call with IdP-based identity 357 4.1. Initial Signaling 359 For simplicity, assume the topology in Figure 3. Alice and Bob are 360 both users of a common calling service; they both have approved the 361 calling service to make calls (we defer the discussion of device 362 access permissions till later). They are both connected to the 363 calling service via HTTPS and so know the origin with some level of 364 confidence. They also have accounts with some identity provider. 365 This sort of identity service is becoming increasingly common in the 366 Web environment in technologies such (BrowserID, Federated Google 367 Login, Facebook Connect, OAuth, OpenID, WebFinger), and is often 368 provided as a side effect service of a user's ordinary accounts with 369 some service. In this example, we show Alice and Bob using a 370 separate identity service, though the identity service may be the 371 same entity as the calling service or there may be no identity 372 service at all. 374 Alice is logged onto the calling service and decides to call Bob. She 375 can see from the calling service that he is online and the calling 376 service presents a JS UI in the form of a button next to Bob's name 377 which says "Call". Alice clicks the button, which initiates a JS 378 callback that instantiates a PeerConnection object. This does not 379 require a security check: JS from any origin is allowed to get this 380 far. 382 Once the PeerConnection is created, the calling service JS needs to 383 set up some media. Because this is an audio/video call, it creates a 384 MediaStream with two MediaStreamTracks, one connected to an audio 385 input and one connected to a video input. At this point the first 386 security check is required: untrusted origins are not allowed to 387 access the camera and microphone, so the browser prompts Alice for 388 permission. 390 In the current W3C API, once some streams have been added, Alice's 391 browser + JS generates a signaling message [I-D.ietf-rtcweb-jsep] 392 containing: 394 o Media channel information 395 o Interactive Connectivity Establishment (ICE) [RFC5245] candidates 396 o A fingerprint attribute binding the communication to a key pair 397 [RFC5763]. Note that this key may simply be ephemerally generated 398 for this call or specific to this domain, and Alice may have a 399 large number of such keys. 401 Prior to sending out the signaling message, the PeerConnection code 402 contacts the identity service and obtains an assertion binding 403 Alice's identity to her fingerprint. The exact details depend on the 404 identity service (though as discussed in Section 5.6 PeerConnection 405 can be agnostic to them), but for now it's easiest to think of as a 406 BrowserID assertion. The assertion may bind other information to the 407 identity besides the fingerprint, but at minimum it needs to bind the 408 fingerprint. 410 This message is sent to the signaling server, e.g., by XMLHttpRequest 411 [XmlHttpRequest] or by WebSockets [RFC6455]. preferably over TLS 412 [RFC5246]. The signaling server processes the message from Alice's 413 browser, determines that this is a call to Bob and sends a signaling 414 message to Bob's browser (again, the format is currently undefined). 415 The JS on Bob's browser processes it, and alerts Bob to the incoming 416 call and to Alice's identity. In this case, Alice has provided an 417 identity assertion and so Bob's browser contacts Alice's identity 418 provider (again, this is done in a generic way so the browser has no 419 specific knowledge of the IdP) to verify the assertion. This allows 420 the browser to display a trusted element in the browser chrome 421 indicating that a call is coming in from Alice. If Alice is in Bob's 422 address book, then this interface might also include her real name, a 423 picture, etc. The calling site will also provide some user interface 424 element (e.g., a button) to allow Bob to answer the call, though this 425 is most likely not part of the trusted UI. 427 If Bob agrees a PeerConnection is instantiated with the message from 428 Alice's side. Then, a similar process occurs as on Alice's browser: 429 Bob's browser prompts him for device permission, the media streams 430 are created, and a return signaling message containing media 431 information, ICE candidates, and a fingerprint is sent back to Alice 432 via the signaling service. If Bob has a relationship with an IdP, 433 the message will also come with an identity assertion. 435 At this point, Alice and Bob each know that the other party wants to 436 have a secure call with them. Based purely on the interface provided 437 by the signaling server, they know that the signaling server claims 438 that the call is from Alice to Bob. This level of security is 439 provided merely by having the fingerprint in the message and having 440 that message received securely from the signaling server. Because 441 the far end sent an identity assertion along with their message, they 442 know that this is verifiable from the IdP as well. Note that if the 443 call is federated, as shown in Figure 4 then Alice is able to verify 444 Bob's identity in a way that is not mediated by either her signaling 445 server or Bob's. Rather, she verifies it directly with Bob's IdP. 447 Of course, the call works perfectly well if either Alice or Bob 448 doesn't have a relationship with an IdP; they just get a lower level 449 of assurance. I.e., they simply have whatever information their 450 calling site claims about the caller/calllee's identity. Moreover, 451 Alice might wish to make an anonymous call through an anonymous 452 calling site, in which case she would of course just not provide any 453 identity assertion and the calling site would mask her identity from 454 Bob. 456 4.2. Media Consent Verification 458 As described in ([I-D.ietf-rtcweb-security]; Section 4.2) media 459 consent verification is provided via ICE. Thus, Alice and Bob 460 perform ICE checks with each other. At the completion of these 461 checks, they are ready to send non-ICE data. 463 At this point, Alice knows that (a) Bob (assuming he is verified via 464 his IdP) or someone else who the signaling service is claiming is Bob 465 is willing to exchange traffic with her and (b) that either Bob is at 466 the IP address which she has verified via ICE or there is an attacker 467 who is on-path to that IP address detouring the traffic. Note that 468 it is not possible for an attacker who is on-path between Alice and 469 Bob but not attached to the signaling service to spoof these checks 470 because they do not have the ICE credentials. Bob has the same 471 security guarantees with respect to Alice. 473 4.3. DTLS Handshake 475 Once the ICE checks have completed [more specifically, once some ICE 476 checks have completed], Alice and Bob can set up a secure channel or 477 channels. This is performed via DTLS [RFC4347] (for the data 478 channel) and DTLS-SRTP [RFC5763] keying for SRTP [RFC3711] for the 479 media channel and SCTP over DTLS [I-D.ietf-tsvwg-sctp-dtls-encaps] 480 for data channels. Specifically, Alice and Bob perform a DTLS 481 handshake on every channel which has been established by ICE. The 482 total number of channels depends on the amount of muxing; in the most 483 likely case we are using both RTP/RTCP mux and muxing multiple media 484 streams on the same channel, in which case there is only one DTLS 485 handshake. Once the DTLS handshake has completed, the keys are 486 exported [RFC5705] and used to key SRTP for the media channels. 488 At this point, Alice and Bob know that they share a set of secure 489 data and/or media channels with keys which are not known to any 490 third-party attacker. If Alice and Bob authenticated via their IdPs, 491 then they also know that the signaling service is not mounting a man- 492 in-the-middle attack on their traffic. Even if they do not use an 493 IdP, as long as they have minimal trust in the signaling service not 494 to perform a man-in-the-middle attack, they know that their 495 communications are secure against the signaling service as well 496 (i.e., that the signaling service cannot mount a passive attack on 497 the communications). 499 4.4. Communications and Consent Freshness 501 From a security perspective, everything from here on in is a little 502 anticlimactic: Alice and Bob exchange data protected by the keys 503 negotiated by DTLS. Because of the security guarantees discussed in 504 the previous sections, they know that the communications are 505 encrypted and authenticated. 507 The one remaining security property we need to establish is "consent 508 freshness", i.e., allowing Alice to verify that Bob is still prepared 509 to receive her communications so that Alice does not continue to send 510 large traffic volumes to entities which went abruptly offline. ICE 511 specifies periodic STUN keepalizes but only if media is not flowing. 512 Because the consent issue is more difficult here, we require RTCWeb 513 implementations to periodically send keepalives. As described in 514 Section 5.3, these keepalives MUST be based on the consent freshness 515 mechanism specified in [I-D.muthu-behave-consent-freshness]. If a 516 keepalive fails and no new ICE channels can be established, then the 517 session is terminated. 519 5. Detailed Technical Description 521 5.1. Origin and Web Security Issues 523 The basic unit of permissions for WebRTC is the origin [RFC6454]. 524 Because the security of the origin depends on being able to 525 authenticate content from that origin, the origin can only be 526 securely established if data is transferred over HTTPS [RFC2818]. 527 Thus, clients MUST treat HTTP and HTTPS origins as different 528 permissions domains. [Note: this follows directly from the origin 529 security model and is stated here merely for clarity.] 531 Many web browsers currently forbid by default any active mixed 532 content on HTTPS pages. That is, when JavaScript is loaded from an 533 HTTP origin onto an HTTPS page, an error is displayed and the HTTP 534 content is not executed unless the user overrides the error. Any 535 browser which enforces such a policy will also not permit access to 536 WebRTC functionality from mixed content pages (because they never 537 display mixed content). Browsers which allow active mixed content 538 MUST nevertheless disable WebRTC functionality in mixed content 539 settings. 541 Note that it is possible for a page which was not mixed content to 542 become mixed content during the duration of the call. The major risk 543 here is that the newly arrived insecure JS might redirect media to a 544 location controlled by the attacker. Implementations MUST either 545 choose to terminate the call or display a warning at that point. 547 5.2. Device Permissions Model 549 Implementations MUST obtain explicit user consent prior to providing 550 access to the camera and/or microphone. Implementations MUST at 551 minimum support the following two permissions models for HTTPS 552 origins. 554 o Requests for one-time camera/microphone access. 555 o Requests for permanent access. 557 Because HTTP origins cannot be securely established against network 558 attackers, implementations MUST NOT allow the setting of permanent 559 access permissions for HTTP origins. Implementations MAY also opt to 560 refuse all permissions grants for HTTP origins, but it is RECOMMENDED 561 that currently they support one-time camera/microphone access. 563 In addition, they SHOULD support requests for access that promise 564 that media from this grant will be sent to a single communicating 565 peer (obviously there could be other requests for other peers). 566 E.g., "Call customerservice@ford.com". The semantics of this request 567 are that the media stream from the camera and microphone will only be 568 routed through a connection which has been cryptographically verified 569 (through the IdP mechanism or an X.509 certificate in the DTLS-SRTP 570 handshake) as being associated with the stated identity. Note that 571 it is unlikely that browsers would have an X.509 certificate, but 572 servers might. Browsers servicing such requests SHOULD clearly 573 indicate that identity to the user when asking for permission. The 574 idea behind this type of permissions is that a user might have a 575 fairly narrow list of peers he is willing to communicate with, e.g., 576 "my mother" rather than "anyone on Facebook". Narrow permissions 577 grants allow the browser to do that enforcement. 579 API Requirement: The API MUST provide a mechanism for the requesting 580 JS to indicate which of these forms of permissions it is 581 requesting. This allows the browser client to know what sort of 582 user interface experience to provide to the user, including what 583 permissions to request from the user and hence what to enforce 584 later. For instance, browsers might display a non-invasive door 585 hanger ("some features of this site may not work..." when asking 586 for long-term permissions) but a more invasive UI ("here is your 587 own video") for single-call permissions. The API MAY grant weaker 588 permissions than the JS asked for if the user chooses to authorize 589 only those permissions, but if it intends to grant stronger ones 590 it SHOULD display the appropriate UI for those permissions and 591 MUST clearly indicate what permissions are being requested. 593 API Requirement: The API MUST provide a mechanism for the requesting 594 JS to relinquish the ability to see or modify the media (e.g., via 595 MediaStream.record()). Combined with secure authentication of the 596 communicating peer, this allows a user to be sure that the calling 597 site is not accessing or modifying their conversion. 599 UI Requirement: The UI MUST clearly indicate when the user's camera 600 and microphone are in use. This indication MUST NOT be 601 suppressable by the JS and MUST clearly indicate how to terminate 602 device access, and provide a UI means to immediately stop camera/ 603 microphone input without the JS being able to prevent it. 605 UI Requirement: If the UI indication of camera/microphone use are 606 displayed in the browser such that minimizing the browser window 607 would hide the indication, or the JS creating an overlapping 608 window would hide the indication, then the browser SHOULD stop 609 camera and microphone input when the indication is hidden. [Note: 610 this may not be necessary in systems that are non-windows-based 611 but that have good notifications support, such as phones.] 613 [[OPEN ISSUE: This section does not have WG consensus. Because 614 screen/application sharing presents a more significant risk than 615 camera and microphone access (see the discussion in 616 [I-D.ietf-rtcweb-security] S 4.1.1), we require a higher level of 617 user consent. 619 o Browsers MUST not permit permanent screen or application sharing 620 permissions to be installed as a response to a JS request for 621 permissions. Instead, they must require some other user action 622 such as a permissions setting or an application install experience 623 to grant permission to a site. 624 o Browsers MUST provide a separate dialog request for screen/ 625 application sharing permissions even if the media request is made 626 at the same time as camera and microphone. 627 o The browser MUST indicate any windows which are currently being 628 shared in some unambiguous way. Windows which are not visible 629 MUST not be shared even if the application is being shared. If 630 the screen is being shared, then that MUST be indicated. 632 -- END OF OPEN ISSUE]] 634 Clients MAY permit the formation of data channels without any direct 635 user approval. Because sites can always tunnel data through the 636 server, further restrictions on the data channel do not provide any 637 additional security. (though see Section 5.3 for a related issue). 639 Implementations which support some form of direct user authentication 640 SHOULD also provide a policy by which a user can authorize calls only 641 to specific communicating peers. Specifically, the implementation 642 SHOULD provide the following interfaces/controls: 644 o Allow future calls to this verified user. 645 o Allow future calls to any verified user who is in my system 646 address book (this only works with address book integration, of 647 course). 649 Implementations SHOULD also provide a different user interface 650 indication when calls are in progress to users whose identities are 651 directly verifiable. Section 5.5 provides more on this. 653 5.3. Communications Consent 655 Browser client implementations of WebRTC MUST implement ICE. Server 656 gateway implementations which operate only at public IP addresses 657 MUST implement either full ICE or ICE-Lite [RFC5245]. 659 Browser implementations MUST verify reachability via ICE prior to 660 sending any non-ICE packets to a given destination. Implementations 661 MUST NOT provide the ICE transaction ID to JavaScript during the 662 lifetime of the transaction (i.e., during the period when the ICE 663 stack would accept a new response for that transaction). The JS MUST 664 NOT be permitted to control the local ufrag and password, though it 665 of course knows it. 667 While continuing consent is required, that ICE [RFC5245]; Section 10 668 keepalives STUN Binding Indications are one-way and therefore not 669 sufficient. The current WG consensus is to use ICE Binding Requests 670 for continuing consent freshness. ICE already requires that 671 implementations respond to such requests, so this approach is 672 maximally compatible. A separate document will profile the ICE 673 timers to be used; see [I-D.muthu-behave-consent-freshness]. 675 5.4. IP Location Privacy 677 A side effect of the default ICE behavior is that the peer learns 678 one's IP address, which leaks large amounts of location information. 679 This has negative privacy consequences in some circumstances. The 680 API requirements in this section are intended to mitigate this issue. 681 Note that these requirements are NOT intended to protect the user's 682 IP address from a malicious site. In general, the site will learn at 683 least a user's server reflexive address from any HTTP transaction. 684 Rather, these requirements are intended to allow a site to cooperate 685 with the user to hide the user's IP address from the other side of 686 the call. Hiding the user's IP address from the server requires some 687 sort of explicit privacy preserving mechanism on the client (e.g., 688 Torbutton [https://www.torproject.org/torbutton/]) and is out of 689 scope for this specification. 691 API Requirement: The API MUST provide a mechanism to allow the JS to 692 suppress ICE negotiation (though perhaps to allow candidate 693 gathering) until the user has decided to answer the call [note: 694 determining when the call has been answered is a question for the 695 JS.] This enables a user to prevent a peer from learning their IP 696 address if they elect not to answer a call and also from learning 697 whether the user is online. 699 API Requirement: The API MUST provide a mechanism for the calling 700 application JS to indicate that only TURN candidates are to be 701 used. This prevents the peer from learning one's IP address at 702 all. This mechanism MUST also permit suppression of the related 703 address field, since that leaks local addresses. 705 API Requirement: The API MUST provide a mechanism for the calling 706 application to reconfigure an existing call to add non-TURN 707 candidates. Taken together, this and the previous requirement 708 allow ICE negotiation to start immediately on incoming call 709 notification, thus reducing post-dial delay, but also to avoid 710 disclosing the user's IP address until they have decided to 711 answer. They also allow users to completely hide their IP address 712 for the duration of the call. Finally, they allow a mechanism for 713 the user to optimize performance by reconfiguring to allow non- 714 turn candidates during an active call if the user decides they no 715 longer need to hide their IP address 717 Note that some enterprises may operate proxies and/or NATs designed 718 to hide internal IP addresses from the outside world. WebRTC 719 provides no explicit mechanism to allow this function. Either such 720 enterprises need to proxy the HTTP/HTTPS and modify the SDP and/or 721 the JS, or there needs to be browser support to set the "TURN-only" 722 policy regardless of the site's preferences. 724 5.5. Communications Security 726 Implementations MUST implement SRTP [RFC3711]. Implementations MUST 727 implement DTLS [RFC4347] and DTLS-SRTP [RFC5763][RFC5764] for SRTP 728 keying. Implementations MUST implement 729 [I-D.ietf-tsvwg-sctp-dtls-encaps]. 731 All media channels MUST be secured via SRTP. Media traffic MUST NOT 732 be sent over plain (unencrypted) RTP; that is, implementations MUST 733 NOT negotiate cipher suites with NULL encryption modes. DTLS-SRTP 734 MUST be offered for every media channel. WebRTC implementations MUST 735 NOT offer SDES or select it if offered. 737 All data channels MUST be secured via DTLS. 739 All implementations MUST implement both DTLS 1.2 and DTLS 1.0, with 740 the cipher suites TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 and 741 TLS_DHE_RSA_WITH_AES_128_CBC_SHA and the DTLS-SRTP protection profile 742 SRTP_AES128_CM_HMAC_SHA1_80. Implementations SHOULD favor cipher 743 suites which support PFS over non-PFS cipher suites and GCM over CBC 744 cipher suites. [[OPEN ISSUE: Should we require ECDHE? Waiting for 745 TLS WG Consensus.]] 747 API Requirement: The API MUST provide a mechanism to indicate that a 748 fresh DTLS key pair is to be generated for a specific call. This 749 is intended to allow for unlinkability. Note that there are also 750 settings where it is attractive to use the same keying material 751 repeatedly, especially those with key continuity-based 752 authentication. Unless the user specifically configures an 753 external key pair, different key pairs MUST be used for each 754 origin. (This avoids creating a super-cookie.) 756 API Requirement: When DTLS-SRTP is used, the API MUST NOT permit the 757 JS to obtain the negotiated keying material. This requirement 758 preserves the end-to-end security of the media. 760 UI Requirements: A user-oriented client MUST provide an 761 "inspector" interface which allows the user to determine the 762 security characteristics of the media. 763 The following properties SHOULD be displayed "up-front" in the 764 browser chrome, i.e., without requiring the user to ask for them: 766 * A client MUST provide a user interface through which a user may 767 determine the security characteristics for currently-displayed 768 audio and video stream(s) 769 * A client MUST provide a user interface through which a user may 770 determine the security characteristics for transmissions of 771 their microphone audio and camera video. 772 * The "security characteristics" MUST include an indication as to 773 whether the cryptographic keys were delivered out-of-band (from 774 a server) or were generated as a result of a pairwise 775 negotiation. 776 * If the far endpoint was directly verified, either via a third- 777 party verifiable X.509 certificate or via a Web IdP mechanism 778 (see Section 5.6) the "security characteristics" MUST include 779 the verified information. X.509 identities and Web IdP 780 identities have similar semantics and should be displayed in a 781 similar way. 783 The following properties are more likely to require some "drill- 784 down" from the user: 786 * The "security characteristics" MUST indicate the cryptographic 787 algorithms in use (For example: "AES-CBC" or "Null Cipher".) 788 However, if Null ciphers are used, that MUST be presented to 789 the user at the top-level UI. 790 * The "security characteristics" MUST indicate whether PFS is 791 provided. 792 * The "security characteristics" MUST include some mechanism to 793 allow an out-of-band verification of the peer, such as a 794 certificate fingerprint or an SAS. 796 5.6. Web-Based Peer Authentication 798 In a number of cases, it is desirable for the endpoint (i.e., the 799 browser) to be able to directly identity the endpoint on the other 800 side without trusting only the signaling service to which they are 801 connected. For instance, users may be making a call via a federated 802 system where they wish to get direct authentication of the other 803 side. Alternately, they may be making a call on a site which they 804 minimally trust (such as a poker site) but to someone who has an 805 identity on a site they do trust (such as a social network.) 807 Recently, a number of Web-based identity technologies (OAuth, 808 BrowserID, Facebook Connect), etc. have been developed. While the 809 details vary, what these technologies share is that they have a Web- 810 based (i.e., HTTP/HTTPS) identity provider which attests to your 811 identity. For instance, if I have an account at example.org, I could 812 use the example.org identity provider to prove to others that I was 813 alice@example.org. The development of these technologies allows us 814 to separate calling from identity provision: I could call you on 815 Poker Galaxy but identify myself as alice@example.org. 817 Whatever the underlying technology, the general principle is that the 818 party which is being authenticated is NOT the signaling site but 819 rather the user (and their browser). Similarly, the relying party is 820 the browser and not the signaling site. Thus, the browser MUST 821 securely generate the input to the IdP assertion process and MUST 822 securely display the results of the verification process to the user 823 in a way which cannot be imitated by the calling site. 825 The mechanisms defined in this document do not require the browser to 826 implement any particular identity protocol or to support any 827 particular IdP. Instead, this document provides a generic interface 828 which any IdP can implement. Thus, new IdPs and protocols can be 829 introduced without change to either the browser or the calling 830 service. This avoids the need to make a commitment to any particular 831 identity protocol, although browsers may opt to directly implement 832 some identity protocols in order to provide superior performance or 833 UI properties. 835 5.6.1. Trust Relationships: IdPs, APs, and RPs 837 Any federated identity protocol has three major participants: 839 Authenticating Party (AP): The entity which is trying to establish 840 its identity. 842 Identity Provider (IdP): The entity which is vouching for the AP's 843 identity. 845 Relying Party (RP): The entity which is trying to verify the AP's 846 identity. 848 The AP and the IdP have an account relationship of some kind: the AP 849 registers with the IdP and is able to subsequently authenticate 850 directly to the IdP (e.g., with a password). This means that the 851 browser must somehow know which IdP(s) the user has an account 852 relationship with. This can either be something that the user 853 configures into the browser or that is configured at the calling site 854 and then provided to the PeerConnection by the Web application at the 855 calling site. The use case for having this information configured 856 into the browser is that the user may "log into" the browser to bind 857 it to some identity. This is becoming common in new browsers. 858 However, it should also be possible for the IdP information to simply 859 be provided by the calling application. 861 At a high level there are two kinds of IdPs: 863 Authoritative: IdPs which have verifiable control of some section 864 of the identity space. For instance, in the realm of e-mail, the 865 operator of "example.com" has complete control of the namespace 866 ending in "@example.com". Thus, "alice@example.com" is whoever 867 the operator says it is. Examples of systems with authoritative 868 identity providers include DNSSEC, RFC 4474, and Facebook Connect 869 (Facebook identities only make sense within the context of the 870 Facebook system). 872 Third-Party: IdPs which don't have control of their section of the 873 identity space but instead verify user's identities via some 874 unspecified mechanism and then attest to it. Because the IdP 875 doesn't actually control the namespace, RPs need to trust that the 876 IdP is correctly verifying AP identities, and there can 877 potentially be multiple IdPs attesting to the same section of the 878 identity space. Probably the best-known example of a third-party 879 identity provider is SSL certificates, where there are a large 880 number of CAs all of whom can attest to any domain name. 882 If an AP is authenticating via an authoritative IdP, then the RP does 883 not need to explicitly configure trust in the IdP at all. The 884 identity mechanism can directly verify that the IdP indeed made the 885 relevant identity assertion (a function provided by the mechanisms in 886 this document), and any assertion it makes about an identity for 887 which it is authoritative is directly verifiable. Note that this 888 does not mean that the IdP might not lie, but that is a 889 trustworthiness judgement that the user can make at the time he looks 890 at the identity. 892 By contrast, if an AP is authenticating via a third-party IdP, the RP 893 needs to explicitly trust that IdP (hence the need for an explicit 894 trust anchor list in PKI-based SSL/TLS clients). The list of 895 trustable IdPs needs to be configured directly into the browser, 896 either by the user or potentially by the browser manufacturer. This 897 is a significant advantage of authoritative IdPs and implies that if 898 third-party IdPs are to be supported, the potential number needs to 899 be fairly small. 901 5.6.2. Overview of Operation 903 In order to provide security without trusting the calling site, the 904 PeerConnection component of the browser must interact directly with 905 the IdP. The details of the mechanism are described in the W3C API 906 specification, but the general idea is that the PeerConnection 907 component downloads JS from a specific location on the IdP dictated 908 by the IdP domain name. That JS (the "IdP proxy") runs in an 909 isolated security context within the browser and the PeerConnection 910 talks to it via a secure message passing channel. 912 Note that there are two logically separate functions here: 913 o Identity assertion generation. 914 o Identity assertion verification. 916 The same IdP JS "endpoint" is used for both functions but of course a 917 given IdP might behave differently and load new JS to perform one 918 function or the other. 920 +--------------------------------------+ 921 | Browser | 922 | | 923 | +----------------------------------+ | 924 | | https://calling-site.example.com | | 925 | | | | 926 | | Calling JS Code | | 927 | | ^ | | 928 | +---------------|------------------+ | 929 | | API Calls | 930 | v | 931 | PeerConnection | 932 | ^ | 933 | | MessageChannel | 934 | +-----------|-------------+ | +---------------+ 935 | | v | | | | 936 | | IdP Proxy |<-------->| Identity | 937 | | | | | Provider | 938 | | https://idp.example.org | | | | 939 | +-------------------------+ | +---------------+ 940 | | 941 +--------------------------------------+ 943 When the PeerConnection object wants to interact with the IdP, the 944 sequence of events is as follows: 945 1. The browser (the PeerConnection component) instantiates an IdP 946 proxy with its source at the IdP. This allows the IdP to load 947 whatever JS is necessary into the proxy, which runs in the IdP's 948 security context. The browser uses a MessageChannel 950 [WebMessaging] to interact with the IdP proxy. 951 2. Once the IdP is ready, the IdP proxy uses the MessageChannel to 952 notify the browser that it is ready. 953 3. The browser and IdP proxy communicate using the MessageChannel 954 using a standardized message exchange to create or verify 955 identity assertions. 957 This approach allows us to decouple the browser from any particular 958 identity provider; the browser need only know how to load the IdP's 959 JavaScript--which is deterministic from the IdP's identity--and the 960 generic protocol for requesting and verifying assertions. The IdP 961 provides whatever logic is necessary to bridge the generic protocol 962 to the IdP's specific requirements. Thus, a single browser can 963 support any number of identity protocols, including being forward 964 compatible with IdPs which did not exist at the time the browser was 965 written. 967 5.6.3. Items for Standardization 969 In order to make this work, we must standardize the following items: 971 o The precise information from the signaling message that must be 972 cryptographically bound to the user's identity and a mechanism for 973 carrying assertions in JSEP messages. Section 5.6.4 974 o The interface to the IdP. Section 5.6.5 specifies a specific 975 protocol mechanism which allows the use of any identity protocol 976 without requiring specific further protocol support in the browser 977 o The JavaScript interfaces which the calling application can use to 978 specify the IdP to use to generate assertions and to discover what 979 assertions were received. 981 The first two items are defined in this document. The final one is 982 defined in the companion W3C WebRTC API specification [webrtc-api]. 984 5.6.4. Binding Identity Assertions to JSEP Offer/Answer Transactions 986 5.6.4.1. Input to Assertion Generation Process 988 An identity assertion binds the user's identity (as asserted by the 989 IdP) to the SDP offer/exchange transaction and specifically to the 990 media. In order to achieve this, the PeerConnection must provide the 991 DTLS-SRTP fingerprint to be bound to the identity. This is provided 992 as a JavaScript object (also known as a dictionary or hash) with a 993 single "fingerprint" key, as shown below: 995 { 996 "fingerprint": [ { 997 "algorithm": "sha-256", 998 "digest": "4A:AD:B9:B1:3F:...:E5:7C:AB" 999 }, { 1000 "algorithm": "sha-1", 1001 "digest": "74:E9:76:C8:19:...:F4:45:6B" 1002 } ] 1003 } 1005 The "fingerprint" value is an array of objects. Each object in the 1006 array contains "algorithm" and "digest" values, which correspond 1007 directly to the algorithm and digest values in the "a=fingerprint" 1008 line of the SDP [RFC4572]. 1010 Note: this structure does not need to be interpreted by the IdP or 1011 the IdP proxy. It is consumed solely by the RP's browser. The IdP 1012 merely treats it as an opaque value to be attested to. Thus, new 1013 parameters can be added to the assertion without modifying the IdP. 1015 This object is encoded in a JSON [RFC4627] string for passing to the 1016 IdP. 1018 5.6.4.2. Carrying Identity Assertions 1020 Once an IdP has generated an assertion, it is attached to the SDP 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 [RFC4648] 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=fingerprint:sha-1 \ 1030 4A:AD:B9:B1:3F:82:18:3B:54:02:12:DF:3E:5D:49:6B:19:E5:7C:AB 1031 a=identity:\ 1032 eyJpZHAiOnsiZG9tYWluIjoiZXhhbXBsZS5vcmciLCJwcm90b2NvbCI6ImJvZ3Vz\ 1033 In0sImFzc2VydGlvbiI6IntcImlkZW50aXR5XCI6XCJib2JAZXhhbXBsZS5vcmdc\ 1034 IixcImNvbnRlbnRzXCI6XCJhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3l6XCIsXCJz\ 1035 aWduYXR1cmVcIjpcIjAxMDIwMzA0MDUwNlwifSJ9 1036 a=... 1037 t=0 0 1038 m=audio 6056 RTP/SAVP 0 1039 a=sendrecv 1040 ... 1042 Each identity attribute should be paired (and attests to) with an 1043 "a=fingerprint" attribute and therefore can exist either at the 1044 session or media level. Multiple identity attributes may appear at 1045 either level, though it is RECOMMENDED that implementations not do 1046 this, because it becomes very unclear what security claim that they 1047 are making and the UI guidelines above become unclear. Browsers MAY 1048 choose refuse to display any identity indicators in the face of 1049 multiple identity attributes with different identities but SHOULD 1050 process multiple attributes with the same identity as described 1051 above. 1053 Multiple "a=fingerprint" values can be used to offer alternative 1054 certificates for a peer. The "a=identity" attribute MUST include all 1055 fingerprint values that are included in "a=fingerprint" lines. This 1056 ensures that the in-use certificate for a DTLS connection is in the 1057 set of fingerprints returned from the IdP when verifying an 1058 assertion. This MUST be enforced by an RP by ensuring that all 1059 "a=fingerprint" attributes for a given media section are present in 1060 the "VERIFY" response (see Section 5.6.5.4). 1062 5.6.4.3. a=identity Attribute 1064 The identity attribute is session level only. It contains an 1065 identity assertion, encoded as a base-64 string [RFC4648]. 1067 The syntax of this SDP attribute is defined using Augmented BNF 1068 [RFC5234]: 1070 identity-attribute = "identity:" identity-assertion 1071 [ SP identity-extension 1072 *(";" [ SP ] identity-extension) ] 1073 identity-assertion = base64 1074 base64 = 1*(ALPHA / DIGIT / "+" / "/" / "=" ) 1075 identity-extension = extension-att-name [ "=" extension-att-value ] 1076 extension-att-name = token 1077 extension-att-value = 1*(%x01-09 / %x0b-0c / %x0e-3a / %x3c-ff) 1078 ; byte-string from [RFC4566] omitting ";" 1080 No extensions are defined for this attribute. 1082 5.6.5. IdP Interaction Details 1084 5.6.5.1. General Message Structure 1086 Messages between the PeerConnection object and the IdP proxy are 1087 JavaScript objects, shown in examples using JSON [RFC4627]. For 1088 instance, the PeerConnection would request a signature with the 1089 following "SIGN" message: 1091 { 1092 "type": "SIGN", 1093 "id": "1", 1094 "origin": "https://calling-site.example.com", 1095 "message": "012345678abcdefghijkl" 1096 } 1098 All messages MUST contain a "type" field which indicates the general 1099 meaning of the message. 1101 All requests from the PeerConnection object MUST contain an "id" 1102 field which MUST be unique within the scope of the interaction 1103 between the browser and the IdP instance. Responses from the IdP 1104 proxy MUST contain the same "id" in response, which allows the 1105 PeerConnection to correlate requests and responses, in case there are 1106 multiple requests/responses outstanding to the same proxy. 1108 All requests from the PeerConnection object MUST contain an "origin" 1109 field containing the origin of the JS which initiated the PC (i.e., 1110 the URL of the calling site). This origin value can be used by the 1111 IdP to make access control decisions. For instance, an IdP might 1112 only issue identity assertions for certain calling services in the 1113 same way that some IdPs require that relying Web sites have an API 1114 key before learning user identity. 1116 Any message-specific data is carried in a "message" field. Depending 1117 on the message type, this may either be a string or any JavaScript 1118 object that can be conveyed in a message channel. This includes any 1119 object that is able to be serialized to JSON. 1121 5.6.5.2. Errors 1123 If an error occurs, the IdP sends a message of type "ERROR". The 1124 message MAY have an "error" field containing freeform text data which 1125 containing additional information about what happened. For instance: 1127 { 1128 "type": "ERROR", 1129 "id": "1", 1130 "error": "Signature verification failed" 1131 } 1133 Figure 5: Example error 1135 5.6.5.3. IdP Proxy Setup 1137 In order to perform an identity transaction, the PeerConnection must 1138 first create an IdP proxy. While the details of this are specified 1139 in the W3C API document, from the perspective of this specification, 1140 however, the relevant facts are: 1142 o The JS runs in the IdP's security context with the base page 1143 retrieved from the URL specified in Section 5.6.5.3.1. 1144 o The usual browser sandbox isolation mechanisms MUST be enforced 1145 with respect to the IdP proxy. The IdP cannot be provided with 1146 escalated privileges. 1147 o JS running in the IdP proxy MUST be able to send and receive 1148 messages to the PeerConnection and the PC and IdP proxy are able 1149 to verify the source and destination of these messages. 1150 o The IdP proxy is unable to interact with the user. This includes 1151 the creation of popup windows and dialogs. 1153 Initially the IdP proxy is in an unready state; the IdP JS must be 1154 loaded and there may be several round trips to the IdP server to load 1155 and prepare necessary resources. 1157 When the IdP proxy is ready to receive commands, it delivers a 1158 "READY" message. As this message is unsolicited, it contains only 1159 the "type": 1161 { "type":"READY" } 1163 Once the PeerConnection object receives the ready message, it can 1164 send commands to the IdP proxy. 1166 5.6.5.3.1. Determining the IdP URI 1168 In order to ensure that the IdP is under control of the domain owner 1169 rather than someone who merely has an account on the domain owner's 1170 server (e.g., in shared hosting scenarios), the IdP JavaScript is 1171 hosted at a deterministic location based on the IdP's domain name. 1172 Each IdP proxy instance is associated with two values: 1174 domain name: The IdP's domain name 1175 protocol: The specific IdP protocol which the IdP is using. This is 1176 a completely opaque IdP-specific string, but allows an IdP to 1177 implement two protocols in parallel. This value may be the empty 1178 string. 1180 Each IdP MUST serve its initial entry page (i.e., the one loaded by 1181 the IdP proxy) from a well-known URI [RFC5785]. The well-known URI 1182 for an IdP proxy is formed from the following URI components: 1184 1. The scheme, "https:". An IdP MUST be loaded using HTTPS 1185 [RFC2818]. 1186 2. The authority, which is the IdP domain name. The authority MAY 1187 contain a non-default port number. Any port number is removed 1188 when determining if an asserted identity matches the name of the 1189 IdP. The authority MUST NOT include a userinfo sub-component. 1190 3. The path, starting with "/.well-known/idp-proxy/" and appended 1191 with the IdP protocol. Note that the separator characters '/' 1192 (%2F) and '\' (%5C) MUST NOT be permitted in the protocol field, 1193 lest an attacker be able to direct requests outside of the 1194 controlled "/.well-known/" prefix. Query and fragment values MAY 1195 be used by including '?' or '#' characters. 1196 For example, for the IdP "identity.example.com" and the protocol 1197 "example", the URL would be: 1199 https://example.com/.well-known/idp-proxy/example 1201 5.6.5.3.1.1. Authenticating Party 1203 How an AP determines the appropriate IdP domain is out of scope of 1204 this specification. In general, however, the AP has some actual 1205 account relationship with the IdP, as this identity is what the IdP 1206 is attesting to. Thus, the AP somehow supplies the IdP information 1207 to the browser. Some potential mechanisms include: 1208 o Provided by the user directly. 1209 o Selected from some set of IdPs known to the calling site. E.g., a 1210 button that shows "Authenticate via Facebook Connect" 1212 5.6.5.3.1.2. Relying Party 1214 Unlike the AP, the RP need not have any particular relationship with 1215 the IdP. Rather, it needs to be able to process whatever assertion 1216 is provided by the AP. As the assertion contains the IdP's identity, 1217 the URI can be constructed directly from the assertion, and thus the 1218 RP can directly verify the technical validity of the assertion with 1219 no user interaction. Authoritative assertions need only be 1220 verifiable. Third-party assertions also MUST be verified against 1221 local policy, as described in Section 5.6.5.4.1. 1223 5.6.5.3.2. Requesting Assertions 1225 In order to request an assertion, the PeerConnection sends a "SIGN" 1226 message. Aside from the mandatory fields, this message has a 1227 "message" field containing a string. The string contains a JSON- 1228 encoded object containing certificate fingerprints but are treated as 1229 opaque from the perspective of the IdP. 1231 An application can optionally provide a user identifier when 1232 specifying an IdP. This value is a hint that the IdP can use to 1233 select amongst multiple identities, or to avoid providing assertions 1234 for unwanted identities. The user identifier hint is passed to the 1235 IdP in a "username" field alongside the "message". The "username" is 1236 a string that has no meaning to any entity other than the IdP, it can 1237 contain any data the IdP needs in order to correctly generate an 1238 assertion. 1240 A successful response to a "SIGN" message contains a "message" field 1241 which is a JavaScript dictionary consisting of two fields: 1243 idp: A dictionary containing the domain name of the provider and the 1244 protocol string. 1245 assertion: An opaque value containing the assertion itself. This is 1246 only interpretable by the IdP or its proxy. 1248 Figure 6 shows an example transaction, with the message "abcde..." 1249 (remember, the messages are opaque at this layer) being signed and 1250 bound to identity "ekr@example.org". In this case, the message has 1251 presumably been digitally signed/MACed in some way that the IdP can 1252 later verify it, but this is an implementation detail and out of 1253 scope of this document. Line breaks are inserted solely for 1254 readability. 1256 PeerConnection -> IdP proxy: 1257 { 1258 "type": "SIGN", 1259 "id": "1", 1260 "origin": "https://calling-service.example.com/", 1261 "message": "abcdefghijklmnopqrstuvwyz", 1262 "username": "bob" 1263 } 1265 IdPProxy -> PeerConnection: 1266 { 1267 "type": "SUCCESS", 1268 "id": "1", 1269 "message": { 1270 "idp":{ 1271 "domain": "example.org", 1272 "protocol": "bogus" 1273 }, 1274 "assertion": "{\"identity\":\"bob@example.org\", 1275 \"contents\":\"abcdefghijklmnopqrstuvwyz\", 1276 \"signature\":\"010203040506\"}" 1277 } 1278 } 1279 Figure 6: Example assertion request 1281 The "message" structure is serialized into JSON, base64-encoded 1282 [RFC4648], and placed in an "a=identity" attribute. 1284 5.6.5.3.3. Managing User Login 1286 In order to generate an identity assertion, the IdP needs proof of 1287 the user's identity. It is common practice to authenticate users 1288 (using passwords or multi-factor authentication), then use Cookies 1289 [RFC6265] or HTTP authentication [RFC2617] for subsequent exchanges. 1291 The IdP proxy is able to access cookies, HTTP authentication or other 1292 persistent session data because it operates in the security context 1293 of the IdP origin. Therefore, if a user is logged in, the IdP could 1294 have all the information needed to generate an assertion. 1296 An IdP proxy is unable to generate an assertion if the user is not 1297 logged in, or the IdP wants to interact with the user to acquire more 1298 information before generating the assertion. If the IdP wants to 1299 interact with the user before generating an assertion, the IdP proxy 1300 can respond with a "LOGINNEEDED" message. 1302 IdPProxy -> PeerConnection: 1303 { 1304 "type": "LOGINNEEDED", 1305 "id": "1", 1306 "error": "...a message explaining the reason for failure...", 1307 "loginUrl": "https://example.org/login?context=e982606f4fd5" 1308 } 1310 Figure 7: User interaction needed response 1312 The "loginUrl" field of the "LOGINNEEDED" response contains a URL. 1313 The PeerConnection provides an error event (or similar) to the 1314 calling site that includes this URL. 1316 A calling site is then able to load the provided URL in an IFRAME in 1317 order to trigger the required user interactions. Once any user 1318 interactions are complete, the IFRAME MUST send a postMessage 1319 [WebMessaging] to its containing window indicating completion. Any 1320 message is sufficient for this purpose, the "source" parameter 1321 identifies the originating IFRAME. 1323 In all other respects, "LOGINNEEDED" can be treated as an "ERROR" 1324 message. 1326 5.6.5.4. Verifying Assertions 1328 In order to verify an assertion, an RP sends a "VERIFY" message to 1329 the IdP proxy containing the assertion supplied by the AP in the 1330 "message" field. 1332 The IdP proxy verifies the assertion. Depending on the identity 1333 protocol, the proxy might contact the IdP server or other servers. 1334 For instance, an OAuth-based protocol will likely require using the 1335 IdP as an oracle, whereas with BrowserID the IdP proxy can likely 1336 verify the signature on the assertion without contacting the IdP, 1337 provided that it has cached the IdP's public key. 1339 Regardless of the mechanism, if verification succeeds, a successful 1340 response from the IdP proxy MUST contain a message field consisting 1341 of a object with the following fields: 1342 identity: The identity of the AP from the IdP's perspective. 1343 Details of this are provided in Section 5.6.5.4.1. 1344 contents: The original unmodified string provided by the AP in the 1345 original SIGN request. 1347 Figure 8 shows an example transaction. Line breaks are inserted 1348 solely for readability. 1350 PeerConnection -> IdP Proxy: 1351 { 1352 "type": "VERIFY", 1353 "id": 2, 1354 "origin": "https://calling-service.example.com/", 1355 "message": "{\"identity\":\"bob@example.org\", 1356 \"contents\":\"abcdefghijklmnopqrstuvwyz\", 1357 \"signature\":\"010203040506\"}" 1358 } 1360 IdP Proxy -> PeerConnection: 1361 { 1362 "type": "SUCCESS", 1363 "id": 2, 1364 "message": { 1365 "identity": "bob@example.org", 1366 "contents": "abcdefghijklmnopqrstuvwyz" 1367 } 1368 } 1370 Figure 8: Example verification request 1372 5.6.5.4.1. Identity Formats 1374 Identities passed from the IdP proxy to the PeerConnection are passed 1375 in the "identity" field. This field MUST consist of a string 1376 representing the user's identity. This string is in the form 1377 "@", where "user" consists of any character except '@', 1378 and domain is an internationalized domain name [RFC5890]. 1380 The PeerConnection API MUST check this string as follows: 1381 1. If the domain portion of the string is equal to the domain name 1382 of the IdP proxy, then the assertion is valid, as the IdP is 1383 authoritative for this domain. Comparison of domain names is 1384 done using the label equivalence rule defined in Section 2.3.2.4 1385 of [RFC5890]. 1386 2. If the domain portion of the string is not equal to the domain 1387 name of the IdP proxy, then the PeerConnection object MUST reject 1388 the assertion unless: 1389 1. the IdP domain is trusted as an acceptable third-party IdP; 1390 and 1391 2. local policy is configured to trust this IdP domain for the 1392 RHS of the identity string. 1394 Sites which have identities that do not fit into the RFC822 style 1395 (for instance, identifiers that are simple numeric values, or values 1396 that contain '@' characters) SHOULD convert them to this form by 1397 escaping illegal characters and appending their IdP domain (e.g., 1398 user%40133@identity.example.com), thus ensuring that they are 1399 authoritative for the identity. 1401 6. Security Considerations 1403 Much of the security analysis of this problem is contained in 1404 [I-D.ietf-rtcweb-security] or in the discussion of the particular 1405 issues above. In order to avoid repetition, this section focuses on 1406 (a) residual threats that are not addressed by this document and (b) 1407 threats produced by failure/misbehavior of one of the components in 1408 the system. 1410 6.1. Communications Security 1412 While this document favors DTLS-SRTP, it permits a variety of 1413 communications security mechanisms and thus the level of 1414 communications security actually provided varies considerably. Any 1415 pair of implementations which have multiple security mechanisms in 1416 common are subject to being downgraded to the weakest of those common 1417 mechanisms by any attacker who can modify the signaling traffic. If 1418 communications are over HTTP, this means any on-path attacker. If 1419 communications are over HTTPS, this means the signaling server. 1420 Implementations which wish to avoid downgrade attack should only 1421 offer the strongest available mechanism, which is DTLS/DTLS-SRTP. 1422 Note that the implication of this choice will be that interop to non- 1423 DTLS-SRTP devices will need to happen through gateways. 1425 Even if only DTLS/DTLS-SRTP are used, the signaling server can 1426 potentially mount a man-in-the-middle attack unless implementations 1427 have some mechanism for independently verifying keys. The UI 1428 requirements in Section 5.5 are designed to provide such a mechanism 1429 for motivated/security conscious users, but are not suitable for 1430 general use. The identity service mechanisms in Section 5.6 are more 1431 suitable for general use. Note, however, that a malicious signaling 1432 service can strip off any such identity assertions, though it cannot 1433 forge new ones. Note that all of the third-party security mechanisms 1434 available (whether X.509 certificates or a third-party IdP) rely on 1435 the security of the third party--this is of course also true of your 1436 connection to the Web site itself. Users who wish to assure 1437 themselves of security against a malicious identity provider can only 1438 do so by verifying peer credentials directly, e.g., by checking the 1439 peer's fingerprint against a value delivered out of band. 1441 In order to protect against malicious content JavaScript, that 1442 JavaScript MUST NOT be allowed to have direct access to---or perform 1443 computations with---DTLS keys. For instance, if content JS were able 1444 to compute digital signatures, then it would be possible for content 1445 JS to get an identity assertion for a browser's generated key and 1446 then use that assertion plus a signature by the key to authenticate a 1447 call protected under an ephemeral DH key controlled by the content 1448 JS, thus violating the security guarantees otherwise provided by the 1449 IdP mechanism. Note that it is not sufficient merely to deny the 1450 content JS direct access to the keys, as some have suggested doing 1451 with the WebCrypto API. [webcrypto]. The JS must also not be allowed 1452 to perform operations that would be valid for a DTLS endpoint. By 1453 far the safest approach is simply to deny the ability to perform any 1454 operations that depend on secret information associated with the key. 1455 Operations that depend on public information, such as exporting the 1456 public key are of course safe. 1458 6.2. Privacy 1460 The requirements in this document are intended to allow: 1462 o Users to participate in calls without revealing their location. 1463 o Potential callees to avoid revealing their location and even 1464 presence status prior to agreeing to answer a call. 1466 However, these privacy protections come at a performance cost in 1467 terms of using TURN relays and, in the latter case, delaying ICE. 1468 Sites SHOULD make users aware of these tradeoffs. 1470 Note that the protections provided here assume a non-malicious 1471 calling service. As the calling service always knows the users 1472 status and (absent the use of a technology like Tor) their IP 1473 address, they can violate the users privacy at will. Users who wish 1474 privacy against the calling sites they are using must use separate 1475 privacy enhancing technologies such as Tor. Combined WebRTC/Tor 1476 implementations SHOULD arrange to route the media as well as the 1477 signaling through Tor. Currently this will produce very suboptimal 1478 performance. 1480 Additionally, any identifier which persists across multiple calls is 1481 potentially a problem for privacy, especially for anonymous calling 1482 services. Such services SHOULD instruct the browser to use separate 1483 DTLS keys for each call and also to use TURN throughout the call. 1484 Otherwise, the other side will learn linkable information. 1485 Additionally, browsers SHOULD implement the privacy-preserving CNAME 1486 generation mode of [I-D.ietf-avtcore-6222bis]. 1488 6.3. Denial of Service 1490 The consent mechanisms described in this document are intended to 1491 mitigate denial of service attacks in which an attacker uses clients 1492 to send large amounts of traffic to a victim without the consent of 1493 the victim. While these mechanisms are sufficient to protect victims 1494 who have not implemented WebRTC at all, WebRTC implementations need 1495 to be more careful. 1497 Consider the case of a call center which accepts calls via RTCWeb. 1498 An attacker proxies the call center's front-end and arranges for 1499 multiple clients to initiate calls to the call center. Note that 1500 this requires user consent in many cases but because the data channel 1501 does not need consent, he can use that directly. Since ICE will 1502 complete, browsers can then be induced to send large amounts of data 1503 to the victim call center if it supports the data channel at all. 1504 Preventing this attack requires that automated WebRTC implementations 1505 implement sensible flow control and have the ability to triage out 1506 (i.e., stop responding to ICE probes on) calls which are behaving 1507 badly, and especially to be prepared to remotely throttle the data 1508 channel in the absence of plausible audio and video (which the 1509 attacker cannot control). 1511 Another related attack is for the signaling service to swap the ICE 1512 candidates for the audio and video streams, thus forcing a browser to 1513 send video to the sink that the other victim expects will contain 1514 audio (perhaps it is only expecting audio!) potentially causing 1515 overload. Muxing multiple media flows over a single transport makes 1516 it harder to individually suppress a single flow by denying ICE 1517 keepalives. Either media-level (RTCP) mechanisms must be used or the 1518 implementation must deny responses entirely, thus terminating the 1519 call. 1521 Yet another attack, suggested by Magnus Westerlund, is for the 1522 attacker to cross-connect offers and answers as follows. It induces 1523 the victim to make a call and then uses its control of other users 1524 browsers to get them to attempt a call to someone. It then 1525 translates their offers into apparent answers to the victim, which 1526 looks like large-scale parallel forking. The victim still responds 1527 to ICE responses and now the browsers all try to send media to the 1528 victim. Implementations can defend themselves from this attack by 1529 only responding to ICE Binding Requests for a limited number of 1530 remote ufrags (this is the reason for the requirement that the JS not 1531 be able to control the ufrag and password). 1533 [I-D.ietf-rtcweb-rtp-usage] Section 13 documents a number of 1534 potential RTCP-based DoS attacks and countermeasures. 1536 Note that attacks based on confusing one end or the other about 1537 consent are possible even in the face of the third-party identity 1538 mechanism as long as major parts of the signaling messages are not 1539 signed. On the other hand, signing the entire message severely 1540 restricts the capabilities of the calling application, so there are 1541 difficult tradeoffs here. 1543 6.4. IdP Authentication Mechanism 1545 This mechanism relies for its security on the IdP and on the 1546 PeerConnection correctly enforcing the security invariants described 1547 above. At a high level, the IdP is attesting that the user 1548 identified in the assertion wishes to be associated with the 1549 assertion. Thus, it must not be possible for arbitrary third parties 1550 to get assertions tied to a user or to produce assertions that RPs 1551 will accept. 1553 6.4.1. PeerConnection Origin Check 1555 Fundamentally, the IdP proxy is just a piece of HTML and JS loaded by 1556 the browser, so nothing stops a Web attacker o from creating their 1557 own IFRAME, loading the IdP proxy HTML/JS, and requesting a 1558 signature. In order to prevent this attack, we require that all 1559 signatures be tied to a specific origin ("rtcweb://...") which cannot 1560 be produced by content JavaScript. Thus, while an attacker can 1561 instantiate the IdP proxy, they cannot send messages from an 1562 appropriate origin and so cannot create acceptable assertions. I.e., 1563 the assertion request must have come from the browser. This origin 1564 check is enforced on the relying party side, not on the 1565 authenticating party side. The reason for this is to take the burden 1566 of knowing which origins are valid off of the IdP, thus making this 1567 mechanism extensible to other applications besides WebRTC. The IdP 1568 simply needs to gather the origin information (from the posted 1569 message) and attach it to the assertion. 1571 Note that although this origin check is enforced on the RP side and 1572 not at the IdP, it is absolutely imperative that it be done. The 1573 mechanisms in this document rely on the browser enforcing access 1574 restrictions on the DTLS keys and assertion requests which do not 1575 come with the right origin may be from content JS rather than from 1576 browsers, and therefore those access restrictions cannot be assumed. 1578 Note that this check only asserts that the browser (or some other 1579 entity with access to the user's authentication data) attests to the 1580 request and hence to the fingerprint. It does not demonstrate that 1581 the browser has access to the associated private key. However, 1582 attaching one's identity to a key that the user does not control does 1583 not appear to provide substantial leverage to an attacker, so a proof 1584 of possession is omitted for simplicity. 1586 6.4.2. IdP Well-known URI 1588 As described in Section 5.6.5.3.1 the IdP proxy HTML/JS landing page 1589 is located at a well-known URI based on the IdP's domain name. This 1590 requirement prevents an attacker who can write some resources at the 1591 IdP (e.g., on one's Facebook wall) from being able to impersonate the 1592 IdP. 1594 6.4.3. Privacy of IdP-generated identities and the hosting site 1596 Depending on the structure of the IdP's assertions, the calling site 1597 may learn the user's identity from the perspective of the IdP. In 1598 many cases this is not an issue because the user is authenticating to 1599 the site via the IdP in any case, for instance when the user has 1600 logged in with Facebook Connect and is then authenticating their call 1601 with a Facebook identity. However, in other case, the user may not 1602 have already revealed their identity to the site. In general, IdPs 1603 SHOULD either verify that the user is willing to have their identity 1604 revealed to the site (e.g., through the usual IdP permissions dialog) 1605 or arrange that the identity information is only available to known 1606 RPs (e.g., social graph adjacencies) but not to the calling site. 1607 The "origin" field of the signature request can be used to check that 1608 the user has agreed to disclose their identity to the calling site; 1609 because it is supplied by the PeerConnection it can be trusted to be 1610 correct. 1612 6.4.4. Security of Third-Party IdPs 1614 As discussed above, each third-party IdP represents a new universal 1615 trust point and therefore the number of these IdPs needs to be quite 1616 limited. Most IdPs, even those which issue unqualified identities 1617 such as Facebook, can be recast as authoritative IdPs (e.g., 1618 123456@facebook.com). However, in such cases, the user interface 1619 implications are not entirely desirable. One intermediate approach 1620 is to have special (potentially user configurable) UI for large 1621 authoritative IdPs, thus allowing the user to instantly grasp that 1622 the call is being authenticated by Facebook, Google, etc. 1624 6.4.5. Web Security Feature Interactions 1626 A number of optional Web security features have the potential to 1627 cause issues for this mechanism, as discussed below. 1629 6.4.5.1. Popup Blocking 1631 The IdP proxy is unable to generate popup windows, dialogs or any 1632 other form of user interactions. This prevents the IdP proxy from 1633 being used to circumvent user interaction. The "LOGINNEEDED" message 1634 allows the IdP proxy to inform the calling site of a need for user 1635 login, providing the information necessary to satisfy this 1636 requirement without resorting to direct user interaction from the IdP 1637 proxy itself. 1639 6.4.5.2. Third Party Cookies 1641 Some browsers allow users to block third party cookies (cookies 1642 associated with origins other than the top level page) for privacy 1643 reasons. Any IdP which uses cookies to persist logins will be broken 1644 by third-party cookie blocking. One option is to accept this as a 1645 limitation; another is to have the PeerConnection object disable 1646 third-party cookie blocking for the IdP proxy. 1648 7. IANA Considerations 1650 This specification defines the "identity" SDP attribute per the 1651 procedures of Section 8.2.4 of [RFC4566]. The required information 1652 for the registration is included here: 1653 Contact Name: Eric Rescorla (ekr@rftm.com) 1654 Attribute Name: identity 1655 Long Form: identity 1656 Type of Attribute: session-level 1657 Charset Considerations: This attribute is not subject to the charset 1658 attribute. 1659 Purpose: This attribute carries an identity assertion, binding an 1660 identity to the transport-level security session. 1661 Appropriate Values: See Section 5.6.4.3 of RFCXXXX [[Editor Note: 1662 This document. 1664 8. Acknowledgements 1666 Bernard Aboba, Harald Alvestrand, Richard Barnes, Dan Druta, Cullen 1667 Jennings, Hadriel Kaplan, Matthew Kaufman, Jim McEachern, Martin 1668 Thomson, Magnus Westerland. Matthew Kaufman provided the UI material 1669 in Section 5.5. 1671 9. Changes 1673 9.1. Changes since -06 1675 Replaced RTCWEB and RTC-Web with WebRTC, except when referring to the 1676 IETF WG 1678 Forbade use in mixed content as discussed in Orlando. 1680 Added a requirement to surface NULL ciphers to the top-level. 1682 Tried to clarify SRTP versus DTLS-SRTP. 1684 Added a section on screen sharing permissions. 1686 Assorted editorial work. 1688 9.2. Changes since -05 1690 The following changes have been made since the -05 draft. 1692 o Response to comments from Richard Barnes 1693 o More explanation of the IdP security properties and the federation 1694 use case. 1695 o Editorial cleanup. 1697 9.3. Changes since -03 1699 Version -04 was a version control mistake. Please ignore. 1701 The following changes have been made since the -04 draft. 1703 o Move origin check from IdP to RP per discussion in YVR. 1704 o Clarified treatment of X.509-level identities. 1705 o Editorial cleanup. 1707 9.4. Changes since -03 1709 9.5. Changes since -02 1711 The following changes have been made since the -02 draft. 1713 o Forbid persistent HTTP permissions. 1714 o Clarified the text in S 5.4 to clearly refer to requirements on 1715 the API to provide functionality to the site. 1716 o Fold in the IETF portion of draft-rescorla-rtcweb-generic-idp 1717 o Retarget the continuing consent section to assume Binding Requests 1718 o Added some more privacy and linkage text in various places. 1719 o Editorial improvements 1721 10. References 1723 10.1. Normative References 1725 [I-D.ietf-avtcore-6222bis] 1726 Begen, A., Perkins, C., Wing, D., and E. Rescorla, 1727 "Guidelines for Choosing RTP Control Protocol (RTCP) 1728 Canonical Names (CNAMEs)", draft-ietf-avtcore-6222bis-06 1729 (work in progress), July 2013. 1731 [I-D.ietf-rtcweb-rtp-usage] 1732 Perkins, C., Westerlund, M., and J. Ott, "Web Real-Time 1733 Communication (WebRTC): Media Transport and Use of RTP", 1734 draft-ietf-rtcweb-rtp-usage-15 (work in progress), 1735 May 2014. 1737 [I-D.ietf-rtcweb-security] 1738 Rescorla, E., "Security Considerations for WebRTC", 1739 draft-ietf-rtcweb-security-06 (work in progress), 1740 January 2014. 1742 [I-D.ietf-tsvwg-sctp-dtls-encaps] 1743 Tuexen, M., Stewart, R., Jesup, R., and S. Loreto, "DTLS 1744 Encapsulation of SCTP Packets", 1745 draft-ietf-tsvwg-sctp-dtls-encaps-04 (work in progress), 1746 May 2014. 1748 [I-D.muthu-behave-consent-freshness] 1749 Perumal, M., Wing, D., R, R., and T. Reddy, "STUN Usage 1750 for Consent Freshness", 1751 draft-muthu-behave-consent-freshness-04 (work in 1752 progress), July 2013. 1754 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1755 Requirement Levels", BCP 14, RFC 2119, March 1997. 1757 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. 1759 [RFC3711] Baugher, M., McGrew, D., Naslund, M., Carrara, E., and K. 1760 Norrman, "The Secure Real-time Transport Protocol (SRTP)", 1761 RFC 3711, March 2004. 1763 [RFC4347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer 1764 Security", RFC 4347, April 2006. 1766 [RFC4566] Handley, M., Jacobson, V., and C. Perkins, "SDP: Session 1767 Description Protocol", RFC 4566, July 2006. 1769 [RFC4572] Lennox, J., "Connection-Oriented Media Transport over the 1770 Transport Layer Security (TLS) Protocol in the Session 1771 Description Protocol (SDP)", RFC 4572, July 2006. 1773 [RFC4627] Crockford, D., "The application/json Media Type for 1774 JavaScript Object Notation (JSON)", RFC 4627, July 2006. 1776 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 1777 Encodings", RFC 4648, October 2006. 1779 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 1780 Specifications: ABNF", STD 68, RFC 5234, January 2008. 1782 [RFC5245] Rosenberg, J., "Interactive Connectivity Establishment 1783 (ICE): A Protocol for Network Address Translator (NAT) 1784 Traversal for Offer/Answer Protocols", RFC 5245, 1785 April 2010. 1787 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 1788 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 1790 [RFC5763] Fischl, J., Tschofenig, H., and E. Rescorla, "Framework 1791 for Establishing a Secure Real-time Transport Protocol 1792 (SRTP) Security Context Using Datagram Transport Layer 1793 Security (DTLS)", RFC 5763, May 2010. 1795 [RFC5764] McGrew, D. and E. Rescorla, "Datagram Transport Layer 1796 Security (DTLS) Extension to Establish Keys for the Secure 1797 Real-time Transport Protocol (SRTP)", RFC 5764, May 2010. 1799 [RFC5785] Nottingham, M. and E. Hammer-Lahav, "Defining Well-Known 1800 Uniform Resource Identifiers (URIs)", RFC 5785, 1801 April 2010. 1803 [RFC5890] Klensin, J., "Internationalized Domain Names for 1804 Applications (IDNA): Definitions and Document Framework", 1805 RFC 5890, August 2010. 1807 [RFC6454] Barth, A., "The Web Origin Concept", RFC 6454, 1808 December 2011. 1810 [WebMessaging] 1811 Hickson, "HTML5 Web Messaging", May 2012, 1812 . 1814 [webcrypto] 1815 Dahl, Sleevi, "Web Cryptography API", June 2013. 1817 Available at http://www.w3.org/TR/WebCryptoAPI/ 1819 [webrtc-api] 1820 Bergkvist, Burnett, Jennings, Narayanan, "WebRTC 1.0: 1821 Real-time Communication Between Browsers", October 2011. 1823 Available at 1824 http://dev.w3.org/2011/webrtc/editor/webrtc.html 1826 10.2. Informative References 1828 [I-D.ietf-rtcweb-jsep] 1829 Uberti, J. and C. Jennings, "Javascript Session 1830 Establishment Protocol", draft-ietf-rtcweb-jsep-06 (work 1831 in progress), February 2014. 1833 [RFC2617] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S., 1834 Leach, P., Luotonen, A., and L. Stewart, "HTTP 1835 Authentication: Basic and Digest Access Authentication", 1836 RFC 2617, June 1999. 1838 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 1839 A., Peterson, J., Sparks, R., Handley, M., and E. 1840 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 1841 June 2002. 1843 [RFC5705] Rescorla, E., "Keying Material Exporters for Transport 1844 Layer Security (TLS)", RFC 5705, March 2010. 1846 [RFC6265] Barth, A., "HTTP State Management Mechanism", RFC 6265, 1847 April 2011. 1849 [RFC6455] Fette, I. and A. Melnikov, "The WebSocket Protocol", 1850 RFC 6455, December 2011. 1852 [XmlHttpRequest] 1853 van Kesteren, A., "XMLHttpRequest Level 2", January 2012. 1855 Appendix A. Example IdP Bindings to Specific Protocols 1857 [[TODO: These still need some cleanup.]] 1859 This section provides some examples of how the mechanisms described 1860 in this document could be used with existing authentication protocols 1861 such as BrowserID or OAuth. Note that this does not require browser- 1862 level support for either protocol. Rather, the protocols can be fit 1863 into the generic framework. (Though BrowserID in particular works 1864 better with some client side support). 1866 A.1. BrowserID 1868 BrowserID [https://browserid.org/] is a technology which allows a 1869 user with a verified email address to generate an assertion 1870 (authenticated by their identity provider) attesting to their 1871 identity (phrased as an email address). The way that this is used in 1872 practice is that the relying party embeds JS in their site which 1873 talks to the BrowserID code (either hosted on a trusted intermediary 1874 or embedded in the browser). That code generates the assertion which 1875 is passed back to the relying party for verification. The assertion 1876 can be verified directly or with a Web service provided by the 1877 identity provider. It's relatively easy to extend this functionality 1878 to authenticate WebRTC calls, as shown below. 1880 +----------------------+ +----------------------+ 1881 | | | | 1882 | Alice's Browser | | Bob's Browser | 1883 | | OFFER ------------> | | 1884 | Calling JS Code | | Calling JS Code | 1885 | ^ | | ^ | 1886 | | | | | | 1887 | v | | v | 1888 | PeerConnection | | PeerConnection | 1889 | | ^ | | | ^ | 1890 | Finger| |Signed | |Signed | | | 1891 | print | |Finger | |Finger | |"Alice"| 1892 | | |print | |print | | | 1893 | v | | | v | | 1894 | +--------------+ | | +---------------+ | 1895 | | IdP Proxy | | | | IdP Proxy | | 1896 | | to | | | | to | | 1897 | | BrowserID | | | | BrowserID | | 1898 | | Signer | | | | Verifier | | 1899 | +--------------+ | | +---------------+ | 1900 | ^ | | ^ | 1901 +-----------|----------+ +----------|-----------+ 1902 | | 1903 | Get certificate | 1904 v | Check 1905 +----------------------+ | certificate 1906 | | | 1907 | Identity |/-------------------------------+ 1908 | Provider | 1909 | | 1910 +----------------------+ 1912 The way this mechanism works is as follows. On Alice's side, Alice 1913 goes to initiate a call. 1915 1. The calling JS instantiates a PeerConnection and tells it that it 1916 is interested in having it authenticated via BrowserID (i.e., it 1917 provides "browserid.org" as the IdP name.) 1918 2. The PeerConnection instantiates the BrowserID signer in the IdP 1919 proxy 1920 3. The BrowserID signer contacts Alice's identity provider, 1921 authenticating as Alice (likely via a cookie). 1922 4. The identity provider returns a short-term certificate attesting 1923 to Alice's identity and her short-term public key. 1924 5. The Browser-ID code signs the fingerprint and returns the signed 1925 assertion + certificate to the PeerConnection. 1927 6. The PeerConnection returns the signed information to the calling 1928 JS code. 1929 7. The signed assertion gets sent over the wire to Bob's browser 1930 (via the signaling service) as part of the call setup. 1932 The offer might look something like: 1934 { 1935 "type":"OFFER", 1936 "sdp": 1937 "v=0\n 1938 o=- 2890844526 2890842807 IN IP4 192.0.2.1\n 1939 s= \n 1940 c=IN IP4 192.0.2.1\n 1941 t=2873397496 2873404696\n 1942 a=fingerprint:SHA-1 ...\n 1943 4A:AD:B9:B1:3F:82:18:3B:54:02:12:DF:3E:5D:49:6B:19:E5:7C:AB\n 1944 a=identity [[base-64 encoding of identity assertion: 1945 { 1946 "idp":{ // Standardized 1947 "domain":"browserid.org", 1948 "method":"default" 1949 }, 1950 // Assertion contents are browserid-specific 1951 "assertion": "{ 1952 \"assertion\": { 1953 \"digest\":\"\", 1954 \"audience\": \"\" 1955 \"valid-until\": 1308859352261, 1956 }, 1957 \"certificate\": { 1958 \"email\": \"rescorla@example.org\", 1959 \"public-key\": \"\", 1960 \"valid-until\": 1308860561861, 1961 \"signature\": \"\" 1962 }, 1963 \"content\": \"\" 1964 }" 1965 } 1966 ]]\n 1967 m=audio 49170 RTP/AVP 0\n 1968 ..." 1969 } 1971 Note that while the IdP here is specified as "browserid.org", the 1972 actual certificate is signed by example.org. This is because 1973 BrowserID is a combined authoritative/third-party system in which 1974 browserid.org delegates the right to be authoritative (what BrowserID 1975 calls primary) to individual domains. 1977 On Bob's side, he receives the signed assertion as part of the call 1978 setup message and a similar procedure happens to verify it. 1980 1. The calling JS instantiates a PeerConnection and provides it the 1981 relevant signaling information, including the signed assertion. 1982 2. The PeerConnection instantiates the IdP proxy which examines the 1983 IdP name and brings up the BrowserID verification code. 1984 3. The BrowserID verifier contacts the identity provider to verify 1985 the certificate and then uses the key to verify the signed 1986 fingerprint. 1987 4. Alice's verified identity is returned to the PeerConnection (it 1988 already has the fingerprint). 1989 5. At this point, Bob's browser can display a trusted UI indication 1990 that Alice is on the other end of the call. 1992 When Bob returns his answer, he follows the converse procedure, which 1993 provides Alice with a signed assertion of Bob's identity and keying 1994 material. 1996 A.2. OAuth 1998 While OAuth is not directly designed for user-to-user authentication, 1999 with a little lateral thinking it can be made to serve. We use the 2000 following mapping of OAuth concepts to WebRTC concepts: 2002 +----------------------+----------------------+ 2003 | OAuth | WebRTC | 2004 +----------------------+----------------------+ 2005 | Client | Relying party | 2006 | Resource owner | Authenticating party | 2007 | Authorization server | Identity service | 2008 | Resource server | Identity service | 2009 +----------------------+----------------------+ 2011 Table 1 2013 The idea here is that when Alice wants to authenticate to Bob (i.e., 2014 for Bob to be aware that she is calling). In order to do this, she 2015 allows Bob to see a resource on the identity provider that is bound 2016 to the call, her identity, and her public key. Then Bob retrieves 2017 the resource from the identity provider, thus verifying the binding 2018 between Alice and the call. 2020 Alice IdP Bob 2021 --------------------------------------------------------- 2022 Call-Id, Fingerprint -------> 2023 <------------------- Auth Code 2024 Auth Code ----------------------------------------------> 2025 <----- Get Token + Auth Code 2026 Token ---------------------> 2027 <------------- Get call-info 2028 Call-Id, Fingerprint ------> 2030 This is a modified version of a common OAuth flow, but omits the 2031 redirects required to have the client point the resource owner to the 2032 IdP, which is acting as both the resource server and the 2033 authorization server, since Alice already has a handle to the IdP. 2035 Above, we have referred to "Alice", but really what we mean is the 2036 PeerConnection. Specifically, the PeerConnection will instantiate an 2037 IFRAME with JS from the IdP and will use that IFRAME to communicate 2038 with the IdP, authenticating with Alice's identity (e.g., cookie). 2039 Similarly, Bob's PeerConnection instantiates an IFRAME to talk to the 2040 IdP. 2042 Author's Address 2044 Eric Rescorla 2045 RTFM, Inc. 2046 2064 Edgewood Drive 2047 Palo Alto, CA 94303 2048 USA 2050 Phone: +1 650 678 2350 2051 Email: ekr@rtfm.com