idnits 2.17.1 draft-ietf-precis-saslprepbis-18.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- -- The abstract seems to indicate that this document obsoletes RFC3454, but the header doesn't have an 'Obsoletes:' line to match this. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (May 28, 2015) is 3256 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) ** Obsolete normative reference: RFC 7564 (Obsoleted by RFC 8264) -- Possible downref: Non-RFC (?) normative reference: ref. 'UAX11' -- Possible downref: Non-RFC (?) normative reference: ref. 'Unicode' == Outdated reference: A later version (-24) exists of draft-ietf-xmpp-6122bis-22 -- Obsolete informational reference (is this intentional?): RFC 3454 (Obsoleted by RFC 7564) -- Obsolete informational reference (is this intentional?): RFC 3501 (Obsoleted by RFC 9051) -- Obsolete informational reference (is this intentional?): RFC 4013 (Obsoleted by RFC 7613) -- Obsolete informational reference (is this intentional?): RFC 6122 (Obsoleted by RFC 7622) Summary: 1 error (**), 0 flaws (~~), 2 warnings (==), 8 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 PRECIS P. Saint-Andre 3 Internet-Draft &yet 4 Obsoletes: 4013 (if approved) A. Melnikov 5 Intended status: Standards Track Isode Ltd 6 Expires: November 29, 2015 May 28, 2015 8 Preparation, Enforcement, and Comparison of Internationalized Strings 9 Representing Usernames and Passwords 10 draft-ietf-precis-saslprepbis-18 12 Abstract 14 This document describes updated methods for handling Unicode strings 15 representing usernames and passwords. The previous approach was 16 known as SASLprep (RFC 4013) and was based on Stringprep (RFC 3454). 17 The methods specified in this document provide a more sustainable 18 approach to the handling of internationalized usernames and 19 passwords. The PRECIS framework, RFC 7564, obsoletes RFC 3454, and 20 this document obsoletes RFC 4013. 22 Status of This Memo 24 This Internet-Draft is submitted in full conformance with the 25 provisions of BCP 78 and BCP 79. 27 Internet-Drafts are working documents of the Internet Engineering 28 Task Force (IETF). Note that other groups may also distribute 29 working documents as Internet-Drafts. The list of current Internet- 30 Drafts is at http://datatracker.ietf.org/drafts/current/. 32 Internet-Drafts are draft documents valid for a maximum of six months 33 and may be updated, replaced, or obsoleted by other documents at any 34 time. It is inappropriate to use Internet-Drafts as reference 35 material or to cite them other than as "work in progress." 37 This Internet-Draft will expire on November 29, 2015. 39 Copyright Notice 41 Copyright (c) 2015 IETF Trust and the persons identified as the 42 document authors. All rights reserved. 44 This document is subject to BCP 78 and the IETF Trust's Legal 45 Provisions Relating to IETF Documents 46 (http://trustee.ietf.org/license-info) in effect on the date of 47 publication of this document. Please review these documents 48 carefully, as they describe your rights and restrictions with respect 49 to this document. Code Components extracted from this document must 50 include Simplified BSD License text as described in Section 4.e of 51 the Trust Legal Provisions and are provided without warranty as 52 described in the Simplified BSD License. 54 Table of Contents 56 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 57 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4 58 3. Usernames . . . . . . . . . . . . . . . . . . . . . . . . . . 5 59 3.1. Definition . . . . . . . . . . . . . . . . . . . . . . . 5 60 3.2. UsernameCaseMapped Profile . . . . . . . . . . . . . . . 6 61 3.2.1. Preparation . . . . . . . . . . . . . . . . . . . . . 6 62 3.2.2. Enforcement . . . . . . . . . . . . . . . . . . . . . 6 63 3.2.3. Comparison . . . . . . . . . . . . . . . . . . . . . 7 64 3.3. UsernameCasePreserved Profile . . . . . . . . . . . . . . 7 65 3.3.1. Preparation . . . . . . . . . . . . . . . . . . . . . 7 66 3.3.2. Enforcement . . . . . . . . . . . . . . . . . . . . . 7 67 3.3.3. Comparison . . . . . . . . . . . . . . . . . . . . . 8 68 3.4. Case Mapping vs. Case Preservation . . . . . . . . . . . 8 69 3.5. Application-Layer Constructs . . . . . . . . . . . . . . 9 70 3.6. Examples . . . . . . . . . . . . . . . . . . . . . . . . 9 71 4. Passwords . . . . . . . . . . . . . . . . . . . . . . . . . . 11 72 4.1. Definition . . . . . . . . . . . . . . . . . . . . . . . 11 73 4.2. OpaqueString Profile . . . . . . . . . . . . . . . . . . 12 74 4.2.1. Preparation . . . . . . . . . . . . . . . . . . . . . 12 75 4.2.2. Enforcement . . . . . . . . . . . . . . . . . . . . . 12 76 4.2.3. Comparison . . . . . . . . . . . . . . . . . . . . . 13 77 4.3. Examples . . . . . . . . . . . . . . . . . . . . . . . . 13 78 5. Use in Application Protocols . . . . . . . . . . . . . . . . 14 79 6. Migration . . . . . . . . . . . . . . . . . . . . . . . . . . 15 80 6.1. Usernames . . . . . . . . . . . . . . . . . . . . . . . . 15 81 6.2. Passwords . . . . . . . . . . . . . . . . . . . . . . . . 16 82 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 17 83 7.1. UsernameCaseMapped Profile . . . . . . . . . . . . . . . 17 84 7.2. UsernameCasePreserved Profile . . . . . . . . . . . . . . 18 85 7.3. OpaqueString Profile . . . . . . . . . . . . . . . . . . 19 86 8. Security Considerations . . . . . . . . . . . . . . . . . . . 19 87 8.1. Password/Passphrase Strength . . . . . . . . . . . . . . 19 88 8.2. Identifier Comparison . . . . . . . . . . . . . . . . . . 19 89 8.3. Reuse of PRECIS . . . . . . . . . . . . . . . . . . . . . 20 90 8.4. Reuse of Unicode . . . . . . . . . . . . . . . . . . . . 20 91 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 20 92 9.1. Normative References . . . . . . . . . . . . . . . . . . 20 93 9.2. Informative References . . . . . . . . . . . . . . . . . 21 94 Appendix A. Differences from RFC 4013 . . . . . . . . . . . . . 22 95 Appendix B. Acknowledgements . . . . . . . . . . . . . . . . . . 23 96 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 23 98 1. Introduction 100 Usernames and passwords are widely used for authentication and 101 authorization on the Internet, either directly when provided in 102 plaintext (as in the SASL PLAIN mechanism [RFC4616] or the HTTP Basic 103 scheme [I-D.ietf-httpauth-basicauth-update]) or indirectly when 104 provided as the input to a cryptographic algorithm such as a hash 105 function (as in the SASL SCRAM mechanism [RFC5802] or the HTTP Digest 106 scheme [I-D.ietf-httpauth-digest]). 108 To increase the likelihood that the input and comparison of usernames 109 and passwords will work in ways that make sense for typical users 110 throughout the world, this document defines rules for preparing, 111 enforcing, and comparing internationalized strings that represent 112 usernames and passwords. Such strings consist of characters from the 113 Unicode character set [Unicode], with special attention to characters 114 outside the ASCII range [RFC20]. The rules for handling such strings 115 are specified through profiles of the string classes defined in the 116 PRECIS framework specification [RFC7564]. 118 Profiles of the PRECIS framework enable software to handle Unicode 119 characters outside the ASCII range in an automated way, so that such 120 characters are treated carefully and consistently in application 121 protocols. In large measure, these profiles are designed to protect 122 application developers from the potentially negative consequences of 123 supporting the full range of Unicode characters. For instance, in 124 almost all application protocols it would be dangerous to treat the 125 Unicode character SUPERSCRIPT ONE (U+0089) as equivalent to DIGIT ONE 126 (U+0031), since that would result in false positives during 127 comparison, authentication, and authorization (e.g., an attacker 128 could easy spoof an account "user1@example.com"). 130 Whereas a naive use of Unicode would make such attacks trivially 131 easy, the PRECIS profile defined here for usernames generally 132 protects applications from inadvertently causing such problems. 133 (Similar considerations apply to passwords, although here it is 134 desirable to support a wider range of characters so as to maximize 135 entropy for purposes of authentication.) 137 The methods defined here might be applicable wherever usernames or 138 passwords are used. However, the methods are not intended for use in 139 preparing strings that are not usernames (e.g., LDAP distinguished 140 names), nor in cases where identifiers or secrets are not strings 141 (e.g., keys and certificates) or require specialized handling. 143 This document obsoletes RFC 4013 (the "SASLprep" profile of 144 Stringprep [RFC3454]) but can be used by technologies other than the 145 Simple Authentication and Security Layer (SASL) [RFC4422], such as 146 HTTP authentication as specified in 147 [I-D.ietf-httpauth-basicauth-update] and [I-D.ietf-httpauth-digest]. 149 This document does not modify the handling of internationalized 150 strings in usernames and passwords as prescribed by existing 151 application protocols that use SASLprep. If the community that uses 152 such an application protocol wishes to modernize its handling of 153 internationalized strings to use PRECIS instead of Stringprep, it 154 needs to explicitly update the existing application protocol 155 definition (one example is [I-D.ietf-xmpp-6122bis], which obsoletes 156 [RFC6122]). Non-coordinated updates to protocol implementations are 157 discouraged because they can have a negative impact on 158 interoperability and security. 160 2. Terminology 162 Many important terms used in this document are defined in [RFC5890], 163 [RFC6365], [RFC7564], and [Unicode]. The term "non-ASCII space" 164 refers to any Unicode code point having a general category of "Zs", 165 with the exception of U+0020 (here called "ASCII space"). 167 As used here, the term "password" is not literally limited to a word; 168 i.e., a password could be a passphrase consisting of more than one 169 word, perhaps separated by spaces, punctuation, or other non- 170 alphanumeric characters. 172 Some SASL mechanisms (e.g., CRAM-MD5, DIGEST-MD5, and SCRAM) specify 173 that the authentication identity used in the context of such 174 mechanisms is a "simple user name" (see Section 2 of [RFC4422] as 175 well as [RFC4013]). Various application technologies also assume 176 that the identity of a user or account takes the form of a username 177 (e.g., authentication for the HyperText Transfer Protocol as 178 specified in [I-D.ietf-httpauth-basicauth-update] and 179 [I-D.ietf-httpauth-digest]), whether or not they use SASL. Note well 180 that the exact form of a username in any particular SASL mechanism or 181 application technology is a matter for implementation and deployment, 182 and that a username does not necessarily map to any particular 183 application identifier (such as the localpart of an email address). 185 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 186 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 187 "OPTIONAL" in this document are to be interpreted as described in 188 [RFC2119]. 190 3. Usernames 192 3.1. Definition 194 This document specifies that a username is a string of Unicode code 195 points [Unicode], encoded using UTF-8 [RFC3629], and structured as an 196 ordered sequence of "userparts" (where the complete username can 197 consist of a single userpart or a space-separated sequence of 198 userparts). 200 The syntax for a username is defined as follows using the Augmented 201 Backus-Naur Form (ABNF) [RFC5234]. 203 username = userpart *(1*SP userpart) 204 userpart = 1*(idbyte) 205 ; 206 ; an "idbyte" is a byte used to represent a 207 ; UTF-8 encoded Unicode code point that can be 208 ; contained in a string that conforms to the 209 ; PRECIS "IdentifierClass" 210 ; 212 All code points and blocks not explicitly allowed in the PRECIS 213 IdentifierClass are disallowed; this includes private use characters, 214 surrogate code points, and the other code points and blocks that were 215 defined as "Prohibited Output" in [RFC4013]. In addition, common 216 constructions such as "user@example.com" (e.g., the Network Access 217 Identifier from [RFC7542]) are allowed as usernames under this 218 specification, as they were under [RFC4013]. 220 Implementation Note: The username construct defined in this 221 document does not necessarily match what all deployed applications 222 might refer to as a "username" or "userid", but instead provides a 223 relatively safe subset of Unicode characters that can be used in 224 existing SASL mechanisms and SASL-using application protocols, and 225 even in most application protocols that do not currently use SASL. 227 A username MUST NOT be zero bytes in length. This rule is to be 228 enforced after any normalization and mapping of code points. 230 In protocols that provide usernames as input to a cryptographic 231 algorithm such as a hash function, the client will need to perform 232 proper preparation of the username before applying the algorithm. 234 This specification defines two profiles for usernames: one that 235 performs case mapping and one that performs case preservation (see 236 further discussion under Section 3.4). 238 3.2. UsernameCaseMapped Profile 240 The definition of the UsernameCaseMapped profile of the 241 IdentifierClass is provided in the following sections, including 242 detailed information about preparation, enforcement, and comparison 243 (on the distinction between these actions, refer to [RFC7564]). 245 3.2.1. Preparation 247 An entity that prepares a string according to this profile MUST 248 ensure that the string consists only of Unicode code points that 249 conform to the "IdentifierClass" base string class defined in 250 [RFC7564]. In addition, the string MUST be encoded as UTF-8 251 [RFC3629]. 253 3.2.2. Enforcement 255 An entity that performs enforcement according to this profile MUST 256 prepare a string as described in the previous section and MUST also 257 apply the rules specified below for the UsernameCaseMapped profile 258 (these rules MUST be applied in the order shown). 260 1. Width Mapping Rule: Fullwidth and halfwidth characters MUST be 261 mapped to their decomposition mappings (see Unicode Standard 262 Annex #11 [UAX11]). 264 2. Additional Mapping Rule: There is no additional mapping rule. 266 3. Case Mapping Rule: Uppercase and titlecase characters MUST be 267 mapped to their lowercase equivalents, preferably using Unicode 268 Default Case Folding as defined in the Unicode Standard [Unicode] 269 (at the time of this writing, the algorithm is specified in 270 Chapter 3 of [Unicode7.0], but the chapter number might change in 271 a future version of the Unicode Standard); see further discussion 272 in Section 3.4. 274 4. Normalization Rule: Unicode Normalization Form C (NFC) MUST be 275 applied to all characters. 277 5. Directionality Rule: Applications MUST apply the "Bidi Rule" 278 defined in [RFC5893] to strings that contain right-to-left 279 characters (i.e., each of the six conditions of the Bidi Rule 280 must be satisfied). 282 3.2.3. Comparison 284 An entity that performs comparison of two strings according to this 285 profile MUST prepare each string and enforce the rules specified in 286 the previous two sections. The two strings are to be considered 287 equivalent if they are an exact octet-for-octet match (sometimes 288 called "bit-string identity"). 290 3.3. UsernameCasePreserved Profile 292 The definition of the UsernameCasePreserved profile of the 293 IdentifierClass is provided in the following sections, including 294 detailed information about preparation, enforcement, and comparison 295 (on the distinction between these actions, refer to [RFC7564]). 297 3.3.1. Preparation 299 An entity that prepares a string according to this profile MUST 300 ensure that the string consists only of Unicode code points that 301 conform to the "IdentifierClass" base string class defined in 302 [RFC7564]. In addition, the string MUST be encoded as UTF-8 303 [RFC3629]. 305 3.3.2. Enforcement 307 An entity that performs enforcement according to this profile MUST 308 prepare a string as described in the previous section and MUST also 309 apply the rules specified below for the UsernameCasePreserved profile 310 (these rules MUST be applied in the order shown). 312 1. Width Mapping Rule: Fullwidth and halfwidth characters MUST be 313 mapped to their decomposition mappings (see Unicode Standard 314 Annex #11 [UAX11]). 316 2. Additional Mapping Rule: There is no additional mapping rule. 318 3. Case Mapping Rule: Uppercase and titlecase characters MUST NOT be 319 mapped to their lowercase equivalents; see further discussion in 320 Section 3.4. 322 4. Normalization Rule: Unicode Normalization Form C (NFC) MUST be 323 applied to all characters. 325 5. Directionality Rule: Applications MUST apply the "Bidi Rule" 326 defined in [RFC5893] to strings that contain right-to-left 327 characters (i.e., each of the six conditions of the Bidi Rule 328 must be satisfied). 330 3.3.3. Comparison 332 An entity that performs comparison of two strings according to this 333 profile MUST prepare each string and enforce the rules specified in 334 the previous two sections. The two strings are to be considered 335 equivalent if they are an exact octet-for-octet match (sometimes 336 called "bit-string identity"). 338 3.4. Case Mapping vs. Case Preservation 340 In order to accommodate the widest range of username constructs in 341 applications, this document defines two username profiles: 342 UsernameCaseMapped and UsernameCasePreserved. These two profiles 343 differ only in the Case Mapping Rule, and are otherwise identical. 345 Case mapping is a matter for the application protocol, protocol 346 implementation, or end deployment. In general, this document 347 suggests that it is preferable to apply the UsernameCaseMapped 348 profile and therefore perform case mapping, since not doing so can 349 lead to false positives during authentication and authorization (as 350 described in [RFC6943]) and can result in confusion among end users 351 given the prevalence of case mapping in many existing protocols and 352 applications. However, there can be good reasons to apply the 353 UsernameCasePreserved profile and thus not perform case mapping, such 354 as backward compatibility with deployed infrastructure. 356 In particular: 358 o SASL mechanisms that follow the recommendations in this document 359 MUST specify whether and when case mapping is to be applied to 360 authentication identifiers. SASL mechanisms SHOULD delay any case 361 mapping to the last possible moment, such as when doing a lookup 362 by username, username comparisons, or generating a cryptographic 363 salt from a username (if the last possible moment happens on the 364 server, then decisions about case mapping can be a matter of 365 deployment policy). In keeping with [RFC4422], SASL mechanisms 366 are not to apply this or any other profile to authorization 367 identifiers. 369 o Application protocols that use SASL (such as IMAP [RFC3501] and 370 XMPP [RFC6120]) and that directly re-use this profile MUST specify 371 whether case mapping is to be applied to authorization 372 identifiers. Such "SASL application protocols" SHOULD delay any 373 case mapping of authorization identifiers to the last possible 374 moment, which happens to necessarily be on the server side (this 375 enables decisions about case mapping to be a matter of deployment 376 policy). In keeping with [RFC4422], SASL application protocols 377 are not to apply this or any other profile to authentication 378 identifiers. 380 o Application protocols that do not use SASL (such as HTTP 381 authentication with the Basic and Digest schemes as specified in 382 [I-D.ietf-httpauth-basicauth-update] and 383 [I-D.ietf-httpauth-digest]) but that directly re-use this profile 384 MUST specify whether and when case mapping is to be applied to 385 authentication identifiers and authorization identifiers. Such 386 "non-SASL application protocols" SHOULD delay any case mapping to 387 the last possible moment, such as when doing a lookup by username, 388 username comparisons, or generating a cryptographic salt from a 389 username (if the last possible moment happens on the server, then 390 decisions about case mapping can be a matter of deployment 391 policy). 393 If the specification for a SASL mechanism, SASL application protocol, 394 or non-SASL application protocol uses the UsernameCaseMapped profile, 395 it MUST clearly describe whether case mapping is to be applied at the 396 level of the protocol itself, implementations thereof, or service 397 deployments (all of these approaches can be legitimate depending on 398 the application in question). 400 3.5. Application-Layer Constructs 402 Both the UsernameCaseMapped and UsernameCasePreserved profiles enable 403 an application protocol, implementation, or deployment to create 404 application-layer constructs such as a space-separated set of names 405 like "Firstname Middlename Lastname". Although such a construct is 406 not a PRECIS profile (since U+0020 SPACE is not allowed in the 407 IdentifierClass), it can be created at the application layer because 408 U+0020 SPACE can be used as a separator between instances of the 409 PRECIS IdentifierClass (or a profile thereof). 411 3.6. Examples 413 The following examples illustrate a small number of userparts (not 414 usernames) that are consistent with the format defined above (note 415 that the characters < and > are used here to delineate the actual 416 userparts and are not part of the userpart strings). 418 Table 1: A sample of legal userparts 420 +--------------------------+---------------------------------+ 421 | # | Userpart | Notes | 422 +--------------------------+---------------------------------+ 423 | 1 | | The at-sign is allowed in the | 424 | | | PRECIS IdentifierClass | 425 +--------------------------+---------------------------------+ 426 | 2 | | | 427 +--------------------------+---------------------------------+ 428 | 3 | | The third character is LATIN | 429 | | | SMALL LETTER SHARP S (U+00DF) | 430 +--------------------------+---------------------------------+ 431 | 4 | <π> | A userpart of GREEK SMALL | 432 | | | LETTER PI (U+03C0) | 433 +--------------------------+---------------------------------+ 434 | 5 | <Σ> | A userpart of GREEK CAPITAL | 435 | | | LETTER SIGMA (U+03A3) | 436 +--------------------------+---------------------------------+ 437 | 6 | <σ> | A userpart of GREEK SMALL | 438 | | | LETTER SIGMA (U+03C3) | 439 +--------------------------+---------------------------------+ 440 | 7 | <ς> | A userpart of GREEK SMALL | 441 | | | LETTER FINAL SIGMA (U+03C2) | 442 +--------------------------+---------------------------------+ 444 Several points are worth noting. Regarding examples 2 and 3: 445 although in German the character eszett (LATIN SMALL LETTER SHARP S, 446 U+00DF) can mostly be used interchangeably with the two characters 447 "ss", the userparts in these examples are different and (if desired) 448 a server would need to enforce a registration policy that disallows 449 one of them if the other is registered. Regarding examples 5, 6, and 450 7: optional case-mapping of GREEK CAPITAL LETTER SIGMA (U+03A3) to 451 lowercase (i.e., to GREEK SMALL LETTER SIGMA, U+03C3) during 452 comparison would result in matching the userparts in examples 5 and 453 6; however, because the PRECIS mapping rules do not account for the 454 special status of GREEK SMALL LETTER FINAL SIGMA (U+03C2), the 455 userparts in examples 5 and 7 or examples 6 and 7 would not be 456 matched during comparison. 458 The following examples illustrate strings that are not valid 459 userparts (not usernames) because they violate the format defined 460 above. 462 Table 2: A sample of strings that violate the userpart rule 464 +--------------------------+---------------------------------+ 465 | # | Non-Userpart string | Notes | 466 +--------------------------+---------------------------------+ 467 | 8 | | Space (U+0020) is disallowed in | 468 | | | the userpart | 469 +--------------------------+---------------------------------+ 470 | 9 | <> | Zero-length userpart | 471 +--------------------------+---------------------------------+ 472 | 10| | The sixth character is ROMAN | 473 | | | NUMERAL FOUR (U+2163) | 474 +--------------------------+---------------------------------+ 475 | 11| <♚> | A localpart of BLACK CHESS KING | 476 | | | (U+265A) | 477 +--------------------------+---------------------------------+ 479 Here again, several points are worth noting. Regarding example 10, 480 the Unicode character ROMAN NUMERAL FOUR (U+2163) has a compatibility 481 equivalent of the string formed of LATIN CAPITAL LETTER I (U+0049) 482 and LATIN CAPITAL LETTER V (U+0056), but characters with 483 compatibility equivalents are not allowed in the PRECIS 484 IdentiferClass. Regarding example 11: symbol characters such as 485 BLACK CHESS KING (U+265A) are not allowed in the PRECIS 486 IdentifierClass. 488 4. Passwords 490 4.1. Definition 492 This document specifies that a password is a string of Unicode code 493 points [Unicode], encoded using UTF-8 [RFC3629], and conformant to 494 OpaqueString profile of the PRECIS FreeformClass specified below. 496 The syntax for a password is defined as follows using the Augmented 497 Backus-Naur Form (ABNF) [RFC5234]. 499 password = 1*(freebyte) 500 ; 501 ; a "freebyte" is a byte used to represent a 502 ; UTF-8 encoded Unicode code point that can be 503 ; contained in a string that conforms to the 504 ; PRECIS "FreeformClass" 505 ; 507 All code points and blocks not explicitly allowed in the PRECIS 508 FreeformClass are disallowed; this includes private use characters, 509 surrogate code points, and the other code points and blocks defined 510 as "Prohibited Output" in Section 2.3 of RFC 4013. 512 A password MUST NOT be zero bytes in length. This rule is to be 513 enforced after any normalization and mapping of code points. 515 Note: Some existing systems allow an empty string in places where 516 a password would be expected (e.g., command-line tools that might 517 be called from an automated script, or servers that might need to 518 be restarted without human intervention). From the perspective of 519 this document (and RFC 4013 before it), these empty strings are 520 not passwords but are workarounds for the practical difficulty of 521 using passwords in certain scenarios. The prohibition on zero- 522 length passwords is not a recommendation regarding password 523 strength (since a password of only one byte is highly insecure), 524 but is meant to prevent applications from mistakenly omitting a 525 password entirely, since when internationalized characters are 526 accepted a non-empty sequence of characters can result in a zero- 527 length password after canonicalization. 529 In protocols that provide passwords as input to a cryptographic 530 algorithm such as a hash function, the client will need to perform 531 proper preparation of the password before applying the algorithm, 532 since the password is not available to the server in plaintext form. 534 4.2. OpaqueString Profile 536 The definition of the OpaqueString profile is provided in the 537 following sections, including detailed information about preparation, 538 enforcement, and comparison (on the distinction between these 539 actions, refer to [RFC7564]). 541 4.2.1. Preparation 543 An entity that prepares a string according to this profile MUST 544 ensure that the string consists only of Unicode code points that 545 conform to the "FreeformClass" base string class defined in 546 [RFC7564]. In addition, the string MUST be encoded as UTF-8 547 [RFC3629]. 549 4.2.2. Enforcement 551 An entity that performs enforcement according to this profile MUST 552 prepare a string as described in the previous section and MUST also 553 apply the rules specified below (these rules MUST be applied in the 554 order shown). 556 1. Width Mapping Rule: Fullwidth and halfwidth characters MUST NOT 557 be mapped to their decomposition mappings (see Unicode Standard 558 Annex #11 [UAX11]). 560 2. Additional Mapping Rule: Any instances of non-ASCII space MUST be 561 mapped to ASCII space (U+0020); a non-ASCII space is any Unicode 562 code point having a general category of "Zs", naturally with the 563 exception of U+0020. 565 3. Case Mapping Rule: Uppercase and titlecase characters MUST NOT be 566 mapped to their lowercase equivalents. 568 4. Normalization Rule: Unicode Normalization Form C (NFC) MUST be 569 applied to all characters. 571 5. Directionality Rule: There is no directionality rule. The "Bidi 572 Rule" (defined in [RFC5893]) and similar rules are unnecessary 573 and inapplicable to passwords, since they can reduce the range of 574 characters that are allowed in a string and therefore reduce the 575 amount of entropy that is possible in a password. Such rules are 576 intended to minimize the possibility that the same string will be 577 displayed differently on a layout system set for right-to-left 578 display and a layout system set for left-to-right display; 579 however, passwords are typically not displayed at all and are 580 rarely meant to be interoperable across different layout systems 581 in the way that non-secret strings like domain names and 582 usernames are. Furthermore, it is perfectly acceptable for 583 opaque strings other than passwords to be presented differently 584 in different layout systems, as long as the presentation is 585 consistent in any given layout system. 587 4.2.3. Comparison 589 An entity that performs comparison of two strings according to this 590 profile MUST prepare each string and enforce the rules specified in 591 the previous two sections. The two strings are to be considered 592 equivalent if they are an exact octet-for-octet match (sometimes 593 called "bit-string identity"). 595 4.3. Examples 597 The following examples illustrate a small number of passwords that 598 are consistent with the format defined above (note that the 599 characters < and > are used here to delineate the actual passwords 600 and are not part of the password strings). 602 Table 3: A sample of legal passwords 604 +------------------------------------+------------------------------+ 605 | # | Password | Notes | 606 +------------------------------------+------------------------------+ 607 | 12| | ASCII space is allowed | 608 +------------------------------------+------------------------------+ 609 | 13| | Different from example 12 | 610 +------------------------------------+------------------------------+ 611 | 14| <πßå> | Non-ASCII letters are OK | 612 | | | (e.g., GREEK SMALL LETTER | 613 | | | PI, U+03C0) | 614 +------------------------------------+------------------------------+ 615 | 15| | Symbols are OK (e.g., BLACK | 616 | | | DIAMOND SUIT, U+2666) | 617 +------------------------------------+------------------------------+ 618 | 16| | OGHAM SPACE MARK, U+1680, is | 619 | | | mapped to U+0020 and thus | 620 | | | the full string is mapped to | 621 | | | | 622 +------------------------------------+------------------------------+ 624 The following example illustrates a string that is not a valid 625 password because it violates the format defined above. 627 Table 4: A string that violates the password rules 629 +------------------------------------+------------------------------+ 630 | # | Password | Notes | 631 +------------------------------------+------------------------------+ 632 | 17| | Controls are disallowed | 633 +------------------------------------+------------------------------+ 635 5. Use in Application Protocols 637 This specification defines only the PRECIS-based rules for handling 638 of strings conforming to the UsernameCaseMapped and 639 UsernameCasePreserved profiles of the PRECIS IdentifierClass, and 640 strings conforming to the OpaqueString profile of the PRECIS 641 FreeformClass. It is the responsibility of an application protocol 642 to specify the protocol slots in which such strings can appear, the 643 entities that are expected to enforce the rules governing such 644 strings, and when in protocol processing or interface handling the 645 rules need to be enforced. See Section 6 of [RFC7564] for guidelines 646 about using PRECIS profiles in applications. 648 Above and beyond the PRECIS-based rules specified here, application 649 protocols can also define application-specific rules governing such 650 strings (rules regarding minimum or maximum length, further 651 restrictions on allowable characters or character ranges, safeguards 652 to mitigate the effects of visually similar characters, etc.), 653 application-layer constructs (see Section 3.5), and related matters. 655 Some PRECIS profile definitions encourage entities that enforce the 656 rules to be liberal in what they accept. However, for usernames and 657 passwords such a policy can be problematic since it can lead to false 658 positives. An in-depth discussion can be found in "Issues in 659 Identifier Comparison for Security Purposes" [RFC6943]. 661 6. Migration 663 The rules defined in this specification differ slightly from those 664 defined by the SASLprep specification [RFC4013]. The following 665 sections describe these differences, along with their implications 666 for migration, in more detail. 668 6.1. Usernames 670 Deployments that currently use SASLprep for handling usernames might 671 need to scrub existing data when migrating to use of the rules 672 defined in this specification. In particular: 674 o SASLprep specified the use of Unicode Normalization Form KC 675 (NFKC), whereas the UsernameCaseMapped and UsernameCasePreserved 676 profiles employ Unicode Normalization Form C (NFC). In practice 677 this change is unlikely to cause significant problems, because 678 NFKC provides methods for mapping Unicode code points with 679 compatibility equivalents to those equivalents, whereas the PRECIS 680 IdentifierClass entirely disallows Unicode code points with 681 compatibility equivalents (i.e., during comparison NFKC is more 682 "aggressive" about finding matches than NFC). A few examples 683 might suffice to indicate the nature of the problem: 685 1. U+017F LATIN SMALL LETTER LONG S is compatibility equivalent 686 to U+0073 LATIN SMALL LETTER S 688 2. U+2163 ROMAN NUMERAL FOUR is compatibility equivalent to 689 U+0049 LATIN CAPITAL LETTER I and U+0056 LATIN CAPITAL LETTER 690 V 692 3. U+FB01 LATIN SMALL LIGATURE FI is compatibility equivalent to 693 U+0066 LATIN SMALL LETTER F and U+0069 LATIN SMALL LETTER I 695 Under SASLprep, the use of NFKC also handled the mapping of 696 fullwidth and halfwidth code points to their decomposition 697 mappings. 699 For migration purposes operators might want to search their 700 database of usernames for names containing Unicode code points 701 with compatibility equivalents and, where there is no conflict, 702 map those code points to their equivalents. Naturally, it is 703 possible that during this process the operator will discover 704 conflicting usernames (e.g., HENRYIV with the last two characters 705 being U+0049 LATIN CAPITAL LETTER I and U+0056 LATIN CAPITAL 706 LETTER V vs. "HENRYIV" with the last character being U+2163 ROMAN 707 NUMERAL FOUR, which is compatibility equivalent to U+0049 and 708 U+0056); in these cases the operator will need to determine how to 709 proceed, for instance by disabling the account whose name contains 710 a Unicode code point with a compatibility equivalent. Such cases 711 are probably rare, but it is important for operators to be aware 712 of them. 714 o SASLprep mapped the "characters commonly mapped to nothing" from 715 Appendix B.1 of [RFC3454]) to nothing, whereas the PRECIS 716 IdentifierClass entirely disallows most of these characters, which 717 correspond to the code points from the "M" category defined under 718 Section 9.13 of [RFC7564] (with the exception of U+1806 MONGOLIAN 719 TODO SOFT HYPHEN, which was "commonly mapped to nothing" in 720 Unicode 3.2 but at the time of this writing does not have a 721 derived property of Default_Ignorable_Code_Point in Unicode 7.0). 722 For migration purposes, the operator might want to remove from 723 usernames any code points contained in the PRECIS "M" category 724 (e.g., U+00AD SOFT HYPHEN). Because these code points would have 725 been "mapped to nothing" in Stringprep, in practice a user would 726 not notice the difference if upon migration to PRECIS the code 727 points are removed. 729 o SASLprep allowed uppercase and titlecase characters, whereas the 730 UsernameCaseMapped profile maps uppercase and titlecase characters 731 to their lowercase equivalents (by contrast, the 732 UsernameCasePreserved profile matches SASLprep in this regard). 733 For migration purposes, the operator can either use the 734 UsernameCaseMapped profile (thus losing the case information) or 735 use the UsernameCasePreserved profile (thus ignoring case 736 difference when comparing usernames). 738 6.2. Passwords 740 Depending on local service policy, migration from RFC 4013 to this 741 specification might not involve any scrubbing of data (since 742 passwords might not be stored in the clear anyway); however, service 743 providers need to be aware of possible issues that might arise during 744 migration. In particular: 746 o SASLprep specified the use of Unicode Normalization Form KC 747 (NFKC), whereas the OpaqueString profile employs Unicode 748 Normalization Form C (NFC). Because NFKC is more aggressive about 749 finding matches than NFC, in practice this change is unlikely to 750 cause significant problems and indeed has the security benefit of 751 probably resulting in fewer false positives when comparing 752 passwords. A few examples might suffice to indicate the nature of 753 the problem: 755 1. U+017F LATIN SMALL LETTER LONG S is compatibility equivalent 756 to U+0073 LATIN SMALL LETTER S 758 2. U+2163 ROMAN NUMERAL FOUR is compatibility equivalent to 759 U+0049 LATIN CAPITAL LETTER I and U+0056 LATIN CAPITAL LETTER 760 V 762 3. U+FB01 LATIN SMALL LIGATURE FI is compatibility equivalent to 763 U+0066 LATIN SMALL LETTER F and U+0069 LATIN SMALL LETTER I 765 Under SASLprep, the use of NFKC also handled the mapping of 766 fullwidth and halfwidth code points to their decomposition 767 mappings. Although it is expected that code points with 768 compatibility equivalents are rare in existing passwords, some 769 passwords that matched when SASLprep was used might no longer work 770 when the rules in this specification are applied. 772 o SASLprep mapped the "characters commonly mapped to nothing" from 773 Appendix B.1 of [RFC3454]) to nothing, whereas the PRECIS 774 FreeformClass entirely disallows such characters, which correspond 775 to the code points from the "M" category defined under 776 Section 9.13 of [RFC7564] (with the exception of U+1806 MONGOLIAN 777 TODO SOFT HYPHEN, which was commonly mapped to nothing in Unicode 778 3.2 but at the time of this writing is allowed by Unicode 7.0). 779 In practice, this change will probably have no effect on 780 comparison, but user-oriented software might reject such code 781 points instead of ignoring them during password preparation. 783 7. IANA Considerations 785 The IANA shall add the following entries to the PRECIS Profiles 786 Registry. 788 7.1. UsernameCaseMapped Profile 790 Name: UsernameCaseMapped. 792 Base Class: IdentifierClass. 794 Applicability: Usernames in security and application protocols. 796 Replaces: The SASLprep profile of Stringprep. 798 Width Mapping Rule: Map fullwidth and halfwidth characters to their 799 decomposition mappings. 801 Additional Mapping Rule: None. 803 Case Mapping Rule: Map uppercase and titlecase characters to 804 lowercase. 806 Normalization Rule: NFC. 808 Directionality Rule: The "Bidi Rule" defined in RFC 5893 applies. 810 Enforcement: To be defined by security or application protocols that 811 use this profile. 813 Specification: RFC XXXX, Section 3.2. [Note to RFC Editor: please 814 change XXXX to the number issued for this specification.] 816 7.2. UsernameCasePreserved Profile 818 Name: UsernameCasePreserved. 820 Base Class: IdentifierClass. 822 Applicability: Usernames in security and application protocols. 824 Replaces: The SASLprep profile of Stringprep. 826 Width Mapping Rule: Map fullwidth and halfwidth characters to their 827 decomposition mappings. 829 Additional Mapping Rule: None. 831 Case Mapping Rule: None. 833 Normalization Rule: NFC. 835 Directionality Rule: The "Bidi Rule" defined in RFC 5893 applies. 837 Enforcement: To be defined by security or application protocols that 838 use this profile. 840 Specification: RFC XXXX, Section 3.3. [Note to RFC Editor: please 841 change XXXX to the number issued for this specification.] 843 7.3. OpaqueString Profile 845 Name: OpaqueString. 847 Base Class: FreeformClass. 849 Applicability: Passwords and other opaque strings in security and 850 application protocols. 852 Replaces: The SASLprep profile of Stringprep. 854 Width Mapping Rule: None. 856 Additional Mapping Rule: Map non-ASCII space characters to ASCII 857 space. 859 Case Mapping Rule: None. 861 Normalization Rule: NFC. 863 Directionality Rule: None. 865 Enforcement: To be defined by security or application protocols that 866 use this profile. 868 Specification: RFC XXXX, Section 4.2. [Note to RFC Editor: please 869 change XXXX to the number issued for this specification.] 871 8. Security Considerations 873 8.1. Password/Passphrase Strength 875 The ability to include a wide range of characters in passwords and 876 passphrases can increase the potential for creating a strong password 877 with high entropy. However, in practice, the ability to include such 878 characters ought to be weighed against the possible need to reproduce 879 them on various devices using various input methods. 881 8.2. Identifier Comparison 883 The process of comparing identifiers (such as SASL simple user names, 884 authentication identifiers, and authorization identifiers) can lead 885 to either false negatives or false positives, both of which have 886 security implications. A more detailed discussion can be found in 887 [RFC6943]. 889 8.3. Reuse of PRECIS 891 The security considerations described in [RFC7564] apply to the 892 "IdentifierClass" and "FreeformClass" base string classes used in 893 this document for usernames and passwords, respectively. 895 8.4. Reuse of Unicode 897 The security considerations described in [UTS39] apply to the use of 898 Unicode characters in usernames and passwords. 900 9. References 902 9.1. Normative References 904 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 905 Requirement Levels", BCP 14, RFC 2119, March 1997. 907 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 908 10646", STD 63, RFC 3629, November 2003. 910 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 911 Specifications: ABNF", STD 68, RFC 5234, January 2008. 913 [RFC5890] Klensin, J., "Internationalized Domain Names for 914 Applications (IDNA): Definitions and Document Framework", 915 RFC 5890, August 2010. 917 [RFC6365] Hoffman, P. and J. Klensin, "Terminology Used in 918 Internationalization in the IETF", BCP 166, RFC 6365, 919 September 2011. 921 [RFC7564] Saint-Andre, P. and M. Blanchet, "PRECIS Framework: 922 Preparation, Enforcement, and Comparison of 923 Internationalized Strings in Application Protocols", RFC 924 7564, May 2015. 926 [UAX11] The Unicode Consortium, "Unicode Standard Annex #11: East 927 Asian Width", September 2012, 928 . 930 [Unicode7.0] 931 The Unicode Consortium, "The Unicode Standard, Version 932 7.0.0", 2014, 933 . 935 [Unicode] The Unicode Consortium, "The Unicode Standard", 936 2015-present, . 938 9.2. Informative References 940 [I-D.ietf-httpauth-basicauth-update] 941 Reschke, J., "The 'Basic' HTTP Authentication Scheme", 942 draft-ietf-httpauth-basicauth-update-07 (work in 943 progress), February 2015. 945 [I-D.ietf-httpauth-digest] 946 Shekh-Yusef, R., Ahrens, D., and S. Bremer, "HTTP Digest 947 Access Authentication", draft-ietf-httpauth-digest-19 948 (work in progress), April 2015. 950 [I-D.ietf-xmpp-6122bis] 951 Saint-Andre, P., "Extensible Messaging and Presence 952 Protocol (XMPP): Address Format", draft-ietf-xmpp- 953 6122bis-22 (work in progress), May 2015. 955 [RFC20] Cerf, V., "ASCII format for network interchange", RFC 20, 956 October 1969. 958 [RFC3454] Hoffman, P. and M. Blanchet, "Preparation of 959 Internationalized Strings ("stringprep")", RFC 3454, 960 December 2002. 962 [RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 963 4rev1", RFC 3501, March 2003. 965 [RFC4013] Zeilenga, K., "SASLprep: Stringprep Profile for User Names 966 and Passwords", RFC 4013, February 2005. 968 [RFC4422] Melnikov, A., Ed. and K. Zeilenga, Ed., "Simple 969 Authentication and Security Layer (SASL)", RFC 4422, June 970 2006. 972 [RFC4616] Zeilenga, K., "The PLAIN Simple Authentication and 973 Security Layer (SASL) Mechanism", RFC 4616, August 2006. 975 [RFC5802] Newman, C., Menon-Sen, A., Melnikov, A., and N. Williams, 976 "Salted Challenge Response Authentication Mechanism 977 (SCRAM) SASL and GSS-API Mechanisms", RFC 5802, July 2010. 979 [RFC5891] Klensin, J., "Internationalized Domain Names in 980 Applications (IDNA): Protocol", RFC 5891, August 2010. 982 [RFC5893] Alvestrand, H. and C. Karp, "Right-to-Left Scripts for 983 Internationalized Domain Names for Applications (IDNA)", 984 RFC 5893, August 2010. 986 [RFC5894] Klensin, J., "Internationalized Domain Names for 987 Applications (IDNA): Background, Explanation, and 988 Rationale", RFC 5894, August 2010. 990 [RFC6120] Saint-Andre, P., "Extensible Messaging and Presence 991 Protocol (XMPP): Core", RFC 6120, March 2011. 993 [RFC6122] Saint-Andre, P., "Extensible Messaging and Presence 994 Protocol (XMPP): Address Format", RFC 6122, March 2011. 996 [RFC6943] Thaler, D., "Issues in Identifier Comparison for Security 997 Purposes", RFC 6943, May 2013. 999 [RFC7542] DeKok, A., "The Network Access Identifier", RFC 7542, May 1000 2015. 1002 [UTS39] The Unicode Consortium, "Unicode Technical Standard #39: 1003 Unicode Security Mechanisms", July 2012, 1004 . 1006 Appendix A. Differences from RFC 4013 1008 This document builds upon the PRECIS framework defined in [RFC7564], 1009 which differs fundamentally from the Stringprep technology [RFC3454] 1010 used in SASLprep [RFC4013]. The primary difference is that 1011 Stringprep profiles allowed all characters except those which were 1012 explicitly disallowed, whereas PRECIS profiles disallow all 1013 characters except those which are explicitly allowed (this "inclusion 1014 model" was originally used for internationalized domain names in 1015 [RFC5891]; see [RFC5894] for further discussion). It is important to 1016 keep this distinction in mind when comparing the technology defined 1017 in this document to SASLprep [RFC4013]. 1019 The following substantive modifications were made from RFC 4013. 1021 o A single SASLprep algorithm was replaced by three separate 1022 algorithms: one for usernames with case mapping, one for usernames 1023 with case preservation, and one for passwords. 1025 o The new preparation algorithms use PRECIS instead of a Stringprep 1026 profile. The new algorithms work independenctly of Unicode 1027 versions. 1029 o As recommended in the PRECIS framework, changed the Unicode 1030 normalization form from NFKC to NFC. 1032 o Some Unicode code points that were mapped to nothing in RFC 4013 1033 are simply disallowed by PRECIS. 1035 Appendix B. Acknowledgements 1037 This document borrows some text from [RFC4013] and [RFC6120]. 1039 The following individuals provided helpful feedback on this document: 1040 Marc Blanchet, Ben Campbell, Alan DeKok, Joe Hildebrand, Jeffrey 1041 Hutzelman, Simon Josefsson, Jonathan Lennox, James Manger, Matt 1042 Miller, Chris Newman, Yutaka OIWA, Pete Resnick, Andrew Sullivan, 1043 Nico Williams, and Yoshiro YONEYA. Nico Williams in particular 1044 deserves special recognition for providing text that was used in 1045 Section 3.4. Thanks also to Takahiro NEMOTO and Yoshiro YONEYA for 1046 implementation feedback. 1048 Robert Sparks and Derek Atkins reviewed the document on behalf of the 1049 General Area Review Team and the Security Directorate, respectively. 1051 Stephen Farrell provided helpful input during IESG review. 1053 Peter Saint-Andre wishes to acknowledge Cisco Systems, Inc., for 1054 employing him during his work on earlier draft versions of this 1055 document. 1057 Authors' Addresses 1059 Peter Saint-Andre 1060 &yet 1062 Email: peter@andyet.com 1063 URI: https://andyet.com/ 1065 Alexey Melnikov 1066 Isode Ltd 1067 5 Castle Business Village 1068 36 Station Road 1069 Hampton, Middlesex TW12 2BX 1070 UK 1072 Email: Alexey.Melnikov@isode.com