idnits 2.17.1 draft-ietf-oauth-iss-auth-resp-03.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** There is 1 instance of too long lines in the document, the longest one being 7 characters in excess of 72. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (18 November 2021) is 890 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-oauth-security-topics-18 Summary: 1 error (**), 0 flaws (~~), 2 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Web Authorization Protocol K. Meyer zu Selhausen 3 Internet-Draft Hackmanit 4 Intended status: Standards Track D. Fett 5 Expires: 22 May 2022 yes.com 6 18 November 2021 8 OAuth 2.0 Authorization Server Issuer Identification 9 draft-ietf-oauth-iss-auth-resp-03 11 Abstract 13 This document specifies a new parameter iss that is used to 14 explicitly include the issuer identifier of the authorization server 15 in the authorization response of an OAuth authorization flow. The 16 iss parameter serves as an effective countermeasure to "mix-up 17 attacks". 19 Status of This Memo 21 This Internet-Draft is submitted in full conformance with the 22 provisions of BCP 78 and BCP 79. 24 Internet-Drafts are working documents of the Internet Engineering 25 Task Force (IETF). Note that other groups may also distribute 26 working documents as Internet-Drafts. The list of current Internet- 27 Drafts is at https://datatracker.ietf.org/drafts/current/. 29 Internet-Drafts are draft documents valid for a maximum of six months 30 and may be updated, replaced, or obsoleted by other documents at any 31 time. It is inappropriate to use Internet-Drafts as reference 32 material or to cite them other than as "work in progress." 34 This Internet-Draft will expire on 22 May 2022. 36 Copyright Notice 38 Copyright (c) 2021 IETF Trust and the persons identified as the 39 document authors. All rights reserved. 41 This document is subject to BCP 78 and the IETF Trust's Legal 42 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 43 license-info) in effect on the date of publication of this document. 44 Please review these documents carefully, as they describe your rights 45 and restrictions with respect to this document. Code Components 46 extracted from this document must include Revised BSD License text as 47 described in Section 4.e of the Trust Legal Provisions and are 48 provided without warranty as described in the Revised BSD License. 50 Table of Contents 52 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 53 1.1. Conventions and Terminology . . . . . . . . . . . . . . . 3 54 2. Response Parameter iss . . . . . . . . . . . . . . . . . . . 4 55 2.1. Example Authorization Response . . . . . . . . . . . . . 4 56 2.2. Example Error Response . . . . . . . . . . . . . . . . . 4 57 2.3. Providing the Issuer Identifier iss . . . . . . . . . . . 4 58 2.4. Validation of the Issuer Identifier iss . . . . . . . . . 5 59 3. Authorization Server Metadata . . . . . . . . . . . . . . . . 6 60 4. Security Considerations . . . . . . . . . . . . . . . . . . . 6 61 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 7 62 5.1. OAuth Authorization Server Metadata . . . . . . . . . . . 7 63 5.2. OAuth Parameters Registration . . . . . . . . . . . . . . 8 64 6. Normative References . . . . . . . . . . . . . . . . . . . . 8 65 7. Informative References . . . . . . . . . . . . . . . . . . . 9 66 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 9 67 Appendix B. Document History . . . . . . . . . . . . . . . . . . 9 68 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 10 70 1. Introduction 72 The OAuth authorization framework [RFC6749] allows clients to 73 interact with multiple independent authorization servers under the 74 control of separate entities. Some OAuth grant types utilize the 75 resource owner's user-agent to deliver the authorization server's 76 response to the OAuth client. One example of this pattern is the 77 authorization response of the authorization code grant. 79 The authorization response as specified in Section 4.1.2 of [RFC6749] 80 does not contain any information about the identity of the 81 authorization server which issued the response. Therefore, clients 82 receiving a response from the resource owner's user-agent cannot be 83 sure who initially issued the response and the secrets contained 84 therein. The lack of certainty about the origin of the response 85 enables a class of attacks called "mix-up attacks". 87 Mix-up attacks are a potential threat to all OAuth clients that 88 interact with multiple authorization servers. When at least one of 89 these authorization servers is under an attacker's control, the 90 attacker can launch a mix-up attack to acquire authorization codes or 91 access tokens issued by any one of the other authorization servers. 92 There are multiple ways in which an attacker can gain control over an 93 authorization server supported by the client: For instance, an 94 authorization server could become compromised, or the attacker could 95 register their own authorization server, for example, using dynamic 96 client registration ([RFC7591]). 98 OAuth clients that interact with only one authorization server are 99 not vulnerable to mix-up attacks. However, when such clients decide 100 to add support for a second authorization server in the future they 101 become vulnerable and need to apply countermeasures to mix-up 102 attacks. 104 Mix-up attacks aim to steal an authorization code or access token by 105 tricking the client into sending the authorization code or access 106 token to the attacker instead of the honest authorization or resource 107 server. This marks a severe threat to the confidentiality and 108 integrity of resources whose access is managed with OAuth. A 109 detailed description and different variants of the mix-up attack 110 class can be found in Section 4.4 of the OAuth Security Best Current 111 Practice [I-D.ietf-oauth-security-topics] as well as in the original 112 research first highlighting this attack class, "On the security of 113 modern Single Sign-On Protocols: Second-Order Vulnerabilities in 114 OpenID Connect" [arXiv.1508.04324] and "A Comprehensive Formal 115 Security Analysis of OAuth 2.0" [arXiv.1601.01229]. 117 This document defines a new parameter in the authorization response 118 called iss. The iss parameter allows the authorization server to 119 include its identity in the authorization response explicitly. The 120 client can compare the value of the iss parameter to the issuer 121 identifier of the authorization server (e.g., retrieved from its 122 metadata) it believes it is interacting with. The iss parameter 123 gives the client certainty about the authorization server's identity 124 and enables it to send credentials such as authorization codes and 125 access tokens only to the intended recipients. 127 The effectiveness of the iss parameter against mix-up attacks was 128 analyzed and formally proven in "A Comprehensive Formal Security 129 Analysis of OAuth 2.0" [arXiv.1601.01229]. 131 1.1. Conventions and Terminology 133 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 134 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 135 "OPTIONAL" in this document are to be interpreted as described in BCP 136 14 [RFC2119] [RFC8174] when, and only when, they appear in all 137 capitals, as shown here. 139 This specification uses the terms "access token", "authorization 140 code", "authorization code grant", "authorization server", "resource 141 server", "authorization response", "grant type", and "client" defined 142 by the OAuth 2.0 Authorization Framework [RFC6749] and the term 143 "issuer identifier" defined by OAuth 2.0 Authorization Server 144 Metadata [RFC8414]. 146 2. Response Parameter iss 148 In authorization responses to the client, including error responses, 149 an authorization server supporting this specification MUST indicate 150 its identity by including the iss parameter in the response. 152 The iss parameter value is the issuer identifier of the authorization 153 server which created the authorization response, as defined in 154 [RFC8414]. Its value MUST be a URL that uses the "https" scheme 155 without any query or fragment components. If the authorization 156 server provides metadata as defined in [RFC8414], the value of the 157 parameter iss MUST be identical to the authorization server metadata 158 value issuer. 160 2.1. Example Authorization Response 162 The following example shows an authorization response from the 163 authorization server whose issuer identifier is 164 https://honest.as.example (extra line breaks and indentation are for 165 display purposes only): 167 HTTP/1.1 302 Found 168 Location: https://client.example/cb? 169 code=x1848ZT64p4IirMPT0R-X3141MFPTuBX-VFL_cvaplMH58 170 &state=ZWVlNDBlYzA1NjdkMDNhYjg3ZjUxZjAyNGQzMTM2NzI 171 &iss=https%3A%2F%2Fhonest.as.example 173 2.2. Example Error Response 175 The following example shows an error response from the same 176 authorization server (extra line breaks and indentation are for 177 display purposes only): 179 HTTP/1.1 302 Found 180 Location: https://client.example/cb? 181 error=access_denied 182 &state=ZWVlNDBlYzA1NjdkMDNhYjg3ZjUxZjAyNGQzMTM2NzI 183 &iss=https%3A%2F%2Fhonest.as.example 185 2.3. Providing the Issuer Identifier iss 187 Authorization servers supporting this specification MUST provide 188 their issuer identifier to enable clients to validate the iss 189 parameter effectively. 191 For authorization servers publishing metadata according to [RFC8414], 192 the following rules apply: 194 * The issuer identifier included in the server's metadata value 195 issuer MUST be identical to the iss parameter's value. 197 * The server MUST indicate its support for the iss parameter by 198 setting the metadata parameter 199 authorization_response_iss_parameter_supported, defined in 200 Section 3, to true. 202 Authorization servers MAY additionally provide the issuer identifier 203 to clients by any other mechanism which is outside of the scope of 204 this specification. 206 2.4. Validation of the Issuer Identifier iss 208 Clients that support this specification MUST extract the value of the 209 iss parameter from authorization responses they receive if the 210 parameter is present. Clients MUST then decode the value from its 211 "application/x-www-form-urlencoded" form according to [RFC6749], 212 Appendix B, and compare the result to the issuer identifier of the 213 authorization server where the authorization request was sent to. 214 This comparison MUST use simple string comparison as defined in 215 Section 6.2.1 of [RFC3986]. If the value does not match the expected 216 issuer identifier, clients MUST reject the authorization response and 217 MUST NOT proceed with the authorization grant. For error responses, 218 clients MUST NOT assume that the error originates from the intended 219 authorization server. 221 More precisely, clients that interact with authorization servers 222 supporting OAuth metadata [RFC8414] MUST compare the iss parameter 223 value to the issuer value in the server's metadata document. If 224 OAuth metadata is not used, clients MUST use deployment-specific 225 ways, for example a static configuration, to decide if the returned 226 iss value is the expected value in the current flow (see also 227 Section 4). 229 If clients interact with both authorization servers supporting this 230 specification and authorization servers not supporting this 231 specification, clients MUST store the information which authorization 232 server supports the iss parameter. Clients MUST reject authorization 233 responses without the iss parameter from authorization servers which 234 do support the parameter according to the client's configuration. 235 Clients SHOULD discard authorization responses with the iss parameter 236 from authorization servers which do not indicate their support for 237 the parameter. However, there might be legitimate authorization 238 servers that provide the iss parameter without indicating their 239 support in their metadata. Local policy or configuration can 240 determine whether to accept such responses and specific guidance is 241 out of scope for this specification. 243 In general, clients that support this specification MAY accept 244 authorization responses that do not contain the iss parameter or 245 reject them and exclusively support authorization servers which 246 provide the iss parameter in the authorization response. Local 247 policy or configuration can determine whether to accept such 248 responses and specific guidance is out of scope for this 249 specification. 251 In OpenID Connect [OIDC.Core] flows where an ID Token is returned 252 from the authorization endpoint, the value in the iss parameter MUST 253 always be identical to the iss claim in the ID Token. 255 Section 4.1.2 of [RFC6749] already mandates that clients that do not 256 support this specification MUST ignore the unrecognized iss 257 parameter. 259 Note: The "JWT Secured Authorization Response Mode for OAuth 2.0 260 (JARM)" [JARM] defines a mechanism that conveys all authorization 261 response parameters in a JWT. This JWT contains an iss claim that 262 provides the same protection if it is validated as described in 263 Section 2.4. Therefore, an additional iss parameter outside the JWT 264 is not necessary when JARM is used. 266 3. Authorization Server Metadata 268 The following parameter for the authorization server metadata 269 [RFC8414] is introduced to signal the authorization server's support 270 for this specification: 272 authorization_response_iss_parameter_supported Boolean parameter 273 indicating whether the authorization server provides the iss 274 parameter in the authorization response as defined in Section 2. 275 If omitted, the default value is false. 277 4. Security Considerations 279 Clients MUST validate the iss parameter precisely as described in 280 Section 2.4 and MUST NOT allow multiple authorization servers to use 281 the same issuer identifier. In particular, when authorization server 282 details can be manually configured in the client, the client MUST 283 ensure that the accepted iss values are unique for each authorization 284 server. 286 The iss parameter enables a client to decide if an authorization 287 server "expects" to be used in an OAuth flow together with a certain 288 token endpoint and potentially other endpoints, like the userinfo 289 endpoint ([OIDC.Core]). When OAuth metadata is used, the iss 290 parameter identifies the issuer and therefore the respective OAuth 291 metadata document which points to the other endpoints. When OAuth 292 metadata is not used, the client can use, for example, a statically 293 configured expected iss value for each configured authorization 294 server. 296 The issuer identifier contained in the authorization response is not 297 cryptographically protected against tampering. In general, 298 mechanisms such as JWTs (as specified in JARM [JARM]) could be used 299 to protect the integrity of the authorization response. However, in 300 mix-up attacks, the client generally receives the authorization 301 response from an uncompromised authorization server. If an attacker 302 can tamper this authorization response before it is received by the 303 client, the attacker would also have direct access to the 304 authorization code. The attacker does not need to execute a mix-up 305 attack to steal the authorization code. Therefore, integrity 306 protection for the authorization response is not necessary to defend 307 against mix-up attacks. 309 There are also alternative countermeasures to mix-up attacks. When 310 an authorization response already includes an authorization server's 311 issuer identifier by other means, and this identifier is checked as 312 laid out in Section 2.4, the use and verification of the iss 313 parameter is not necessary and MAY be omitted. This is the case when 314 OpenID Connect response types that return an ID token from the 315 authorization endpoint (e.g., response_type=code id_token) or JARM 316 response mode are used, for example. However, if a client receives 317 an authorization response that contains multiple issuer identifiers, 318 the client MUST reject the response if these issuer identifiers do 319 not match. The details of alternative countermeasures are outside of 320 the scope of this specification. 322 Mix-up attacks are only relevant to clients that interact with 323 multiple authorization servers. However, clients interacting with 324 only one authorization server might add support for a second 325 authorization server in the future. By supporting multiple 326 authorization servers they become vulnerable to mix-up attacks and 327 need to apply countermeasures. 329 5. IANA Considerations 331 5.1. OAuth Authorization Server Metadata 333 This specification requests registration of the following values in 334 the IANA "OAuth Authorization Server Metadata" registry of 335 [IANA.OAuth.Parameters] established by [RFC8414]. 337 Metadata Name: authorization_response_iss_parameter_supported 338 Metadata Description: Boolean value indicating whether the 339 authorization server provides the iss parameter in the 340 authorization response. 341 Change Controller: IETF 342 Specification Document(s): Section 3 of [[ this document ]] 344 5.2. OAuth Parameters Registration 346 This specification requests registration of the following values in 347 the IANA "OAuth Parameters" registry of [IANA.OAuth.Parameters] 348 established by [RFC6749]. 350 Parameter name: iss 351 Parameter usage location: authorization response 352 Change Controller: IETF 353 Specification Document(s): Section 2 of [[ this document ]] 355 6. Normative References 357 [I-D.ietf-oauth-security-topics] 358 Lodderstedt, T., Bradley, J., Labunets, A., and D. Fett, 359 "OAuth 2.0 Security Best Current Practice", Work in 360 Progress, Internet-Draft, draft-ietf-oauth-security- 361 topics-18, 13 April 2021, 362 . 365 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 366 Requirement Levels", BCP 14, RFC 2119, 367 DOI 10.17487/RFC2119, March 1997, 368 . 370 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 371 Resource Identifier (URI): Generic Syntax", STD 66, 372 RFC 3986, DOI 10.17487/RFC3986, January 2005, 373 . 375 [RFC6749] Hardt, D., Ed., "The OAuth 2.0 Authorization Framework", 376 RFC 6749, DOI 10.17487/RFC6749, October 2012, 377 . 379 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 380 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 381 May 2017, . 383 [RFC8414] Jones, M., Sakimura, N., and J. Bradley, "OAuth 2.0 384 Authorization Server Metadata", RFC 8414, 385 DOI 10.17487/RFC8414, June 2018, 386 . 388 7. Informative References 390 [IANA.OAuth.Parameters] 391 IANA, "OAuth Parameters", 392 . 394 [JARM] Lodderstedt, T. and B. Campbell, "Financial-grade API: JWT 395 Secured Authorization Response Mode for OAuth 2.0 (JARM)", 396 17 October 2018, 397 . 399 [OIDC.Core] 400 Sakimura, N., Bradley, J., Jones, M., de Medeiros, B., and 401 C. Mortimore, "OpenID Connect Core 1.0 incorporating 402 errata set 1", 8 November 2014, 403 . 405 [RFC7591] Richer, J., Ed., Jones, M., Bradley, J., Machulak, M., and 406 P. Hunt, "OAuth 2.0 Dynamic Client Registration Protocol", 407 RFC 7591, DOI 10.17487/RFC7591, July 2015, 408 . 410 [arXiv.1508.04324] 411 Mainka, C., Mladenov, V., and J. Schwenk, "On the security 412 of modern Single Sign-On Protocols: Second-Order 413 Vulnerabilities in OpenID Connect", 18 August 2015, 414 . 416 [arXiv.1601.01229] 417 Fett, D., Kuesters, R., and G. Schmitz, "A Comprehensive 418 Formal Security Analysis of OAuth 2.0", 6 January 2016, 419 . 421 Appendix A. Acknowledgements 423 We would like to thank Brian Campbell, Roman Danyliw, Vladimir 424 Dzhuvinov, Joseph Heenan, Takahiko Kawasaki, Torsten Lodderstedt, 425 Christian Mainka, Vladislav Mladenov, Warren Parad, Aaron Parecki, 426 and Rifaat Shekh-Yusef for their valuable feedback on this document. 428 Appendix B. Document History 429 [[ To be removed from the final specification ]] 431 -03 [[ Working Group Draft ]] 432 * Incorporated feedback from AD review 433 * Incorporated feedback from artart and secdir reviews 435 -02 [[ Working Group Draft ]] 436 * Incorporated feedback from shepherd review 437 * Changed SHOULD to MUST (clients MUST store which AS support `iss` parameter) 438 * Added note for clients receiving unexpected `iss` parameter 439 * Editorial changes 441 -01 [[ Working Group Draft ]] 442 * Incorporated WG feedback 443 * Changed title of the draft to make it shorter 444 * Clarified mix-up attacks in introduction 445 * Improved note on JARM in validation section 447 -00 [[ Working Group Draft ]] 448 * Working group draft 450 -02 451 * Incorporated WG feedback 452 * Clarifications for unique issuer identifier 453 * Clarifications when multiple issuer identifier could be present 454 * Added note that iss parameter MUST NOT be used with JARM 455 * Added note on error responses and example for error response 456 * Editorial changes 458 -01 460 * Incorporated first WG feedback 461 * Clarifications for use with OIDC 462 * Added note that clients supporting just one AS are not vulnerable 463 * Renamed metadata parameter 464 * Various editorial changes 466 -00 468 * initial draft 470 Authors' Addresses 472 Karsten Meyer zu Selhausen 473 Hackmanit 475 Email: karsten.meyerzuselhausen@hackmanit.de 476 Daniel Fett 477 yes.com 479 Email: mail@danielfett.de