idnits 2.17.1 draft-ietf-httpauth-scram-auth-05.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 are 4 instances of too long lines in the document, the longest one being 8 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 (March 7, 2015) is 3337 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Unused Reference: 'RFC5056' is defined on line 669, but no explicit reference was found in the text == Unused Reference: 'RFC5929' is defined on line 679, but no explicit reference was found in the text == Unused Reference: 'RFC4616' is defined on line 704, but no explicit reference was found in the text == Unused Reference: 'RFC5226' is defined on line 710, but no explicit reference was found in the text == Outdated reference: A later version (-05) exists of draft-ietf-httpbis-auth-info-03 ** Downref: Normative reference to an Informational RFC: RFC 2104 ** Downref: Normative reference to an Informational RFC: RFC 3174 ** Obsolete normative reference: RFC 3454 (Obsoleted by RFC 7564) ** Obsolete normative reference: RFC 4013 (Obsoleted by RFC 7613) ** Obsolete normative reference: RFC 7235 (Obsoleted by RFC 9110) -- Obsolete informational reference (is this intentional?): RFC 2898 (Obsoleted by RFC 8018) -- Obsolete informational reference (is this intentional?): RFC 5226 (Obsoleted by RFC 8126) -- Obsolete informational reference (is this intentional?): RFC 5246 (Obsoleted by RFC 8446) Summary: 6 errors (**), 0 flaws (~~), 6 warnings (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 HTTPAUTH A. Melnikov 3 Internet-Draft Isode Ltd 4 Intended status: Standards Track March 7, 2015 5 Expires: September 8, 2015 7 Salted Challenge Response (SCRAM) HTTP Authentication Mechanism 8 draft-ietf-httpauth-scram-auth-05.txt 10 Abstract 12 The secure authentication mechanism most widely deployed and used by 13 Internet application protocols is the transmission of clear-text 14 passwords over a channel protected by Transport Layer Security (TLS). 15 There are some significant security concerns with that mechanism, 16 which could be addressed by the use of a challenge response 17 authentication mechanism protected by TLS. Unfortunately, the HTTP 18 Digest challenge response mechanism presently on the standards track 19 failed widespread deployment, and have had success only in limited 20 use. 22 This specification describes a family of HTTP authentication 23 mechanisms called the Salted Challenge Response Authentication 24 Mechanism (SCRAM), which addresses security concerns with HTTP Digest 25 and meets the deployability requirements. When used in combination 26 with TLS or an equivalent security layer, a mechanism from this 27 family could improve the status-quo for HTTP authentication. 29 Status of This Memo 31 This Internet-Draft is submitted in full conformance with the 32 provisions of BCP 78 and BCP 79. 34 Internet-Drafts are working documents of the Internet Engineering 35 Task Force (IETF). Note that other groups may also distribute 36 working documents as Internet-Drafts. The list of current Internet- 37 Drafts is at http://datatracker.ietf.org/drafts/current/. 39 Internet-Drafts are draft documents valid for a maximum of six months 40 and may be updated, replaced, or obsoleted by other documents at any 41 time. It is inappropriate to use Internet-Drafts as reference 42 material or to cite them other than as "work in progress." 44 This Internet-Draft will expire on September 8, 2015. 46 Copyright Notice 48 Copyright (c) 2015 IETF Trust and the persons identified as the 49 document authors. All rights reserved. 51 This document is subject to BCP 78 and the IETF Trust's Legal 52 Provisions Relating to IETF Documents 53 (http://trustee.ietf.org/license-info) in effect on the date of 54 publication of this document. Please review these documents 55 carefully, as they describe your rights and restrictions with respect 56 to this document. Code Components extracted from this document must 57 include Simplified BSD License text as described in Section 4.e of 58 the Trust Legal Provisions and are provided without warranty as 59 described in the Simplified BSD License. 61 Table of Contents 63 1. Conventions Used in This Document . . . . . . . . . . . . . . 2 64 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . . 3 65 1.2. Notation . . . . . . . . . . . . . . . . . . . . . . . . . 4 66 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 5 67 3. SCRAM Algorithm Overview . . . . . . . . . . . . . . . . . . 6 68 4. SCRAM Mechanism Names . . . . . . . . . . . . . . . . . . . . 7 69 5. SCRAM Authentication Exchange . . . . . . . . . . . . . . . . 7 70 5.1. One round trip reauthentication . . . . . . . . . . . . . . 10 71 6. Use of Authentication-Info header field with SCRAM . . . . . 11 72 7. Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . . 11 73 8. Security Considerations . . . . . . . . . . . . . . . . . . . 12 74 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 13 75 10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 14 76 11. Design Motivations . . . . . . . . . . . . . . . . . . . . . 14 77 12. Open Issues . . . . . . . . . . . . . . . . . . . . . . . . . 15 78 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 15 79 13.1. Normative References . . . . . . . . . . . . . . . . . . . 15 80 13.2. Informative References . . . . . . . . . . . . . . . . . . 16 81 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 17 83 1. Conventions Used in This Document 85 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 86 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 87 document are to be interpreted as described in [RFC2119]. 89 Formal syntax is defined by [RFC5234] including the core rules 90 defined in Appendix B of [RFC5234]. 92 Example lines prefaced by "C:" are sent by the client and ones 93 prefaced by "S:" by the server. If a single "C:" or "S:" label 94 applies to multiple lines, then the line breaks between those lines 95 are for editorial clarity only, and are not part of the actual 96 protocol exchange. 98 1.1. Terminology 100 This document uses several terms defined in [RFC4949] ("Internet 101 Security Glossary") including the following: authentication, 102 authentication exchange, authentication information, brute force, 103 challenge-response, cryptographic hash function, dictionary attack, 104 eavesdropping, hash result, keyed hash, man-in-the-middle, nonce, 105 one-way encryption function, password, replay attack and salt. 106 Readers not familiar with these terms should use that glossary as a 107 reference. 109 Some clarifications and additional definitions follow: 111 o Authentication information: Information used to verify an identity 112 claimed by a SCRAM client. The authentication information for a 113 SCRAM identity consists of salt, iteration count, the "StoredKey" 114 and "ServerKey" (as defined in the algorithm overview) for each 115 supported cryptographic hash function. 117 o Authentication database: The database used to look up the 118 authentication information associated with a particular identity. 119 For application protocols, LDAPv3 (see [RFC4510]) is frequently 120 used as the authentication database. For network-level protocols 121 such as PPP or 802.11x, the use of RADIUS [RFC2865] is more 122 common. 124 o Base64: An encoding mechanism defined in [RFC4648] which converts 125 an octet string input to a textual output string which can be 126 easily displayed to a human. The use of base64 in SCRAM is 127 restricted to the canonical form with no whitespace. 129 o Octet: An 8-bit byte. 131 o Octet string: A sequence of 8-bit bytes. 133 o Salt: A random octet string that is combined with a password 134 before applying a one-way encryption function. This value is used 135 to protect passwords that are stored in an authentication 136 database. 138 1.2. Notation 140 The pseudocode description of the algorithm uses the following 141 notations: 143 o ":=": The variable on the left hand side represents the octet 144 string resulting from the expression on the right hand side. 146 o "+": Octet string concatenation. 148 o "[ ]": A portion of an expression enclosed in "[" and "]" may not 149 be included in the result under some circumstances. See the 150 associated text for a description of those circumstances. 152 o Normalize(str): Apply the SASLPrep profile [RFC4013] of the 153 "stringprep" algorithm [RFC3454] as the normalization algorithm to 154 a UTF-8 [RFC3629] encoded "str". The resulting string is also in 155 UTF-8. When applying SASLPrep, "str" is treated as a "stored 156 strings", which means that unassigned Unicode codepoints are 157 prohibited (see Section 7 of [RFC3454]). Note that 158 implementations MUST either implement SASLPrep, or disallow use of 159 non US-ASCII Unicode codepoints in "str". 161 o HMAC(key, str): Apply the HMAC keyed hash algorithm (defined in 162 [RFC2104]) using the octet string represented by "key" as the key 163 and the octet string "str" as the input string. The size of the 164 result is the hash result size for the hash function in use. For 165 example, it is 20 octets for SHA-1 (see [RFC3174]). 167 o H(str): Apply the cryptographic hash function to the octet string 168 "str", producing an octet string as a result. The size of the 169 result depends on the hash result size for the hash function in 170 use. 172 o XOR: Apply the exclusive-or operation to combine the octet string 173 on the left of this operator with the octet string on the right of 174 this operator. The length of the output and each of the two 175 inputs will be the same for this use. 177 o Hi(str, salt, i): 179 U1 := HMAC(str, salt + INT(1)) 180 U2 := HMAC(str, U1) 181 ... 182 Ui-1 := HMAC(str, Ui-2) 183 Ui := HMAC(str, Ui-1) 185 Hi := U1 XOR U2 XOR ... XOR Ui 187 where "i" is the iteration count, "+" is the string concatenation 188 operator and INT(g) is a four-octet encoding of the integer g, 189 most significant octet first. 191 Hi() is, essentially, PBKDF2 [RFC2898] with HMAC() as the PRF and 192 with dkLen == output length of HMAC() == output length of H(). 194 2. Introduction 196 This specification describes a family of authentication mechanisms 197 called the Salted Challenge Response Authentication Mechanism (SCRAM) 198 which addresses the requirements necessary to deploy a challenge- 199 response mechanism more widely than past attempts (see [RFC5802]). 200 When used in combination with Transport Layer Security (TLS, see 201 [RFC5246]) or an equivalent security layer, a mechanism from this 202 family could improve the status-quo for HTTP authentication. 204 HTTP SCRAM is adoptation of [RFC5802] for use in HTTP. (SCRAM data 205 exchanged is identical to what is defined in [RFC5802].) It also 206 adds 1 round trip reauthentication mode. 208 HTTP SCRAM provides the following protocol features: 210 o The authentication information stored in the authentication 211 database is not sufficient by itself (without a dictionary attack) 212 to impersonate the client. The information is salted to prevent a 213 pre-stored dictionary attack if the database is stolen. 215 o The server does not gain the ability to impersonate the client to 216 other servers (with an exception for server-authorized proxies). 218 o The mechanism permits the use of a server-authorized proxy without 219 requiring that proxy to have super-user rights with the back-end 220 server. 222 o Mutual authentication is supported, but only the client is named 223 (i.e., the server has no name). 225 3. SCRAM Algorithm Overview 227 The following is a description of a full HTTP SCRAM authentication 228 exchange. Note that this section omits some details, such as client 229 and server nonces. See Section 5 for more details. 231 To begin with, the SCRAM client is in possession of a username and 232 password (*) (or a ClientKey/ServerKey, or SaltedPassword). It sends 233 the username to the server, which retrieves the corresponding 234 authentication information, i.e. a salt, StoredKey, ServerKey and the 235 iteration count i. (Note that a server implementation may choose to 236 use the same iteration count for all accounts.) The server sends the 237 salt and the iteration count to the client, which then computes the 238 following values and sends a ClientProof to the server: 240 (*) - Note that both the username and the password MUST be encoded in 241 UTF-8 [RFC3629]. 243 Informative Note: Implementors are encouraged to create test cases 244 that use both username passwords with non-ASCII codepoints. In 245 particular, it's useful to test codepoints whose "Unicode 246 Normalization Form C" and "Unicode Normalization Form KC" are 247 different. Some examples of such codepoints include Vulgar Fraction 248 One Half (U+00BD) and Acute Accent (U+00B4). 250 SaltedPassword := Hi(Normalize(password), salt, i) 251 ClientKey := HMAC(SaltedPassword, "Client Key") 252 StoredKey := H(ClientKey) 253 AuthMessage := client-first-message-bare + "," + 254 server-first-message + "," + 255 client-final-message-without-proof 256 ClientSignature := HMAC(StoredKey, AuthMessage) 257 ClientProof := ClientKey XOR ClientSignature 258 ServerKey := HMAC(SaltedPassword, "Server Key") 259 ServerSignature := HMAC(ServerKey, AuthMessage) 261 The server authenticates the client by computing the ClientSignature, 262 exclusive-ORing that with the ClientProof to recover the ClientKey 263 and verifying the correctness of the ClientKey by applying the hash 264 function and comparing the result to the StoredKey. If the ClientKey 265 is correct, this proves that the client has access to the user's 266 password. 268 Similarly, the client authenticates the server by computing the 269 ServerSignature and comparing it to the value sent by the server. If 270 the two are equal, it proves that the server had access to the user's 271 ServerKey. 273 For initial authentication the AuthMessage is computed by 274 concatenating decoded "data" attribute values from the authentication 275 exchange. The format of these messages is defined in [RFC5802]. 277 4. SCRAM Mechanism Names 279 A SCRAM mechanism name (authentication scheme) is a string "SCRAM-" 280 followed by the uppercased name of the underlying hash function taken 281 from the IANA "Hash Function Textual Names" registry (see 282 http://www.iana.org) . 284 For interoperability, all HTTP clients and servers supporting SCRAM 285 MUST implement the SCRAM-SHA-1 authentication mechanism, [[CREF1: 286 OPEN ISSUE: Possibly switch to SHA-256 as the mandatory-to- 287 implement.]] i.e. an authentication mechanism from the SCRAM family 288 that uses the SHA-1 hash function as defined in [RFC3174]. 290 5. SCRAM Authentication Exchange 292 HTTP SCRAM is a HTTP Authentication mechanism whose client response 293 () and server challenge () 294 messages are text-based messages containing one or more attribute- 295 value pairs separated by commas. The messages and their attributes 296 are described below and defined in Section 7. 298 challenge-scram = scram-name [1*SP 1#auth-param] 299 ; Complies with ABNF from RFC 7235. 300 ; Included in the WWW-Authenticate header field. 302 credentials-scram = scram-name [1*SP 1#auth-param] 303 ; Complies with from RFC 7235. 304 ; Included in the Authorization header field. 306 scram-name = "SCRAM-SHA-1" / other-scram-name 307 ; SCRAM-SHA-1 is registered by this RFC 308 other-scram-name = "SCRAM-" hash-name 309 ; hash-name is a capitalized form of names from IANA 310 ; "Hash Function Textual Names" registry. 311 ; Additional SCRAM names must be registered in both 312 ; the IANA "SASL mechanisms" registry 313 ; and the IANA "authentication scheme" registry. 315 This is a simple example of a SCRAM-SHA-1 authentication exchange (no 316 support for channel bindings, as this feature is not currently 317 supported by HTTP). In the example base64 encoded data is denoted by 318 'base64(...)' convention. Username 'user' and password 'pencil' are 319 used. 321 C: GET /resource HTTP/1.1 322 C: Host: server.example.com 323 C: [...] 325 S: HTTP/1.1 401 Unauthorized 326 S: WWW-Authenticate: Digest realm="realm1@host.com", 327 Digest realm="realm2@host.com", 328 Digest realm="realm3@host.com", 329 SCRAM-SHA-1 realm="realm3@host.com", 330 SCRAM-SHA-1 realm="testrealm@host.com" 331 S: [...] 333 C: GET /resource HTTP/1.1 334 C: Host: server.example.com 335 C: Authorization: SCRAM-SHA-1 realm="testrealm@host.com", 336 data=base64(n,,n=user,r=fyko+d2lbbFgONRv9qkxdawL) 337 C: [...] 339 S: HTTP/1.1 401 Unauthorized 340 S: WWW-Authenticate: SCRAM-SHA-1 341 sid=AAAABBBBCCCCDDDD, 342 data=base64(r=fyko+d2lbbFgONRv9qkxdawL3rfcNHYJY1ZVvWVs7j, 343 s=QSXCR+Q6sek8bf92,i=4096) 344 S: [...] 346 C: GET /resource HTTP/1.1 347 C: Host: server.example.com 348 C: Authorization: SCRAM-SHA-1 sid=AAAABBBBCCCCDDDD, 349 data=base64(c=biws,r=fyko+d2lbbFgONRv9qkxdawL3rfcNHYJY1ZVvWVs7j, 350 p=v0X8v3Bz2T0CJGbJQyF0X+HI4Ts=) 351 C: [...] 353 S: HTTP/1.1 200 Ok 354 S: Authentication-Info: sid=AAAABBBBCCCCDDDD, 355 data=base64(v=rmF9pqV8S7suAoZWja4dJRkFsKQ=) 356 S: [...Other header fields and resource body...] 358 Note that in the example above the client can also initiate SCRAM 359 authentication without first being prompted by the server. 361 Initial "SCRAM-SHA-1" authentication starts with sending the 362 "Authorization" request header field defined by HTTP/1.1, Part 7 364 [RFC7235] containing "SCRAM-SHA-1" authentication scheme and the 365 following attributes: 367 o A "realm" attribute MAY be included to indicate the scope of 368 protection in the manner described in HTTP/1.1, Part 7 [RFC7235]. 369 As specified in [RFC7235], the "realm" attribute MUST NOT appear 370 more than once. The realm attribute only appears in the first 371 SCRAM message to the server and in the first SCRAM response from 372 the server. 374 o The client also includes the data attribute that contains base64 375 encoded "client-first-message" [RFC5802] containing: 377 * a header consisting of a flag indicating whether channel 378 binding is supported-but-not-used, not supported, or used . 379 Note that the header always starts with "n", "y" or "p", 380 otherwise the message is invalid and authentication MUST fail. 382 * SCRAM username and a random, unique nonce attributes. 384 In HTTP response, the server sends WWW-Authenticate header field 385 containing: a unique session identifier (the "sid" attribute) plus 386 the "data" attribute containing base64-encoded "server-first-message" 387 [RFC5802]. The "server-first-message" contains the user's iteration 388 count i, the user's salt, and the nonce with a concatenation of the 389 client-specified one with a server nonce. [[CREF2: OPEN ISSUE: 390 Alternatively, the "sid" attribute can be another header field.]] 392 The client then responds with another HTTP request with the 393 Authorization header field, which includes the "sid" attribute 394 received in the previous server response, together with the "data" 395 attribute containing base64-encoded "client-final-message" data. The 396 latter has the same nonce and a ClientProof computed using the 397 selected hash function (e.g. SHA-1) as explained earlier. 399 The server verifies the nonce and the proof, and, finally, it 400 responds with a 200 HTTP response with the Authentication-Info header 401 field [I-D.ietf-httpbis-auth-info] containing the "data" attribute 402 containing base64-encoded "server-final-message", concluding the 403 authentication exchange. 405 The client then authenticates the server by computing the 406 ServerSignature and comparing it to the value sent by the server. If 407 the two are different, the client MUST consider the authentication 408 exchange to be unsuccessful and it might have to drop the connection. 410 5.1. One round trip reauthentication 412 If the server supports SCRAM reauthentication, the server sends in 413 its initial HTTP response a WWW-Authenticate header field containing: 414 the "realm" attribute (as defined earlier), the "sr" attribute that 415 contains the server part of the "r" attribute (see [RFC5802] and 416 optional "ttl" attribute (which contains the "sr" value validity in 417 seconds). 419 If the client has authenticated to the same realm before (i.e. it 420 remembers "i" and "s" attributes for the user from earlies 421 authentication exchanges with the server), it can respond to that 422 with "client-final-message". [[CREF3: Should some counter be added 423 to make "sr" unique for each reauth?]] 425 If the server considers the server part of the nonce (the "r" 426 attribute) to be still valid, it will provide access to the requested 427 resource (assuming the client hash verifies correctly, of course). 428 However if the server considers that the server part of the nonce is 429 stale (for example if the "sr" value is used after the "ttl" 430 seconds), the server returns "401 Unauthorized" containing the SCRAM 431 mechanism name with a new "sr" and optional "ttl" attributes. 432 [[CREF4: Do we also need the "stale" attribute, like the one used by 433 DIGEST?]] 435 When constructing AuthMessage Section 3 to be used for calculating 436 client and server proofs, "client-first-message-bare" and "server- 437 first-message" are reconstructed from data known to the client and 438 the server. 440 Reauthentication can look like this: 442 C: GET /resource HTTP/1.1 443 C: Host: server.example.com 444 C: [...] 446 S: HTTP/1.1 401 Unauthorized 447 S: WWW-Authenticate: Digest realm="realm1@host.com", 448 Digest realm="realm2@host.com", 449 Digest realm="realm3@host.com", 450 SCRAM-SHA-1 realm="realm3@host.com", 451 SCRAM-SHA-1 realm="testrealm@host.com", sr=3rfcNHYJY1ZVvWVs7j 452 SCRAM-SHA-1 realm="testrealm2@host.com", sr=AAABBBCCCDDD, ttl=120 453 S: [...] 455 [Client authenticates as usual to realm "testrealm@host.com"] 457 [Some time later client decides to reauthenticate. 458 It will use the cached "i" and "s" from earlies exchanges. 459 It will use the server advertised "sr" value as the server part of the "r".] 461 C: GET /resource HTTP/1.1 462 C: Host: server.example.com 463 C: Authorization: SCRAM-SHA-1 realm="testrealm@host.com", 464 data=base64(c=biws,r=fyko+d2lbbFgONRv9qkxdawL3rfcNHYJY1ZVvWVs7j, 465 p=v0X8v3Bz2T0CJGbJQyF0X+HI4Ts=) 466 C: [...] 468 S: HTTP/1.1 200 Ok 469 S: Authentication-Info: sid=AAAABBBBCCCCDDDD, 470 data=base64(v=rmF9pqV8S7suAoZWja4dJRkFsKQ=) 471 S: [...Other header fields and resource body...] 473 6. Use of Authentication-Info header field with SCRAM 475 When used with SCRAM, the Authentication-Info header field is allowed 476 in the trailer of an HTTP message transferred via chunked transfer- 477 coding. 479 7. Formal Syntax 481 The following syntax specification uses the Augmented Backus-Naur 482 Form (ABNF) notation as specified in [RFC5234]. "UTF8-2", "UTF8-3" 483 and "UTF8-4" non-terminal are defined in [RFC3629]. 485 ALPHA = 486 DIGIT = 488 base64-char = ALPHA / DIGIT / "/" / "+" 490 base64-4 = 4base64-char 492 base64-3 = 3base64-char "=" 494 base64-2 = 2base64-char "==" 496 base64 = *base64-4 [base64-3 / base64-2] 498 sr = "sr=" s-nonce 499 ;; s-nonce is defined in RFC 5802. 501 data = "data=" base64 502 ;; The data attribute value is base-64 encoded 503 ;; SCRAM challenge or response defined in 504 ;; RFC 5802. 506 ttl = "ttl" = 1*DIGIT 507 ;; "sr" value validity in seconds. 508 ;; No leading 0s. 510 sid = "sid=" <...> 512 realm = "realm=" <...as defined in HTTP Authentication...> 514 8. Security Considerations 516 If the authentication exchange is performed without a strong security 517 layer (such as TLS with data confidentiality), then a passive 518 eavesdropper can gain sufficient information to mount an offline 519 dictionary or brute-force attack which can be used to recover the 520 user's password. The amount of time necessary for this attack 521 depends on the cryptographic hash function selected, the strength of 522 the password and the iteration count supplied by the server. An 523 external security layer with strong encryption will prevent this 524 attack. 526 If the external security layer used to protect the SCRAM exchange 527 uses an anonymous key exchange, then the SCRAM channel binding 528 mechanism can be used to detect a man-in-the-middle attack on the 529 security layer and cause the authentication to fail as a result. 530 However, the man-in-the-middle attacker will have gained sufficient 531 information to mount an offline dictionary or brute-force attack. 533 For this reason, SCRAM allows to increase the iteration count over 534 time. (Note that a server that is only in posession of "StoredKey" 535 and "ServerKey" can't automatic increase the iteration count upon 536 successful authentication. Such increase would require resetting 537 user's password.) 539 If the authentication information is stolen from the authentication 540 database, then an offline dictionary or brute-force attack can be 541 used to recover the user's password. The use of salt mitigates this 542 attack somewhat by requiring a separate attack on each password. 543 Authentication mechanisms which protect against this attack are 544 available (e.g., the EKE class of mechanisms). RFC 2945 [RFC2945] is 545 an example of such technology. 547 If an attacker obtains the authentication information from the 548 authentication repository and either eavesdrops on one authentication 549 exchange or impersonates a server, the attacker gains the ability to 550 impersonate that user to all servers providing SCRAM access using the 551 same hash function, password, iteration count and salt. For this 552 reason, it is important to use randomly-generated salt values. 554 SCRAM does not negotiate a hash function to use. Hash function 555 negotiation is left to the HTTP authentication mechanism negotiation. 556 It is important that clients be able to sort a locally available list 557 of mechanisms by preference so that the client may pick the most 558 preferred of a server's advertised mechanism list. This preference 559 order is not specified here as it is a local matter. The preference 560 order should include objective and subjective notions of mechanism 561 cryptographic strength (e.g., SCRAM with a successor to SHA-1 may be 562 preferred over SCRAM with SHA-1). 564 SCRAM does not protect against downgrade attacks of channel binding 565 types. The complexities of negotiation a channel binding type, and 566 handling down-grade attacks in that negotiation, was intentionally 567 left out of scope for this document. 569 A hostile server can perform a computational denial-of-service attack 570 on clients by sending a big iteration count value. 572 See [RFC4086] for more information about generating randomness. 574 9. IANA Considerations 576 New mechanisms in the SCRAM- family are registered according to the 577 IANA procedure specified in [RFC5802]. 579 Note to future SCRAM- mechanism designers: each new SCRAM- HTTP 580 authentication mechanism MUST be explicitly registered with IANA and 581 MUST comply with SCRAM- mechanism naming convention defined in 582 Section 4 of this document. 584 IANA is requested to add the following entry to the Authentication 585 Scheme Registry defined in HTTP/1.1, Part 7 [RFC7235]: 587 Authentication Scheme Name: SCRAM-SHA-1 588 Pointer to specification text: [[ this document ]] 589 Notes (optional): (none) 591 10. Acknowledgements 593 This document benefited from discussions on the HTTPAuth, SASL and 594 Kitten WG mailing lists. The authors would like to specially thank 595 co-authors of [RFC5802] from which lots of text was copied. 597 Thank you to Martin Thomson for the idea of adding "ttl" attribute. 599 Special thank you to Tony Hansen for doing an early implementation 600 and providing extensive comments on the draft. 602 11. Design Motivations 604 The following design goals shaped this document. Note that some of 605 the goals have changed since the initial version of the document. 607 o The HTTP authentication mechanism has all modern features: support 608 for internationalized usernames and passwords, support for channel 609 bindings. 611 o The protocol supports mutual authentication. 613 o The authentication information stored in the authentication 614 database is not sufficient by itself to impersonate the client. 616 o The server does not gain the ability to impersonate the client to 617 other servers (with an exception for server-authorized proxies), 618 unless such other servers allow SCRAM authentication and use the 619 same salt and iteration count for the user. 621 o The mechanism is extensible, but [hopefully] not overengineered in 622 this respect. 624 o Easier to implement than HTTP Digest in both clients and servers. 626 12. Open Issues 628 Mandatory to implement SCRAM mechanism? Probably will switch to 629 SHA-256 631 Should "sid" directive be an attribute or a new HTTP header field 632 shared with other HTTP authentication mechanisms? 634 Username/password normalization algorithm needs to be picked. 636 13. References 638 13.1. Normative References 640 [I-D.ietf-httpbis-auth-info] 641 Reschke, J., "The Hypertext Transfer Protocol (HTTP) 642 Authentication-Info and Proxy- Authentication-Info 643 Response Header Fields", draft-ietf-httpbis-auth-info-03 644 (work in progress), March 2015. 646 [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 647 Hashing for Message Authentication", RFC 2104, February 648 1997. 650 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 651 Requirement Levels", BCP 14, RFC 2119, March 1997. 653 [RFC3174] Eastlake, D. and P. Jones, "US Secure Hash Algorithm 1 654 (SHA1)", RFC 3174, September 2001. 656 [RFC3454] Hoffman, P. and M. Blanchet, "Preparation of 657 Internationalized Strings ("stringprep")", RFC 3454, 658 December 2002. 660 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 661 10646", STD 63, RFC 3629, November 2003. 663 [RFC4013] Zeilenga, K., "SASLprep: Stringprep Profile for User Names 664 and Passwords", RFC 4013, February 2005. 666 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 667 Encodings", RFC 4648, October 2006. 669 [RFC5056] Williams, N., "On the Use of Channel Bindings to Secure 670 Channels", RFC 5056, November 2007. 672 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 673 Specifications: ABNF", STD 68, RFC 5234, January 2008. 675 [RFC5802] Newman, C., Menon-Sen, A., Melnikov, A., and N. Williams, 676 "Salted Challenge Response Authentication Mechanism 677 (SCRAM) SASL and GSS-API Mechanisms", RFC 5802, July 2010. 679 [RFC5929] Altman, J., Williams, N., and L. Zhu, "Channel Bindings 680 for TLS", RFC 5929, July 2010. 682 [RFC7235] Fielding, R. and J. Reschke, "Hypertext Transfer Protocol 683 (HTTP/1.1): Authentication", RFC 7235, June 2014. 685 13.2. Informative References 687 [RFC2865] Rigney, C., Willens, S., Rubens, A., and W. Simpson, 688 "Remote Authentication Dial In User Service (RADIUS)", RFC 689 2865, June 2000. 691 [RFC2898] Kaliski, B., "PKCS #5: Password-Based Cryptography 692 Specification Version 2.0", RFC 2898, September 2000. 694 [RFC2945] Wu, T., "The SRP Authentication and Key Exchange System", 695 RFC 2945, September 2000. 697 [RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 698 Requirements for Security", BCP 106, RFC 4086, June 2005. 700 [RFC4510] Zeilenga, K., "Lightweight Directory Access Protocol 701 (LDAP): Technical Specification Road Map", RFC 4510, June 702 2006. 704 [RFC4616] Zeilenga, K., "The PLAIN Simple Authentication and 705 Security Layer (SASL) Mechanism", RFC 4616, August 2006. 707 [RFC4949] Shirey, R., "Internet Security Glossary, Version 2", RFC 708 4949, August 2007. 710 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 711 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 712 May 2008. 714 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 715 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 717 [tls-server-end-point] 718 Zhu, L., , "Registration of TLS server end-point channel 719 bindings", IANA http://www.iana.org/assignments/ 720 channel-binding-types/tls-server-end-point, July 2008. 722 Author's Address 724 Alexey Melnikov 725 Isode Ltd 727 Email: Alexey.Melnikov@isode.com