idnits 2.17.1 draft-newman-auth-scram-gs2-01.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: ---------------------------------------------------------------------------- ** The document is more than 15 pages and seems to lack a Table of Contents. == The page length should not exceed 58 lines per page, but there was 19 longer pages, the longest (page 2) being 60 lines Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to contain a disclaimer for pre-RFC5378 work, but was first submitted on or after 10 November 2008. The disclaimer is usually necessary only for documents that revise or obsolete older RFCs, and that take significant amounts of text from those RFCs. If you can contact all authors of the source material and they are willing to grant the BCP78 rights to the IETF Trust, you can and should remove the disclaimer. Otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (March 9, 2009) is 5527 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) == Missing Reference: 'GS2' is mentioned on line 360, but not defined == Unused Reference: 'RFC4422' is defined on line 757, but no explicit reference was found in the text == Unused Reference: 'RFC2195' is defined on line 776, but no explicit reference was found in the text == Unused Reference: 'RFC2202' is defined on line 780, but no explicit reference was found in the text == Unused Reference: 'RFC4086' is defined on line 792, but no explicit reference was found in the text ** Downref: Normative reference to an Informational RFC: RFC 2104 ** Downref: Normative reference to an Informational RFC: RFC 3174 ** Obsolete normative reference: RFC 4013 (ref. 'SASLPrep') (Obsoleted by RFC 7613) ** Obsolete normative reference: RFC 3454 (Obsoleted by RFC 7564) == Outdated reference: A later version (-20) exists of draft-ietf-sasl-gs2-10 -- Obsolete informational reference (is this intentional?): RFC 2898 (Obsoleted by RFC 8018) -- Obsolete informational reference (is this intentional?): RFC 5246 (ref. 'TLS') (Obsoleted by RFC 8446) Summary: 5 errors (**), 0 flaws (~~), 9 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group Abhijit Menon-Sen 3 Internet-Draft Oryx Mail Systems GmbH 4 Intended Status: Proposed Standard Chris Newman 5 Expires: September 2009 Sun Microsystems 6 Alexey Melnikov 7 Isode Ltd 8 Simon Josefsson 9 SJD AB 10 March 9, 2009 12 Salted Challenge Response Authentication Mechanism (SCRAM) 13 as a GSS-API Mechanism 15 draft-newman-auth-scram-gs2-01.txt 17 Status of this Memo 19 This Internet-Draft is submitted to IETF in full conformance with 20 the provisions of BCP 78 and BCP 79. This document may contain 21 material from IETF Documents or IETF Contributions published or made 22 publicly available before November 10, 2008. The person(s) 23 controlling the copyright in some of this material may not have 24 granted the IETF Trust the right to allow modifications of such 25 material outside the IETF Standards Process. Without obtaining an 26 adequate license from the person(s) controlling the copyright in 27 such materials, this document may not be modified outside the IETF 28 Standards Process, and derivative works of it may not be created 29 outside the IETF Standards Process, except to format it for 30 publication as an RFC or to translate it into languages other than 31 English. 33 This Internet-Draft is submitted to IETF in full conformance with 34 the provisions of BCP 78 and BCP 79. 36 Internet-Drafts are working documents of the Internet Engineering 37 Task Force (IETF), its areas, and its working groups. Note that 38 other groups may also distribute working documents as Internet- 39 Drafts. 41 Internet-Drafts are draft documents valid for a maximum of six 42 months and may be updated, replaced, or obsoleted by other documents 43 at any time. It is inappropriate to use Internet-Drafts as reference 44 material or to cite them other than as "work in progress." 46 The list of current Internet-Drafts can be accessed at 47 http://www.ietf.org/1id-abstracts.html 49 Internet-draft March 2009 51 The list of Internet-Draft Shadow Directories can be accessed at 52 http://www.ietf.org/shadow.html 54 This Internet-Draft expires in September 2009. 56 Copyright Notice 58 Copyright (c) 2009 IETF Trust and the persons identified as the 59 document authors. All rights reserved. 61 This document is subject to BCP 78 and the IETF Trust's Legal 62 Provisions Relating to IETF Documents 63 (http://trustee.ietf.org/license-info) in effect on the date of 64 publication of this document. Please review these documents 65 carefully, as they describe your rights and restrictions with 66 respect to this document. 68 Abstract 70 The secure authentication mechanism most widely deployed and used by 71 Internet application protocols is the transmission of clear-text 72 passwords over a channel protected by Transport Layer Security 73 (TLS). There are some significant security concerns with that 74 mechanism, which could be addressed by the use of a challenge 75 response authentication mechanism protected by TLS. Unfortunately, 76 the challenge response mechanisms presently on the standards track 77 all fail to meet requirements necessary for widespread deployment, 78 and have had success only in limited use. 80 This specification describes an authentication mechanism called the 81 Salted Challenge Response Authentication Mechanism (SCRAM), which 82 addresses the security concerns and meets the deployability 83 requirements. When used in combination with TLS or an equivalent 84 security layer, SCRAM could improve the status-quo for application 85 protocol authentication and provide a suitable choice for a 86 mandatory-to-implement mechanism for future application protocol 87 standards. 89 The purpose of this document is to describe the general SCRAM 90 protocol, and how it is used in the GSS-API environment. Through 91 GS2, this makes the protocol available in the SASL environment as 92 well. 94 Internet-draft March 2009 96 1.0. Conventions Used in This Document 98 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 99 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 100 document are to be interpreted as described in [RFC2119]. 102 Formal syntax is defined by [RFC5234] including the core rules 103 defined in Appendix B of [RFC5234]. 105 Example lines prefaced by "C:" are sent by the client and ones 106 prefaced by "S:" by the server. If a single "C:" or "S:" label 107 applies to multiple lines, then the line breaks between those lines 108 are for editorial clarity only, and are not part of the actual 109 protocol exchange. 111 1.1. Terminology 113 This document uses several terms defined in [RFC4949] ("Internet 114 Security Glossary") including the following: authentication, 115 authentication exchange, authentication information, brute force, 116 challenge-response, cryptographic hash function, dictionary attack, 117 eavesdropping, hash result, keyed hash, man-in-the-middle, nonce, 118 one-way encryption function, password, replay attack and salt. 119 Readers not familiar with these terms should use that glossary as a 120 reference. 122 Some clarifications and additional definitions follow: 124 - Authentication information: Information used to verify an identity 125 claimed by a SCRAM client. The authentication information for a 126 SCRAM identity consists of salt, iteration count, the "StoredKey" 127 and "ServerKey" (as defined in the algorithm overview) for each 128 supported cryptographic hash function. 130 - Authentication database: The database used to look up the 131 authentication information associated with a particular identity. 132 For application protocols, LDAPv3 (see [RFC4510]) is frequently 133 used as the authentication database. For network-level protocols 134 such as PPP or 802.11x, the use of RADIUS is more common. 136 - Base64: An encoding mechanism defined in [RFC4648] which converts 137 an octet string input to a textual output string which can be 138 easily displayed to a human. The use of base64 in SCRAM is 139 restricted to the canonical form with no whitespace. 141 - Octet: An 8-bit byte. 143 Internet-draft March 2009 145 - Octet string: A sequence of 8-bit bytes. 147 - Salt: A random octet string that is combined with a password 148 before applying a one-way encryption function. This value is used 149 to protect passwords that are stored in an authentication 150 database. 152 1.2. Notation 154 The pseudocode description of the algorithm uses the following 155 notations: 157 - ":=": The variable on the left hand side represents the octet 158 string resulting from the expression on the right hand side. 160 - "+": Octet string concatenation. 162 - "[ ]": A portion of an expression enclosed in "[" and "]" may not 163 be included in the result under some circumstances. See the 164 associated text for a description of those circumstances. 166 - HMAC(key, str): Apply the HMAC keyed hash algorithm (defined in 167 [RFC2104]) using the octet string represented by "key" as the key 168 and the octet string "str" as the input string. The size of the 169 result is the hash result size for the hash function in use. For 170 example, it is 20 octets for SHA-1 (see [RFC3174]). 172 - H(str): Apply the cryptographic hash function to the octet string 173 "str", producing an octet string as a result. The size of the 174 result depends on the hash result size for the hash function in 175 use. 177 - XOR: Apply the exclusive-or operation to combine the octet string 178 on the left of this operator with the octet string on the right of 179 this operator. The length of the output and each of the two inputs 180 will be the same for this use. 182 - Hi(str, salt): 184 U0 := HMAC(str, salt + INT(1)) 185 U1 := HMAC(str, U0) 186 U2 := HMAC(str, U1) 187 ... 188 Ui-1 := HMAC(str, Ui-2) 189 Ui := HMAC(str, Ui-1) 191 Hi := U0 XOR U1 XOR U2 XOR ... XOR Ui 193 Internet-draft March 2009 195 where "i" is the iteration count, "+" is the string concatenation 196 operator and INT(g) is a four-octet encoding of the integer g, 197 most significant octet first. 199 This is, essentially, PBKDF2 [RFC2898] with HMAC() as the PRF and 200 with dkLen == output length of HMAC() == output length of H(). 202 2. Introduction 204 This specification describes an authentication mechanism called the 205 Salted Challenge Response Authentication Mechanism (SCRAM) which 206 addresses the requirements necessary to deploy a challenge-response 207 mechanism more widely than past attempts. When used in combination 208 with Transport Layer Security (TLS, see [TLS]) or an equivalent 209 security layer, a mechanism from this family could improve the 210 status-quo for application protocol authentication and provide a 211 suitable choice for a mandatory-to-implement mechanism for future 212 application protocol standards. 214 <> 218 SCRAM provides the following protocol features: 220 - The authentication information stored in the authentication 221 database is not sufficient by itself to impersonate the client. 222 The information is salted to prevent a pre-stored dictionary 223 attack if the database is stolen. 225 - The server does not gain the ability to impersonate the client to 226 other servers (with an exception for server-authorized proxies). 228 - The mechanism permits the use of a server-authorized proxy without 229 requiring that proxy to have super-user rights with the back-end 230 server. 232 - A standard attribute is defined to enable storage of the 233 authentication information in LDAPv3 (see [RFC4510]). 235 - Both the client and server can be authenticated by the protocol. 237 For an in-depth discussion of why other challenge response 238 mechanisms are not considered sufficient, see appendix A. For more 239 information about the motivations behind the design of this 240 mechanism, see appendix B. 242 Internet-draft March 2009 244 Comments regarding this draft may be sent either to the ietf- 245 sasl@imc.org mailing list or to the authors. 247 3. SCRAM Algorithm and Protocol Overview 249 Note that this section omits some details, such as client and server 250 nonces. See Section 5 for more details. 252 To begin with, the client is in possession of a username and 253 password. It sends the username to the server, which retrieves the 254 corresponding authentication information, i.e. a salt, StoredKey, 255 ServerKey and the iteration count i. (Note that a server 256 implementation may chose to use the same iteration count for all 257 account.) The server sends the salt and the iteration count to the 258 client, which then computes the following values and sends a 259 ClientProof to the server: 261 SaltedPassword := Hi(password, salt) 262 ClientKey := H(SaltedPassword) 263 StoredKey := H(ClientKey) 264 AuthMessage := client-first-message + "," + 265 server-first-message + "," + 266 client-final-message-without-proof 267 ClientSignature := HMAC(StoredKey, AuthMessage) 268 ClientProof := ClientKey XOR ClientSignature 269 ServerKey := HMAC(SaltedPassword, salt) 270 ServerSignature := HMAC(ServerKey, AuthMessage) 272 ScramKey := HMAC(ClientKey, AuthMessage) 273 MicKey := HMAC(ScramKey, "SCRAM MIC constant") 274 ClientMic := HMAC(MicKey, client-gs2-to-be-protected) 275 ServerMic := HMAC(MicKey, server-gs2-to-be-protected) 277 The server authenticates the client by computing the 278 ClientSignature, exclusive-ORing that with the ClientProof to 279 recover the ClientKey and verifying the correctness of the ClientKey 280 by applying the hash function and comparing the result to the 281 StoredKey. If the ClientKey is correct, this proves that the client 282 has access to the user's password. 284 Similarly, the client authenticates the server by computing the 285 ServerSignature and comparing it to the value sent by the server. 286 If the two are equal, it proves that the server had access to the 287 user's ServerKey. 289 Once authentication is successful both the client and the server are 290 in possesion of the ClientKey. The ClientKey is used to construct 292 Internet-draft March 2009 294 the shared SCRAM key (ScramKey), which is then used to produce the 295 MicKey. The MicKey is used to verify channel binding and 296 authorization identity by the server, and to confirm that the 297 channel binding information was verified by the client. 299 The AuthMessage is computed by concatenating messages from the 300 authentication exchange. client-gs2-to-be-protected and server- 301 gs2-to-be-protected are also parts of the authentication exchange. 302 The format of these messages is defined in the Formal Syntax 303 section. 305 4. Use of SCRAM in GSS-API and SASL 307 The SCRAM protocol defined in this document is not specific to a 308 particular authentication framework, such as GSS-API, SASL or EAP. 309 The purpose of this section is to describe how the SCRAM protocol is 310 implemented within a particular framework. The focus here is on 311 GSS-API and SASL. If desirable, it may be possible to write similar 312 mappings for other authentication frameworks in the future (e.g., 313 EAP). 315 4.1 Use of SCRAM in GSS-API 317 Context establishment consists of sending and receiving the SCRAM 318 Authentication Exchange protocol. The GSS-API OID allocated for 319 SCRAM is 1.3.6.1.4.1.11591.4.2. The PROT_READY should be set after 320 the authentication exchange completed. When the context has been 321 established, message integrity services through GSS_Wrap/GSS_Unwrap 322 are implemented by using the ClientMic and ServerMic keys derived 323 from the authentication protocol. 325 <> 327 4.2 Use of SCRAM in SASL via GS2. 329 Through GS2, each GSS-API mechanism is supported in SASL. To use 330 SCRAM in SASL, we must derive the SASL mechanism name using the 331 algorithm described in GS2. The DER encoding of the OID is (in hex) 332 06 09 2B 06 01 04 01 DA 47 04 02. The SHA-1 hash is 29 06 29 12 AB 333 25 83 CD 02 92 1B 4E 2D D8 6A 40 CD D0 5D C2. Convert the first ten 334 octets to binary, and re-group them in groups of 5, and convert them 335 back to decimal, which results in these computations: 337 Internet-draft March 2009 339 hex: 340 29 06 29 12 AB 25 83 CD 02 92 342 binary: 343 00101001 00000110 00101001 00010010 10101011 344 00100101 10000011 11001101 00000010 10010010 346 binary in groups of 5: 347 00101 00100 00011 00010 10010 00100 10101 01011 348 00100 10110 00001 11100 11010 00000 10100 10010 350 decimal of each group: 351 5 4 3 2 18 4 21 11 4 22 1 28 26 0 20 18 353 base32 encoding: 354 F E D C S E V L E W B 4 2 A U S 356 The last step translate each decimal value using table 3 in Base32 357 [RFC4648]. Thus the SASL mechanism name for SCRAM is 358 "GS2-FEDCSEVLEWB42AUS". 360 The wire syntax of SCRAM in SASL is described normatively in [GS2], 361 based on the wire format describe above for GSS-API. 363 5. SCRAM Authentication Exchange 365 SCRAM is a text protocol where the client and server exchange 366 messages containing one or more attribute-value pairs separated by 367 commas. Each attribute has a one-letter name. The messages and their 368 attributes are described in section 5.1, and defined in the Formal 369 Syntax section. 371 This is a simple example of a authentication exchange: 372 C: n=Chris Newman,r=ClientNonce[^A] 373 S: r=ClientNonceServerNonce,s=PxR/wv+epq,i=128[^A] 374 C: r=ClientNonceServerNonce,p=WxPv/siO5l+qxN4[^A]mic=<>, 375 d=qop=none 376 S: v=WxPv/siO5l+qxN4[^A]mic=<>,d=qop=none 378 << oidgunk required at the beginning of the first client message? 379 However we can assume GS2 compression as discuss on the mailing list 380 >> 382 <<+cbgood in the last server step implies that the channel binding 383 was verified. But is it optional?>> 385 Internet-draft March 2009 387 With channel bindings this might look like: 389 C: n=Chris Newman,r=ClientNonce[^A] 390 S: r=ClientNonceServerNonce,s=PxR/wv+epq,i=128[^A] 391 C: r=ClientNonceServerNonce,p=WxPv/siO5l+qxN4[^A]mic=<>, 392 d=qop=none,cbqop=none,c=<> 393 S: v=WxPv/siO5l+qxN4[^A]mic=<>,d=qop=none+cbgood 395 Note that [^A] here represents 1 octet with value %x01. 397 <> 399 First, the client sends a message containing the username, and a 400 random, unique nonce. In response, the server sends the user's 401 iteration count i, the user's salt, and appends its own nonce to the 402 client-specified one. The client then responds with the same nonce 403 and a ClientProof computed using the selected hash function as 404 explained earlier. In this step the client can also include an 405 optional authorization identity. <>. <> 412 If the two are different, the client MUST consider the 413 authentication exchange to be unsuccessful and it might have to drop 414 the connection. 416 5.1 SCRAM attributes 418 This section describes the permissible attributes, their use, and 419 the format of their values. All attribute names are single US-ASCII 420 letters and are case-sensitive. 422 - a: This optional attribute specifies an authorization identity. A 423 client may include it in its second message to the server if it 424 wants to authenticate as one user, but subsequently act as a 425 different user. This is typically used by an administrator to 426 perform some management task on behalf of another user, or by a 427 proxy in some situations (<>). 429 Upon the receipt of this value the server verifies its correctness 430 and makes the authorization decision. Failed verification results 431 in failed authentication exchange. 433 Internet-draft March 2009 435 If this attribute is omitted (as it normally would be), or 436 specified with an empty value, the authorization identity is 437 assumed to be derived from the username specified with the 438 (required) "n" attribute. 440 The server always authenticates the user specified by the "n" 441 attribute. If the "a" attribute specifies a different user, the 442 server associates that identity with the connection after 443 successful authentication and authorization checks. 445 The syntax of this field is the same as that of the "n" field with 446 respect to quoting of %x01, '=' and ','. 448 - n: This attribute specifies the name of the user whose password is 449 used for authentication. A client must include it in its first 450 message to the server. If the "a" attribute is not specified 451 (which would normally be the case), this username is also the 452 identity which will be associated with the connection subsequent 453 to authentication and authorization. 455 Before sending the username to the server, the client MUST prepare 456 the username using the "SASLPrep" profile [SASLPrep] of the 457 "stringprep" algorithm [RFC3454]. If the preparation of the 458 username fails or results in an empty string, the client SHOULD 459 abort the authentication exchange (*). 461 (*) An interactive client can request a repeated entry of the 462 username value. 464 Upon receipt of the username by the server, the server SHOULD 465 prepare it using the "SASLPrep" profile [SASLPrep] of the 466 "stringprep" algorithm [RFC3454]. If the preparation of the 467 username fails or results in an empty string, the server SHOULD 468 abort the authentication exchange. 470 The characters %x01, ',' or '=' in usernames are sent as '=01', 471 '=2C' and '=3D' respectively. If the server receives a username 472 which contains '=' not followed by either '01', '2C' or '3D', then 473 the server MUST fail the authentication. 475 - m: This attribute is reserved for future extensibility. In this 476 version of SCRAM, its presence in a client or a server message 477 MUST cause authentication failure when the attribute is parsed by 478 the other end. 480 - r: This attribute specifies a sequence of random printable 481 characters excluding ',' which forms the nonce used as input to 482 the hash function. No quoting is applied to this string (unless 484 Internet-draft March 2009 486 the binding of SCRAM to a particular protocol states otherwise). 487 As described earlier, the client supplies an initial value in its 488 first message, and the server augments that value with its own 489 nonce in its first response. It is important that this be value 490 different for each authentication. The client MUST verify that the 491 initial part of the nonce used in subsequent messages is the same 492 as the nonce it initially specified. The server MUST verify that 493 the nonce sent by the client in the second message is the same as 494 the one sent by the server in its first message. 496 - c: This optional attribute specifies base64-encoded channel- 497 binding data. It is sent by the client in the second step. If 498 specified by the client, if the server supports the specified 499 channel binding type and if the server can't verify it, then the 500 server MUST fail the authentication exchange. Whether this 501 attribute is included, and the meaning and contents of the 502 channel-binding data depends on the external security layer in 503 use. This is necessary to detect a man-in-the-middle attack on the 504 security layer. 506 - s: This attribute specifies the base64-encoded salt used by the 507 server for this user. It is sent by the server in its first 508 message to the client. 510 - i: This attribute specifies an iteration count for the selected 511 hash function and user, and must be sent by the server along with 512 the user's salt. 514 Servers SHOULD announce a hash iteration-count of at least 128. 516 - p: This attribute specifies a base64-encoded ClientProof. The 517 client computes this value as described in the overview and sends 518 it to the server. 520 - v: This attribute specifies a base64-encoded ServerSignature. It 521 is sent by the server in its final message, and may be used by the 522 client to verify that the server has access to the user's 523 authentication information. This value is computed as explained in 524 the overview. 526 6. Formal Syntax 528 The following syntax specification uses the Augmented Backus-Naur 529 Form (ABNF) notation as specified in [RFC5234]. "UTF8-2", "UTF8-3" 530 and "UTF8-4" non-terminal are defined in [UTF-8]. 532 attr-val = ALPHA "=" value 534 Internet-draft March 2009 536 value = *(value-char) 538 value-safe-char = %02-2B / %2D-3C / %3E-7F / 539 UTF8-2 / UTF-3 / UTF8-4 540 ;; UTF8-char except NUL, %x01 (CTRL+A), "=", 541 ;; and ",". 543 value-char = value-safe-char / "=" 545 base64-char = ALPHA / DIGIT / "/" / "+" 547 base64-4 = 4*4(base64-char) 549 base64-3 = 3*3(base64-char) "=" 551 base64-2 = 2*2(base64-char) "==" 553 base64 = *(base64-4) [base64-3 / base64-2] 555 posit-number = (%x31-39) *DIGIT 556 ;; A positive number 558 saslname = 1*(value-safe-char / "=01" / "=2C" / "=3D") 559 ;; Conforms to 561 authzid = "a=" saslname 562 ;; Protocol specific. 564 username = "n=" saslname 565 ;; Usernames are prepared using SASLPrep. 567 reserved-mext = "m=" 1*(value-char) 568 ;; Reserved for signalling mandatory extensions. 569 ;; The exact syntax will be defined in 570 ;; the future. 572 channel-binding = "c=" base64 574 proof = "p=" base64 576 nonce = "r=" c-nonce [s-nonce] 577 ;; Second part provided by server. 579 c-nonce = value 581 s-nonce = value 583 salt = "s=" base64 585 Internet-draft March 2009 587 verifier = "v=" base64 588 ;; base-64 encoded ServerSignature. 590 iteration-count = "i=" posit-number 592 delim = %x01 594 client-first-message = 595 scram-client-first-message delim 597 server-first-message = 598 scram-server-first-message delim 600 client-final-message = 601 scram-client-final-message-without-proof "," 602 proof delim 603 gss-mic client-gss-wrap 604 ;; <> 606 server-final-message = 607 scram-server-final-message delim 608 gss-mic server-gss-wrap 609 ;; <> 611 gss-mic = "mic=" base64 "," 612 ;; base-64 encoding of ClientMic 613 ;; for the client and ServerMic 614 ;; for the server 616 client-gss-wrap = "d=" client-gs2-to-be-protected 617 ;; A particular case of 619 client-gs2-to-be-protected = "qop=none" [",cbqop=none," channel- 620 binding] 621 ["," authzid] 622 ;; A particular case of 624 server-gss-wrap = "d=" server-gs2-to-be-protected 625 ;; A particular case of 627 server-gs2-to-be-protected = "qop=none" [ "+cbgood" ] 628 ;; A particular case of 629 ;; Note that "+cbgood" is included if 630 ;; channel binding verification succeeded. 632 gss-wrap = "d=" gs2-to-be-protected 634 Internet-draft March 2009 636 gs2-to-be-protected = qop ["," maxbuf] 637 ["," cbqop "," channel-binding] ["," authzid] 638 ;; <> 642 qop = "qop=" qopvalue *( "+" qopvalue) 644 qopvalue = "none" ; no security layer 645 / "integ" ; integrity protection 646 / "conf" ; confidentiality protection 647 / "cbgood" ; channel binding validated 648 ; (server to client) 650 maxbuf = "maxbuf=" posit-number 652 cbqop = "cbqop=" qopvalue *( "+" qopvalue) 653 ;; QOPs that can be used if channel binding 654 ;; succeeds 656 scram-client-first-message = 657 [reserved-mext ","] username "," nonce 658 ["," extensions] 660 scram-server-first-message = 661 [reserved-mext ","] nonce "," salt "," 662 iteration-count ["," extensions] 664 scram-client-final-message-without-proof = 665 nonce ["," extensions] 666 ;; <> 670 scram-server-final-message = 671 verifier ["," extensions] 673 extensions = attr-val *("," attr-val) 674 ;; All extensions are optional, 675 ;; i.e. unrecognized attributes 676 ;; not defined in this document 677 ;; MUST be ignored. 679 Internet-draft March 2009 681 7. Security Considerations 683 If the authentication exchange is performed without a strong 684 security layer, then a passive eavesdropper can gain sufficient 685 information to mount an offline dictionary or brute-force attack 686 which can be used to recover the user's password. The amount of time 687 necessary for this attack depends on the cryptographic hash function 688 selected, the strength of the password and the iteration count 689 supplied by the server. An external security layer with strong 690 encryption will prevent this attack. 692 If the external security layer used to protect the SCRAM exchange 693 uses an anonymous key exchange, then the SCRAM channel binding 694 mechanism can be used to detect a man-in-the-middle attack on the 695 security layer and cause the authentication to fail as a result. 696 However, the man-in-the-middle attacker will have gained sufficient 697 information to mount an offline dictionary or brute-force attack. 698 For this reason, SCRAM includes the ability to increase the 699 iteration count over time. 701 If the authentication information is stolen from the authentication 702 database, then an offline dictionary or brute-force attack can be 703 used to recover the user's password. The use of salt mitigates this 704 attack somewhat by requiring a separate attack on each password. 705 Authentication mechanisms which protect against this attack are 706 available (e.g., the EKE class of mechanisms), but the patent 707 situation is presently unclear. 709 If an attacker obtains the authentication information from the 710 authentication repository and either eavesdrops on one 711 authentication exchange or impersonates a server, the attacker gains 712 the ability to impersonate that user to all servers providing SCRAM 713 access using the same hash function, password, iteration count and 714 salt. For this reason, it is important to use randomly-generated 715 salt values. 717 If the server detects (from the value of the client-specified "h" 718 attribute) that both endpoints support a stronger hash function that 719 the one the client actually chooses to use, then it SHOULD treat 720 this as a downgrade attack and reject the authentication attempt. 722 A hostile server can perform a computational denial-of-service 723 attack on clients by sending a big iteration count value. 725 Internet-draft March 2009 727 8. IANA considerations 729 None. 731 9. Acknowedgements 733 The authors would like to thank Dave Cridland for his contributions 734 to this document. 736 10. Normative References 738 [RFC4648] Josefsson, "The Base16, Base32, and Base64 Data 739 Encodings", RFC 4648, SJD, October 2006. 741 [UTF-8] Yergeau, F., "UTF-8, a transformation format of ISO 742 10646", STD 63, RFC 3629, November 2003. 744 [RFC2104] Krawczyk, Bellare, Canetti, "HMAC: Keyed-Hashing for 745 Message Authentication", IBM, February 1997. 747 [RFC2119] Bradner, "Key words for use in RFCs to Indicate 748 Requirement Levels", RFC 2119, Harvard University, March 749 1997. 751 [RFC3174] Eastlake, Jones, "US Secure Hash Algorithm 1 (SHA1)", RFC 752 3174, Motorola, September 2001 754 [RFC5234] Crocker, Overell, "Augmented BNF for Syntax 755 Specifications: ABNF", RFC 5234, January 2008. 757 [RFC4422] Melnikov, Zeilenga, "Simple Authentication and Security 758 Layer (SASL)", RFC 4422, Isode Limited, June 2006. 760 [SASLPrep] Zeilenga, K., "SASLprep: Stringprep profile for user 761 names and passwords", RFC 4013, February 2005. 763 [RFC3454] Hoffman, P., Blanchet, M., "Preparation of 764 Internationalized Strings ("stringprep")", RFC 3454, 765 December 2002. 767 [SASL-GS2] Josefsson, S., "Using GSS-API Mechanisms in SASL: The GS2 768 Mechanism Family", work in progress, draft-ietf-sasl- 769 gs2-10.txt, July 2008. <> 772 Internet-draft March 2009 774 11. Informative References 776 [RFC2195] Klensin, Catoe, Krumviede, "IMAP/POP AUTHorize Extension 777 for Simple Challenge/Response", RFC 2195, MCI, September 778 1997. 780 [RFC2202] Cheng, Glenn, "Test Cases for HMAC-MD5 and HMAC-SHA-1", 781 RFC 2202, IBM, September 1997 783 [RFC2898] Kaliski, B., "PKCS #5: Password-Based Cryptography 784 Specification Version 2.0", RFC 2898, September 2000. 786 [TLS] Dierks, Rescorla, "The Transport Layer Security (TLS) 787 Protocol, Version 1.2", RFC 5246, August 2008. 789 [RFC4949] Shirey, "Internet Security Glossary, Version 2", RFC 790 4949, FYI 0036, August 2007. 792 [RFC4086] Eastlake, Schiller, Crocker, "Randomness Requirements for 793 Security", RFC 4086, BCP 0106, Motorola Laboratories, 794 June 2005. 796 [RFC4510] Zeilenga, "Lightweight Directory Access Protocol (LDAP): 797 Technical Specification Road Map", RFC 4510, June 2006. 799 [DIGEST-MD5] Leach, P. and C. Newman , "Using Digest Authentication 800 as a SASL Mechanism", RFC 2831, May 2000. <> 803 [DIGEST-HISTORIC] Melnikov, "Moving DIGEST-MD5 to Historic", work in 804 progress, draft-ietf-sasl-digest-to-historic-00.txt, July 805 2008 807 [CRAM-HISTORIC] Zeilenga, "CRAM-MD5 to Historic", work in progress, 808 draft-ietf-sasl-crammd5-to-historic-00.txt, November 809 2008. 811 [PLAIN] Zeilenga, "The PLAIN Simple Authentication and Security 812 Layer (SASL) Mechanism" RFC 4616, August 2006. 814 12. Authors' Addresses 816 Abhijit Menon-Sen 817 Oryx Mail Systems GmbH 819 Email: ams@oryx.com 821 Internet-draft March 2009 823 Alexey Melnikov 824 Isode Ltd 826 EMail: Alexey.Melnikov@isode.com 828 Chris Newman 829 Sun Microsystems 830 1050 Lakes Drive 831 West Covina, CA 91790 832 USA 834 Email: chris.newman@sun.com 836 Simon Josefsson 837 Email: simon@josefsson.org 839 Appendix A: Other Authentication Mechanisms 841 The DIGEST-MD5 [DIGEST-MD5] mechanism has proved to be too complex 842 to implement and test, and thus has poor interoperability. The 843 security layer is often not implemented, and almost never used; 844 everyone uses TLS instead. For a more complete list of problems 845 with DIGEST-MD5 which lead to the creation of SCRAM see [DIGEST- 846 HISTORIC]. 848 The CRAM-MD5 SASL mechanism, while widely deployed has also some 849 problems, in particular it is missing some modern SASL features such 850 as support for internationalized usernames and passwords, support 851 for passing of authorization identity, support for channel bindings. 852 It also doesn't support server authentication. For a more complete 853 list of problems with CRAM-MD5 see [CRAM-HISTORIC]. 855 The PLAIN [PLAIN] SASL mechanism allows a malicious server or 856 eavesdropper to impersonate the authenticating user to any other 857 server for which the user has the same password. It also sends the 858 password in the clear over the network, unless TLS is used. Server 859 authentication is not supported. 861 Appendix B: Design Motivations 863 The following design goals shaped this document. Note that some of 864 the goals have changed since the initial version of the document. 866 The SASL mechanism has all modern SASL features: support for 868 Internet-draft March 2009 870 internationalized usernames and passwords, support for passing of 871 authorization identity, support for channel bindings. 873 Both the client and server can be authenticated by the protocol. 875 The authentication information stored in the authentication 876 database is not sufficient by itself to impersonate the client. 878 <> 882 The mechanism is extensible, but [hopefully] not overengineered in 883 this respect. 885 Easier to implement than DIGEST-MD5 in both clients and servers. 887 On the wire compatibility with GS2 [SASL-GS2]. 889 Appendix C: SCRAM Examples 891 <> 893 Internet-draft March 2009 895 (RFC Editor: Please delete everything after this point) 897 Open Issues 899 - The appendices need to be written. 901 - Should the server send a base64-encoded ServerSignature for the 902 value of the "v" attribute, or should it compute a ServerProof the 903 way the client computes a ClientProof?