idnits 2.17.1 draft-melnikov-httpbis-scram-auth-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: ---------------------------------------------------------------------------- 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 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 (November 12, 2014) is 3446 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 652, but no explicit reference was found in the text == Unused Reference: 'RFC5929' is defined on line 662, but no explicit reference was found in the text == Unused Reference: 'RFC4616' is defined on line 687, but no explicit reference was found in the text == Unused Reference: 'RFC5226' is defined on line 693, 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 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 (~~), 5 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 November 12, 2014 5 Expires: May 16, 2015 7 Salted Challenge Response (SCRAM) HTTP Authentication Mechanism 8 draft-melnikov-httpbis-scram-auth-01.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 May 16, 2015. 46 Copyright Notice 48 Copyright (c) 2014 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 . . . . . . . . . . . . . . . . . . . . . . . . . 3 66 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 5 67 3. SCRAM Algorithm Overview . . . . . . . . . . . . . . . . . . 5 68 4. SCRAM Mechanism Names . . . . . . . . . . . . . . . . . . . . 6 69 5. SCRAM Authentication Exchange . . . . . . . . . . . . . . . . 7 70 5.1. One round trip reauthentication . . . . . . . . . . . . . . 9 71 6. Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . . 11 72 7. Security Considerations . . . . . . . . . . . . . . . . . . . 12 73 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 13 74 9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 14 75 10. Design Motivations . . . . . . . . . . . . . . . . . . . . . 14 76 11. Open Issues . . . . . . . . . . . . . . . . . . . . . . . . . 15 77 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 15 78 12.1. Normative References . . . . . . . . . . . . . . . . . . . 15 79 12.2. Informative References . . . . . . . . . . . . . . . . . . 16 80 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 16 82 1. Conventions Used in This Document 84 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 85 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 86 document are to be interpreted as described in [RFC2119]. 88 Formal syntax is defined by [RFC5234] including the core rules 89 defined in Appendix B of [RFC5234]. 91 Example lines prefaced by "C:" are sent by the client and ones 92 prefaced by "S:" by the server. If a single "C:" or "S:" label 93 applies to multiple lines, then the line breaks between those lines 94 are for editorial clarity only, and are not part of the actual 95 protocol exchange. 97 1.1. Terminology 99 This document uses several terms defined in [RFC4949] ("Internet 100 Security Glossary") including the following: authentication, 101 authentication exchange, authentication information, brute force, 102 challenge-response, cryptographic hash function, dictionary attack, 103 eavesdropping, hash result, keyed hash, man-in-the-middle, nonce, 104 one-way encryption function, password, replay attack and salt. 105 Readers not familiar with these terms should use that glossary as a 106 reference. 108 Some clarifications and additional definitions follow: 110 o Authentication information: Information used to verify an identity 111 claimed by a SCRAM client. The authentication information for a 112 SCRAM identity consists of salt, iteration count, the "StoredKey" 113 and "ServerKey" (as defined in the algorithm overview) for each 114 supported cryptographic hash function. 116 o Authentication database: The database used to look up the 117 authentication information associated with a particular identity. 118 For application protocols, LDAPv3 (see [RFC4510]) is frequently 119 used as the authentication database. For network-level protocols 120 such as PPP or 802.11x, the use of RADIUS [RFC2865] is more 121 common. 123 o Base64: An encoding mechanism defined in [RFC4648] which converts 124 an octet string input to a textual output string which can be 125 easily displayed to a human. The use of base64 in SCRAM is 126 restricted to the canonical form with no whitespace. 128 o Octet: An 8-bit byte. 130 o Octet string: A sequence of 8-bit bytes. 132 o Salt: A random octet string that is combined with a password 133 before applying a one-way encryption function. This value is used 134 to protect passwords that are stored in an authentication 135 database. 137 1.2. Notation 139 The pseudocode description of the algorithm uses the following 140 notations: 142 o ":=": The variable on the left hand side represents the octet 143 string resulting from the expression on the right hand side. 145 o "+": Octet string concatenation. 147 o "[ ]": A portion of an expression enclosed in "[" and "]" may not 148 be included in the result under some circumstances. See the 149 associated text for a description of those circumstances. 151 o Normalize(str): Apply the SASLPrep profile [RFC4013] of the 152 "stringprep" algorithm [RFC3454] as the normalization algorithm to 153 a UTF-8 [RFC3629] encoded "str". The resulting string is also in 154 UTF-8. When applying SASLPrep, "str" is treated as a "stored 155 strings", which means that unassigned Unicode codepoints are 156 prohibited (see Section 7 of [RFC3454]). Note that 157 implementations MUST either implement SASLPrep, or disallow use of 158 non US-ASCII Unicode codepoints in "str". 160 o HMAC(key, str): Apply the HMAC keyed hash algorithm (defined in 161 [RFC2104]) using the octet string represented by "key" as the key 162 and the octet string "str" as the input string. The size of the 163 result is the hash result size for the hash function in use. For 164 example, it is 20 octets for SHA-1 (see [RFC3174]). 166 o H(str): Apply the cryptographic hash function to the octet string 167 "str", producing an octet string as a result. The size of the 168 result depends on the hash result size for the hash function in 169 use. 171 o XOR: Apply the exclusive-or operation to combine the octet string 172 on the left of this operator with the octet string on the right of 173 this operator. The length of the output and each of the two 174 inputs will be the same for this use. 176 o Hi(str, salt, i): 178 U1 := HMAC(str, salt + INT(1)) 179 U2 := HMAC(str, U1) 180 ... 181 Ui-1 := HMAC(str, Ui-2) 182 Ui := HMAC(str, Ui-1) 184 Hi := U1 XOR U2 XOR ... XOR Ui 186 where "i" is the iteration count, "+" is the string concatenation 187 operator and INT(g) is a four-octet encoding of the integer g, 188 most significant octet first. 190 Hi() is, essentially, PBKDF2 [RFC2898] with HMAC() as the PRF and 191 with dkLen == output length of HMAC() == output length of H(). 193 2. Introduction 195 This specification describes a family of authentication mechanisms 196 called the Salted Challenge Response Authentication Mechanism (SCRAM) 197 which addresses the requirements necessary to deploy a challenge- 198 response mechanism more widely than past attempts (see [RFC5802]). 199 When used in combination with Transport Layer Security (TLS, see 200 [RFC5246]) or an equivalent security layer, a mechanism from this 201 family could improve the status-quo for HTTP authentication. 203 HTTP SCRAM is adoptation of [RFC5802] for use in HTTP. (SCRAM data 204 exchanged is identical to what is defined in [RFC5802].) It also 205 adds 1 round trip reauthentication mode. 207 HTTP SCRAM provides the following protocol features: 209 o The authentication information stored in the authentication 210 database is not sufficient by itself (without a dictionary attack) 211 to impersonate the client. The information is salted to prevent a 212 pre-stored dictionary attack if the database is stolen. 214 o The server does not gain the ability to impersonate the client to 215 other servers (with an exception for server-authorized proxies). 217 o The mechanism permits the use of a server-authorized proxy without 218 requiring that proxy to have super-user rights with the back-end 219 server. 221 o Mutual authentication is supported, but only the client is named 222 (i.e., the server has no name). 224 3. SCRAM Algorithm Overview 226 The following is a description of a full HTTP SCRAM authentication 227 exchange. Note that this section omits some details, such as client 228 and server nonces. See Section 5 for more details. 230 To begin with, the SCRAM client is in possession of a username and 231 password (*) (or a ClientKey/ServerKey, or SaltedPassword). It sends 232 the username to the server, which retrieves the corresponding 233 authentication information, i.e. a salt, StoredKey, ServerKey and the 234 iteration count i. (Note that a server implementation may choose to 235 use the same iteration count for all accounts.) The server sends the 236 salt and the iteration count to the client, which then computes the 237 following values and sends a ClientProof to the server: 239 (*) - Note that both the username and the password MUST be encoded in 240 UTF-8 [RFC3629]. 242 Informative Note: Implementors are encouraged to create test cases 243 that use both username passwords with non-ASCII codepoints. In 244 particular, it's useful to test codepoints whose "Unicode 245 Normalization Form C" and "Unicode Normalization Form KC" are 246 different. Some examples of such codepoints include Vulgar Fraction 247 One Half (U+00BD) and Acute Accent (U+00B4). 249 SaltedPassword := Hi(Normalize(password), salt, i) 250 ClientKey := HMAC(SaltedPassword, "Client Key") 251 StoredKey := H(ClientKey) 252 AuthMessage := client-first-message-bare + "," + 253 server-first-message + "," + 254 client-final-message-without-proof 255 ClientSignature := HMAC(StoredKey, AuthMessage) 256 ClientProof := ClientKey XOR ClientSignature 257 ServerKey := HMAC(SaltedPassword, "Server Key") 258 ServerSignature := HMAC(ServerKey, AuthMessage) 260 The server authenticates the client by computing the ClientSignature, 261 exclusive-ORing that with the ClientProof to recover the ClientKey 262 and verifying the correctness of the ClientKey by applying the hash 263 function and comparing the result to the StoredKey. If the ClientKey 264 is correct, this proves that the client has access to the user's 265 password. 267 Similarly, the client authenticates the server by computing the 268 ServerSignature and comparing it to the value sent by the server. If 269 the two are equal, it proves that the server had access to the user's 270 ServerKey. 272 For initial authentication the AuthMessage is computed by 273 concatenating decoded "data" attribute values from the authentication 274 exchange. The format of these messages is defined in [RFC5802]. 276 4. SCRAM Mechanism Names 278 A SCRAM mechanism name (authentication scheme) is a string "SCRAM-" 279 followed by the uppercased name of the underlying hash function taken 280 from the IANA "Hash Function Textual Names" registry (see 281 http://www.iana.org) . 283 For interoperability, all HTTP clients and servers supporting SCRAM 284 MUST implement the SCRAM-SHA-1 authentication mechanism, [[CREF1: 285 OPEN ISSUE: Possibly switch to SHA-256 as the mandatory-to- 286 implement.]] i.e. an authentication mechanism from the SCRAM family 287 that uses the SHA-1 hash function as defined in [RFC3174]. 289 5. SCRAM Authentication Exchange 291 HTTP SCRAM is a HTTP Authentication mechanism whose client response 292 () and server challenge () 293 messages are text-based messages containing one or more attribute- 294 value pairs separated by commas. The messages and their attributes 295 are described below and defined in Section 6. 297 challenge-scram = scram-name [1*SP 1#auth-param] 298 ; Complies with ABNF from RFC 7235. 299 ; Included in the WWW-Authenticate header field. 301 credentials-scram = scram-name [1*SP 1#auth-param] 302 ; Complies with from RFC 7235. 303 ; Included in the Authorization header field. 305 scram-name = "SCRAM-SHA-1" / other-scram-name 306 ; SCRAM-SHA-1 is registered by this RFC 307 other-scram-name = "SCRAM-" hash-name 308 ; hash-name is a capitalized form of names from IANA 309 ; "Hash Function Textual Names" registry. 310 ; Additional SCRAM names must be registered in both 311 ; the IANA "SASL mechanisms" registry 312 ; and the IANA "authentication scheme" registry. 314 This is a simple example of a SCRAM-SHA-1 authentication exchange 315 when the client doesn't support channel bindings (username 'user' and 316 password 'pencil' are used): 318 C: GET /resource HTTP/1.1 319 C: Host: server.example.com 320 C: [...] 322 S: HTTP/1.1 401 Unauthorized 323 S: WWW-Authenticate: Digest realm="realm1@host.com", 324 Digest realm="realm2@host.com", 325 Digest realm="realm3@host.com", 326 SCRAM-SHA-1 realm="realm3@host.com", 327 SCRAM-SHA-1 realm="testrealm@host.com" 328 S: [...] 330 C: GET /resource HTTP/1.1 331 C: Host: server.example.com 332 C: Authorization: SCRAM-SHA-1 realm="testrealm@host.com", 333 data=base64(n,,n=user,r=fyko+d2lbbFgONRv9qkxdawL) 334 C: [...] 336 S: HTTP/1.1 401 Unauthorized 337 S: WWW-Authenticate: SCRAM-SHA-1 338 sid=AAAABBBBCCCCDDDD, 339 data=base64(r=fyko+d2lbbFgONRv9qkxdawL3rfcNHYJY1ZVvWVs7j, 340 s=QSXCR+Q6sek8bf92,i=4096) 341 S: [...] 343 C: GET /resource HTTP/1.1 344 C: Host: server.example.com 345 C: Authorization: SCRAM-SHA-1 sid=AAAABBBBCCCCDDDD, 346 data=base64(c=biws,r=fyko+d2lbbFgONRv9qkxdawL3rfcNHYJY1ZVvWVs7j, 347 p=v0X8v3Bz2T0CJGbJQyF0X+HI4Ts=) 348 C: [...] 350 S: HTTP/1.1 200 Ok 351 S: Authentication-Info: SCRAM-SHA-1 352 sid=AAAABBBBCCCCDDDD, 353 data=base64(v=rmF9pqV8S7suAoZWja4dJRkFsKQ=) 354 S: [...Other header fields and resource body...] 356 Note that in the example above the client can also initiate SCRAM 357 authentication without first being prompted by the server. 359 Initial "SCRAM-SHA-1" authentication starts with sending the 360 "Authorization" request header field defined by HTTP/1.1, Part 7 361 [RFC7235] containing "SCRAM-SHA-1" authentication scheme and the 362 following attributes: 364 o A "realm" attribute MAY be included to indicate the scope of 365 protection in the manner described in HTTP/1.1, Part 7 [RFC7235]. 366 As specified in [RFC7235], the "realm" attribute MUST NOT appear 367 more than once. The realm attribute only appears in the first 368 SCRAM message to the server and in the first SCRAM response from 369 the server. 371 o The client also includes the data attribute that contains base64 372 encoded "client-first-message" [RFC5802] containing: 374 * a header consisting of a flag indicating whether channel 375 binding is supported-but-not-used, not supported, or used . 376 Note that the header always starts with "n", "y" or "p", 377 otherwise the message is invalid and authentication MUST fail. 379 * SCRAM username and a random, unique nonce attributes. 381 In HTTP response, the server sends WWW-Authenticate header field 382 containing: a unique session identifier (the "sid" attribute) plus 383 the "data" attribute containing base64-encoded "server-first-message" 384 [RFC5802]. The "server-first-message" contains the user's iteration 385 count i, the user's salt, and the nonce with a concatenation of the 386 client-specified one with a server nonce. [[CREF2: OPEN ISSUE: 387 Alternatively, the "sid" attribute can be another header field.]] 389 The client then responds with another HTTP request with the 390 Authorization header field, which includes the "sid" attribute 391 received in the previous server response, together with the "data" 392 attribute containing base64-encoded "client-final-message" data. The 393 latter has the same nonce and a ClientProof computed using the 394 selected hash function (e.g. SHA-1) as explained earlier. 396 The server verifies the nonce and the proof, and, finally, it 397 responds with a 200 HTTP response with the Authentication-Info header 398 field containing the "data" attribute containing base64-encoded 399 "server-final-message", concluding the authentication exchange. 401 The client then authenticates the server by computing the 402 ServerSignature and comparing it to the value sent by the server. If 403 the two are different, the client MUST consider the authentication 404 exchange to be unsuccessful and it might have to drop the connection. 406 5.1. One round trip reauthentication 408 If the server supports SCRAM reauthentication, the server sends in 409 its initial HTTP response a WWW-Authenticate header field containing: 410 the "realm" attribute (as defined earlier), the "sr" attribute that 411 contains the server part of the "r" attribute (see [RFC5802] and 412 optional "ttl" attribute (which contains the "sr" value validity in 413 seconds). 415 If the client has authenticated to the same realm before (i.e. it 416 remembers "i" and "s" attributes for the user from earlies 417 authentication exchanges with the server), it can respond to that 418 with "client-final-message". 420 If the server considers the server part of the nonce (the "r" 421 attribute) to be still valid, it will provide access to the requested 422 resource (assuming the client hash verifies correctly, of course). 423 However if the server considers that the server part of the nonce is 424 stale (for example if the "sr" value is used after the "ttl" 425 seconds), the server returns "401 Unauthorized" containing the SCRAM 426 mechanism name with a new "sr" and optional "ttl" attributes. 428 When constructing AuthMessage Section 3 to be used for calculating 429 client and server proofs, "client-first-message-bare" and "server- 430 first-message" are reconstructed from data known to the client and 431 the server. 433 Reauthentication can look like this: 435 C: GET /resource HTTP/1.1 436 C: Host: server.example.com 437 C: [...] 439 S: HTTP/1.1 401 Unauthorized 440 S: WWW-Authenticate: Digest realm="realm1@host.com", 441 Digest realm="realm2@host.com", 442 Digest realm="realm3@host.com", 443 SCRAM-SHA-1 realm="realm3@host.com", 444 SCRAM-SHA-1 realm="testrealm@host.com", sr=3rfcNHYJY1ZVvWVs7j 445 SCRAM-SHA-1 realm="testrealm2@host.com", sr=AAABBBCCCDDD, ttl=120 446 S: [...] 448 [Client authenticates as usual to realm "testrealm@host.com"] 450 [Some time later client decides to reauthenticate. 451 It will use the cached "i" and "s" from earlies exchanges. 452 It will use the server advertised "sr" value as the server part of the "r". 453 Should some counter be added to make "sr" unique for each reauth???] 455 C: GET /resource HTTP/1.1 456 C: Host: server.example.com 457 C: Authorization: SCRAM-SHA-1 realm="testrealm@host.com", 458 data=base64(c=biws,r=fyko+d2lbbFgONRv9qkxdawL3rfcNHYJY1ZVvWVs7j, 459 p=v0X8v3Bz2T0CJGbJQyF0X+HI4Ts=) 460 C: [...] 462 S: HTTP/1.1 200 Ok 463 S: Authentication-Info: SCRAM-SHA-1 464 sid=AAAABBBBCCCCDDDD, 465 data=base64(v=rmF9pqV8S7suAoZWja4dJRkFsKQ=) 466 S: [...Other header fields and resource body...] 468 6. Formal Syntax 470 The following syntax specification uses the Augmented Backus-Naur 471 Form (ABNF) notation as specified in [RFC5234]. "UTF8-2", "UTF8-3" 472 and "UTF8-4" non-terminal are defined in [RFC3629]. 474 ALPHA = 475 DIGIT = 477 base64-char = ALPHA / DIGIT / "/" / "+" 479 base64-4 = 4base64-char 481 base64-3 = 3base64-char "=" 483 base64-2 = 2base64-char "==" 485 base64 = *base64-4 [base64-3 / base64-2] 487 sr = "sr=" s-nonce 488 ;; s-nonce is defined in RFC 5802. 490 data = "data=" base64 491 ;; The data attribute value is base-64 encoded 492 ;; SCRAM challenge or response defined in 493 ;; RFC 5802. 495 ttl = "ttl" = 1*DIGIT 496 ;; "sr" value validity in seconds. 497 ;; No leading 0s. 499 sid = "sid=" <...> 501 realm = "realm=" <...as defined in HTTP Authentication...> 503 7. Security Considerations 505 If the authentication exchange is performed without a strong security 506 layer (such as TLS with data confidentiality), then a passive 507 eavesdropper can gain sufficient information to mount an offline 508 dictionary or brute-force attack which can be used to recover the 509 user's password. The amount of time necessary for this attack 510 depends on the cryptographic hash function selected, the strength of 511 the password and the iteration count supplied by the server. An 512 external security layer with strong encryption will prevent this 513 attack. 515 If the external security layer used to protect the SCRAM exchange 516 uses an anonymous key exchange, then the SCRAM channel binding 517 mechanism can be used to detect a man-in-the-middle attack on the 518 security layer and cause the authentication to fail as a result. 519 However, the man-in-the-middle attacker will have gained sufficient 520 information to mount an offline dictionary or brute-force attack. 522 For this reason, SCRAM allows to increase the iteration count over 523 time. (Note that a server that is only in posession of "StoredKey" 524 and "ServerKey" can't automatic increase the iteration count upon 525 successful authentication. Such increase would require resetting 526 user's password.) 528 If the authentication information is stolen from the authentication 529 database, then an offline dictionary or brute-force attack can be 530 used to recover the user's password. The use of salt mitigates this 531 attack somewhat by requiring a separate attack on each password. 532 Authentication mechanisms which protect against this attack are 533 available (e.g., the EKE class of mechanisms). RFC 2945 [RFC2945] is 534 an example of such technology. 536 If an attacker obtains the authentication information from the 537 authentication repository and either eavesdrops on one authentication 538 exchange or impersonates a server, the attacker gains the ability to 539 impersonate that user to all servers providing SCRAM access using the 540 same hash function, password, iteration count and salt. For this 541 reason, it is important to use randomly-generated salt values. 543 SCRAM does not negotiate a hash function to use. Hash function 544 negotiation is left to the HTTP authentication mechanism negotiation. 545 It is important that clients be able to sort a locally available list 546 of mechanisms by preference so that the client may pick the most 547 preferred of a server's advertised mechanism list. This preference 548 order is not specified here as it is a local matter. The preference 549 order should include objective and subjective notions of mechanism 550 cryptographic strength (e.g., SCRAM with a successor to SHA-1 may be 551 preferred over SCRAM with SHA-1). 553 SCRAM does not protect against downgrade attacks of channel binding 554 types. The complexities of negotiation a channel binding type, and 555 handling down-grade attacks in that negotiation, was intentionally 556 left out of scope for this document. 558 A hostile server can perform a computational denial-of-service attack 559 on clients by sending a big iteration count value. 561 See [RFC4086] for more information about generating randomness. 563 8. IANA Considerations 565 New mechanisms in the SCRAM- family are registered according to the 566 IANA procedure specified in [RFC5802]. 568 Note to future SCRAM- mechanism designers: each new SCRAM- HTTP 569 authentication mechanism MUST be explicitly registered with IANA and 570 MUST comply with SCRAM- mechanism naming convention defined in 571 Section 4 of this document. 573 IANA is requested to add the following entry to the Authentication 574 Scheme Registry defined in HTTP/1.1, Part 7 [RFC7235]: 576 Authentication Scheme Name: SCRAM-SHA-1 577 Pointer to specification text: [[ this document ]] 578 Notes (optional): (none) 580 9. Acknowledgements 582 This document benefited from discussions on the HTTPAuth, SASL and 583 Kitten WG mailing lists. The authors would like to specially thank 584 co-authors of [RFC5802] from which lots of text was copied. 586 Thank you to Martin Thomson for the idea of adding "ttl" attribute. 588 Special thank you to Tony Hansen for doing an early implementation 589 and providing extensive comments on the draft. 591 10. Design Motivations 593 The following design goals shaped this document. Note that some of 594 the goals have changed since the initial version of the document. 596 o The HTTP authentication mechanism has all modern features: support 597 for internationalized usernames and passwords, support for channel 598 bindings. 600 o The protocol supports mutual authentication. 602 o The authentication information stored in the authentication 603 database is not sufficient by itself to impersonate the client. 605 o The server does not gain the ability to impersonate the client to 606 other servers (with an exception for server-authorized proxies), 607 unless such other servers allow SCRAM authentication and use the 608 same salt and iteration count for the user. 610 o The mechanism is extensible, but [hopefully] not overengineered in 611 this respect. 613 o Easier to implement than HTTP Digest in both clients and servers. 615 11. Open Issues 617 Mandatory to implement SCRAM mechanism? Probably will switch to 618 SHA-256 620 Should "sid" directive be an attribute or a new HTTP header field 621 shared with other HTTP authentication mechanisms? 623 Username/password normalization algorithm needs to be picked. 625 12. References 627 12.1. Normative References 629 [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 630 Hashing for Message Authentication", RFC 2104, February 631 1997. 633 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 634 Requirement Levels", BCP 14, RFC 2119, March 1997. 636 [RFC3174] Eastlake, D. and P. Jones, "US Secure Hash Algorithm 1 637 (SHA1)", RFC 3174, September 2001. 639 [RFC3454] Hoffman, P. and M. Blanchet, "Preparation of 640 Internationalized Strings ("stringprep")", RFC 3454, 641 December 2002. 643 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 644 10646", STD 63, RFC 3629, November 2003. 646 [RFC4013] Zeilenga, K., "SASLprep: Stringprep Profile for User Names 647 and Passwords", RFC 4013, February 2005. 649 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 650 Encodings", RFC 4648, October 2006. 652 [RFC5056] Williams, N., "On the Use of Channel Bindings to Secure 653 Channels", RFC 5056, November 2007. 655 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 656 Specifications: ABNF", STD 68, RFC 5234, January 2008. 658 [RFC5802] Newman, C., Menon-Sen, A., Melnikov, A., and N. Williams, 659 "Salted Challenge Response Authentication Mechanism 660 (SCRAM) SASL and GSS-API Mechanisms", RFC 5802, July 2010. 662 [RFC5929] Altman, J., Williams, N., and L. Zhu, "Channel Bindings 663 for TLS", RFC 5929, July 2010. 665 [RFC7235] Fielding, R. and J. Reschke, "Hypertext Transfer Protocol 666 (HTTP/1.1): Authentication", RFC 7235, June 2014. 668 12.2. Informative References 670 [RFC2865] Rigney, C., Willens, S., Rubens, A., and W. Simpson, 671 "Remote Authentication Dial In User Service (RADIUS)", RFC 672 2865, June 2000. 674 [RFC2898] Kaliski, B., "PKCS #5: Password-Based Cryptography 675 Specification Version 2.0", RFC 2898, September 2000. 677 [RFC2945] Wu, T., "The SRP Authentication and Key Exchange System", 678 RFC 2945, September 2000. 680 [RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 681 Requirements for Security", BCP 106, RFC 4086, June 2005. 683 [RFC4510] Zeilenga, K., "Lightweight Directory Access Protocol 684 (LDAP): Technical Specification Road Map", RFC 4510, June 685 2006. 687 [RFC4616] Zeilenga, K., "The PLAIN Simple Authentication and 688 Security Layer (SASL) Mechanism", RFC 4616, August 2006. 690 [RFC4949] Shirey, R., "Internet Security Glossary, Version 2", RFC 691 4949, August 2007. 693 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 694 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 695 May 2008. 697 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 698 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 700 [tls-server-end-point] 701 Zhu, L., , "Registration of TLS server end-point channel 702 bindings", IANA http://www.iana.org/assignments/ 703 channel-binding-types/tls-server-end-point, July 2008. 705 Author's Address 706 Alexey Melnikov 707 Isode Ltd 709 Email: Alexey.Melnikov@isode.com