idnits 2.17.1 draft-ietf-precis-saslprepbis-11.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 : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (November 26, 2014) is 3440 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Outdated reference: A later version (-23) exists of draft-ietf-precis-framework-20 -- Possible downref: Non-RFC (?) normative reference: ref. 'UNICODE' == Outdated reference: A later version (-07) exists of draft-ietf-httpauth-basicauth-update-02 == Outdated reference: A later version (-19) exists of draft-ietf-httpauth-digest-08 == Outdated reference: A later version (-15) exists of draft-ietf-radext-nai-11 -- Obsolete informational reference (is this intentional?): RFC 2617 (Obsoleted by RFC 7235, RFC 7615, RFC 7616, RFC 7617) -- 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) Summary: 0 errors (**), 0 flaws (~~), 5 warnings (==), 6 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: May 30, 2015 November 26, 2014 8 Preparation, Enforcement, and Comparison of Internationalized Strings 9 Representing Usernames and Passwords 10 draft-ietf-precis-saslprepbis-11 12 Abstract 14 This document describes methods for handling Unicode strings 15 representing usernames and passwords. This document obsoletes RFC 16 4013. 18 Status of This Memo 20 This Internet-Draft is submitted in full conformance with the 21 provisions of BCP 78 and BCP 79. 23 Internet-Drafts are working documents of the Internet Engineering 24 Task Force (IETF). Note that other groups may also distribute 25 working documents as Internet-Drafts. The list of current Internet- 26 Drafts is at http://datatracker.ietf.org/drafts/current/. 28 Internet-Drafts are draft documents valid for a maximum of six months 29 and may be updated, replaced, or obsoleted by other documents at any 30 time. It is inappropriate to use Internet-Drafts as reference 31 material or to cite them other than as "work in progress." 33 This Internet-Draft will expire on May 30, 2015. 35 Copyright Notice 37 Copyright (c) 2014 IETF Trust and the persons identified as the 38 document authors. All rights reserved. 40 This document is subject to BCP 78 and the IETF Trust's Legal 41 Provisions Relating to IETF Documents 42 (http://trustee.ietf.org/license-info) in effect on the date of 43 publication of this document. Please review these documents 44 carefully, as they describe your rights and restrictions with respect 45 to this document. Code Components extracted from this document must 46 include Simplified BSD License text as described in Section 4.e of 47 the Trust Legal Provisions and are provided without warranty as 48 described in the Simplified BSD License. 50 Table of Contents 52 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 53 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4 54 3. Usernames . . . . . . . . . . . . . . . . . . . . . . . . . . 4 55 3.1. Definition . . . . . . . . . . . . . . . . . . . . . . . 4 56 3.2. UsernameCaseMapped Profile . . . . . . . . . . . . . . . 5 57 3.2.1. Preparation . . . . . . . . . . . . . . . . . . . . . 5 58 3.2.2. Enforcement . . . . . . . . . . . . . . . . . . . . . 6 59 3.2.3. Comparison . . . . . . . . . . . . . . . . . . . . . 6 60 3.3. UsernameCasePreserved Profile . . . . . . . . . . . . . . 6 61 3.3.1. Preparation . . . . . . . . . . . . . . . . . . . . . 6 62 3.3.2. Enforcement . . . . . . . . . . . . . . . . . . . . . 7 63 3.3.3. Comparison . . . . . . . . . . . . . . . . . . . . . 7 64 3.4. Case Mapping vs. Case Preservation . . . . . . . . . . . 7 65 3.5. Application-Layer Constructs . . . . . . . . . . . . . . 9 66 3.6. Examples . . . . . . . . . . . . . . . . . . . . . . . . 9 67 4. Passwords . . . . . . . . . . . . . . . . . . . . . . . . . . 10 68 4.1. Definition . . . . . . . . . . . . . . . . . . . . . . . 10 69 4.2. Password Profile . . . . . . . . . . . . . . . . . . . . 11 70 4.2.1. Preparation . . . . . . . . . . . . . . . . . . . . . 11 71 4.2.2. Enforcement . . . . . . . . . . . . . . . . . . . . . 12 72 4.2.3. Comparison . . . . . . . . . . . . . . . . . . . . . 12 73 4.3. Examples . . . . . . . . . . . . . . . . . . . . . . . . 12 74 5. Migration . . . . . . . . . . . . . . . . . . . . . . . . . . 13 75 5.1. Usernames . . . . . . . . . . . . . . . . . . . . . . . . 13 76 5.2. Passwords . . . . . . . . . . . . . . . . . . . . . . . . 15 77 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 16 78 6.1. UsernameCaseMapped Profile . . . . . . . . . . . . . . . 16 79 6.2. UsernameCasePreserved Profile . . . . . . . . . . . . . . 16 80 6.3. Password Profile . . . . . . . . . . . . . . . . . . . . 17 81 7. Security Considerations . . . . . . . . . . . . . . . . . . . 17 82 7.1. Password/Passphrase Strength . . . . . . . . . . . . . . 17 83 7.2. Identifier Comparison . . . . . . . . . . . . . . . . . . 18 84 7.3. Reuse of PRECIS . . . . . . . . . . . . . . . . . . . . . 18 85 7.4. Reuse of Unicode . . . . . . . . . . . . . . . . . . . . 18 86 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 18 87 8.1. Normative References . . . . . . . . . . . . . . . . . . 18 88 8.2. Informative References . . . . . . . . . . . . . . . . . 18 89 Appendix A. Differences from RFC 4013 . . . . . . . . . . . . . 20 90 Appendix B. Acknowledgements . . . . . . . . . . . . . . . . . . 21 91 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 21 93 1. Introduction 95 Usernames and passwords are widely used for authentication and 96 authorization on the Internet, either directly when provided in 97 plaintext (as in the SASL PLAIN mechanism [RFC4616] or the HTTP Basic 98 scheme [RFC2617] / [I-D.ietf-httpauth-basicauth-update]) or 99 indirectly when provided as the input to a cryptographic algorithm 100 such as a hash function (as in the SASL SCRAM mechanism [RFC5802] or 101 the HTTP Digest scheme [RFC2617] / [I-D.ietf-httpauth-digest]). 103 To increase the likelihood that the input and comparison of usernames 104 and passwords will work in ways that make sense for typical users 105 throughout the world, this document defines rules for preparing, 106 enforcing, and comparing internationalized strings that represent 107 usernames and passwords. Such strings consist of characters from the 108 Unicode character set [UNICODE], with special attention to characters 109 outside the ASCII range [RFC20]. The rules for handling such strings 110 are specified through profiles of the string classes defined in the 111 PRECIS framework specification [I-D.ietf-precis-framework]. 113 Profiles of the PRECIS framework enable software to handle Unicode 114 characters outside the ASCII range in an automated way, so that such 115 characters are treated carefully and consistently in application 116 protocols. In large measure, these profiles are designed to protect 117 application developers from the potentially negative consequences of 118 supporting the full range of Unicode characters. For instance, in 119 almost all application protocols it would be dangerous to treat the 120 Unicode character SUPERSCRIPT ONE (U+0089) as equivalent to DIGIT ONE 121 (U+0031), since that would result in false positives during 122 comparison, authentication, and authorization (e.g., an attacker 123 could easy spoof an account "user1@example.com"). 125 Whereas a naive use of Unicode would make such attacks trivially 126 easy, the PRECIS profile defined here for usernames generally 127 protects applications from inadvertently causing such problems. 128 (Similar considerations apply to passwords, although here it is 129 desirable to support a wider range of characters so as to maximize 130 entropy during authentication.) 132 The methods defined here might be applicable wherever usernames or 133 passwords are used. However, the methods are not intended for use in 134 preparing strings that are not usernames (e.g., email addresses and 135 LDAP distinguished names), nor in cases where identifiers or secrets 136 are not strings (e.g., keys and certificates) or require specialized 137 handling. 139 This document obsoletes RFC 4013 (the "SASLprep" profile of 140 stringprep [RFC3454]) but can be used by technologies other than the 141 Simple Authentication and Security Layer (SASL) [RFC4422], such as 142 HTTP authentication [RFC2617] / [I-D.ietf-httpauth-basicauth-update] 143 / [I-D.ietf-httpauth-digest]. 145 2. Terminology 147 Many important terms used in this document are defined in 148 [I-D.ietf-precis-framework], [RFC5890], [RFC6365], and [UNICODE]. 149 The term "non-ASCII space" refers to any Unicode code point having a 150 general category of "Zs", with the exception of U+0020 (here called 151 "ASCII space"). 153 As used here, the term "password" is not literally limited to a word; 154 i.e., a password could be a passphrase consisting of more than one 155 word, perhaps separated by spaces or other such characters. 157 Some SASL mechanisms (e.g., CRAM-MD5, DIGEST-MD5, and SCRAM) specify 158 that the authentication identity used in the context of such 159 mechanisms is a "simple user name" (see Section 2 of [RFC4422] as 160 well as [RFC4013]). Various application technologies also assume 161 that the identity of a user or account takes the form of a username 162 (e.g., authentication for the HyperText Transfer Protocol [RFC2617] / 163 [I-D.ietf-httpauth-basicauth-update] / [I-D.ietf-httpauth-digest]), 164 whether or not they use SASL. Note well that the exact form of a 165 username in any particular SASL mechanism or application technology 166 is a matter for implementation and deployment, and that a username 167 does not necessarily map to any particular application identifier 168 (such as the localpart of an email address). 170 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 171 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 172 "OPTIONAL" in this document are to be interpreted as described in 173 [RFC2119]. 175 3. Usernames 177 3.1. Definition 179 This document specifies that a username is a string of Unicode code 180 points [UNICODE], encoded using UTF-8 [RFC3629], and structured as an 181 ordered sequence of "userparts" (where the complete username can 182 consist of a single userpart or a space-separated sequence of 183 userparts). 185 The syntax for a username is defined as follows using the Augmented 186 Backus-Naur Form (ABNF) [RFC5234]. 188 username = userpart *(1*SP userpart) 189 userpart = 1*(idbyte) 190 ; 191 ; an "idbyte" is a byte used to represent a 192 ; UTF-8 encoded Unicode code point that can be 193 ; contained in a string that conforms to the 194 ; PRECIS "IdentifierClass" 195 ; 197 All code points and blocks not explicitly allowed in the PRECIS 198 IdentifierClass are disallowed; this includes private use characters, 199 surrogate code points, and the other code points and blocks that were 200 defined as "Prohibited Output" in [RFC4013]. In addition, common 201 constructions such as "user@example.com" are allowed as usernames 202 under this specification, as they were under [RFC4013]. 204 Implementation Note: The username construct defined in this 205 document does not necessarily match what all deployed applications 206 might refer to as a "username" or "userid", but instead provides a 207 relatively safe subset of Unicode characters that can be used in 208 existing SASL mechanisms and SASL-using application protocols, and 209 even in most application protocols that do not currently use SASL. 211 A username MUST NOT be zero bytes in length. This rule is to be 212 enforced after any normalization and mapping of code points. 214 In protocols that provide usernames as input to a cryptographic 215 algorithm such as a hash function, the client will need to perform 216 proper preparation of the username before applying the algorithm. 218 This specification defines two profiles for usernames: one that 219 performs case mapping and one that performs case preservation (see 220 further discussion under Section 3.4). 222 3.2. UsernameCaseMapped Profile 224 The definition of the UsernameCaseMapped profile of the 225 IdentifierClass is provided in the following sections, including 226 detailed information about preparation, enforcement, and comparison 227 (on the distinction between these actions, refer to 228 [I-D.ietf-precis-framework]). 230 3.2.1. Preparation 232 An entity that prepares a string according to this profile MUST 233 ensure that the string consists only of Unicode code points that 234 conform to the "IdentifierClass" base string class defined in 236 [I-D.ietf-precis-framework]. In addition, the string MUST be encoded 237 as UTF-8 [RFC3629]. 239 3.2.2. Enforcement 241 An entity that performs enforcement according to this profile MUST 242 prepare a string as described in the previous section and MUST also 243 apply the rules specified below for the UsernameCaseMapped profile 244 (these rules MUST be applied in the order shown). 246 1. Width Mapping Rule: Fullwidth and halfwidth characters MUST be 247 mapped to their decomposition mappings. 249 2. Additional Mapping Rule: There is no additional mapping rule. 251 3. Case Mapping Rule: Uppercase and titlecase characters MUST be 252 mapped to their lowercase equivalents, preferably using Unicode 253 Default Case Folding as defined in Chapter 3 of the Unicode 254 Standard [UNICODE]. 256 4. Normalization Rule: Unicode Normalization Form C (NFC) MUST be 257 applied to all characters. 259 5. Directionality Rule: Applications MUST apply the "Bidi Rule" 260 defined in [RFC5893] (i.e., each of the six conditions of the 261 Bidi Rule must be satisfied). 263 3.2.3. Comparison 265 An entity that performs comparison of two strings according to this 266 profile MUST prepare each string and enforce the rules specified in 267 the previous two sections. The two strings are to be considered 268 equivalent if they are an exact octet-for-octet match (sometimes 269 called "bit-string identity"). 271 3.3. UsernameCasePreserved Profile 273 The definition of the UsernameCasePreserved profile of the 274 IdentifierClass is provided in the following sections, including 275 detailed information about preparation, enforcement, and comparison 276 (on the distinction between these actions, refer to 277 [I-D.ietf-precis-framework]). 279 3.3.1. Preparation 281 An entity that prepares a string according to this profile MUST 282 ensure that the string consists only of Unicode code points that 283 conform to the "IdentifierClass" base string class defined in 285 [I-D.ietf-precis-framework]. In addition, the string MUST be encoded 286 as UTF-8 [RFC3629]. 288 3.3.2. Enforcement 290 An entity that performs enforcement according to this profile MUST 291 prepare a string as described in the previous section and MUST also 292 apply the rules specified below for the UsernameCasePreserved profile 293 (these rules MUST be applied in the order shown). 295 1. Width Mapping Rule: Fullwidth and halfwidth characters MUST be 296 mapped to their decomposition mappings. 298 2. Additional Mapping Rule: There is no additional mapping rule. 300 3. Case Mapping Rule: Uppercase and titlecase characters MUST NOT be 301 mapped to their lowercase equivalents. 303 4. Normalization Rule: Unicode Normalization Form C (NFC) MUST be 304 applied to all characters. 306 5. Directionality Rule: Applications MUST apply the "Bidi Rule" 307 defined in [RFC5893] (i.e., each of the six conditions of the 308 Bidi Rule must be satisfied). 310 3.3.3. Comparison 312 An entity that performs comparison of two strings according to this 313 profile MUST prepare each string and enforce the rules specified in 314 the previous two sections. The two strings are to be considered 315 equivalent if they are an exact octet-for-octet match (sometimes 316 called "bit-string identity"). 318 3.4. Case Mapping vs. Case Preservation 320 In order to accomodate the widest range of username constructs in 321 applications, this document defines two username profiles: 322 UsernameCaseMapped and UsernameCasePreserved. 324 Case mapping is a matter for the application protocol, protocol 325 implementation, or end deployment. In general, this document 326 suggests that it is preferable to apply the UsernameCaseMapped 327 profile and therefore perform case mapping, since not doing so can 328 lead to false positives during authentication and authorization (as 329 described in [RFC6943]) and can result in confusion among end users 330 given the prevalence of case mapping in many existing protocols and 331 applications. However, there can be good reasons to apply the 332 UsernameCasePreserved profile and thus not perform case mapping, such 333 as backward compatibility with deployed infrastructure. 335 In particular: 337 o SASL mechanisms that follow the recommendations in this document 338 MUST specify whether and when case mapping is to be applied to 339 authentication identifiers. SASL mechanisms SHOULD delay any case 340 mapping to the last possible moment, such as when doing a lookup 341 by username, username comparisons, or generating a cryptographic 342 salt from a username (if the last possible moment happens on the 343 server, then decisions about case mapping can be a matter of 344 deployment policy). In keeping with [RFC4422], SASL mechanisms 345 are not to apply this or any other profile to authorization 346 identifiers. 348 o Application protocols that use SASL (such as IMAP [RFC3501] and 349 XMPP [RFC6120]) and that directly re-use this profile MUST specify 350 whether case mapping is to be applied to authorization 351 identifiers. Such "SASL application protocols" SHOULD delay any 352 case mapping of authorization identifiers to the last possible 353 moment, which happens to necessarily be on the server side (this 354 enables decisions about case mapping to be a matter of deployment 355 policy). In keeping with [RFC4422], SASL application protocols 356 are not to apply this or any other profile to authentication 357 identifiers. 359 o Application protocols that do not use SASL (such as HTTP 360 authentication with the Basic and Digest schemes [RFC2617] / 361 [I-D.ietf-httpauth-basicauth-update] / [I-D.ietf-httpauth-digest]) 362 MUST specify whether and when case mapping is to be applied to 363 authentication identifiers and authorization identifiers. Such 364 "non-SASL application protocols" SHOULD delay any case mapping to 365 the last possible moment, such as when doing a lookup by username, 366 username comparisons, or generating a cryptographic salt from a 367 username (if the last possible moment happens on the server, then 368 decisions about case mapping can be a matter of deployment 369 policy). 371 If the specification for a SASL mechanism, SASL application protocol, 372 or non-SASL application protocol uses the UsernameCaseMapped profile, 373 it MUST clearly describe whether case mapping is to be applied at the 374 level of the protocol itself, implementations thereof, or service 375 deployments (all of these approaches can be legitimate depending on 376 the application in question). 378 3.5. Application-Layer Constructs 380 Both the UsernameCaseMapped and UsernameCasePreserved profiles allow 381 an application protocol, implementation, or deployment to create 382 application-layer constructs such as "user@domain" or "Firstname 383 Middlename Lastname". One example of the former is the Network 384 Access Identifier specified in [I-D.ietf-radext-nai]. (Such 385 constructs are possible because the PRECIS IdentifierClass allows any 386 ASCII7 character, because spaces can be used to separate userpart 387 instances, and because domain names as specified in [RFC5890] and 388 [RFC5892] are a subset of the PRECIS IdentifierClass.) 390 3.6. Examples 392 The following examples illustrate a small number of userparts (not 393 usernames) that are consistent with the format defined above (note 394 that the characters < and > are used here to delineate the actual 395 userparts and are not part of the userpart strings). 397 Table 1: A sample of legal userparts 399 +--------------------------+---------------------------------+ 400 | # | Userpart | Notes | 401 +--------------------------+---------------------------------+ 402 | 1 | | The at-sign is allowed in the | 403 | | | PRECIS IdentifierClass | 404 +--------------------------+---------------------------------+ 405 | 2 | | | 406 +--------------------------+---------------------------------+ 407 | 3 | | The third character is LATIN | 408 | | | SMALL LETTER SHARP S (U+00DF) | 409 +--------------------------+---------------------------------+ 410 | 4 | <π> | A userpart of GREEK SMALL | 411 | | | LETTER PI (U+03C0) | 412 +--------------------------+---------------------------------+ 413 | 5 | <Σ> | A userpart of GREEK CAPITAL | 414 | | | LETTER SIGMA (U+03A3) | 415 +--------------------------+---------------------------------+ 416 | 6 | <σ> | A userpart of GREEK SMALL | 417 | | | LETTER SIGMA (U+03C3) | 418 +--------------------------+---------------------------------+ 419 | 7 | <ς> | A userpart of GREEK SMALL | 420 | | | LETTER FINAL SIGMA (U+03C2) | 421 +--------------------------+---------------------------------+ 423 Several points are worth noting. Regarding examples 2 and 3: 424 although in German the character esszett (LATIN SMALL LETTER SHARP S, 425 U+00DF) can mostly be used interchangeably with the two characters 426 "ss", the userparts in these examples are different and (if desired) 427 a server would need to enforce a registration policy that disallows 428 one of them if the other is registered. Regarding examples 5, 6, and 429 7: optional case-mapping of GREEK CAPITAL LETTER SIGMA (U+03A3) to 430 lowercase (i.e., to GREEK SMALL LETTER SIGMA, U+03C3) during 431 comparison would result in matching the userparts in examples 5 and 432 6; however, because the PRECIS mapping rules do not account for the 433 special status of GREEK SMALL LETTER FINAL SIGMA (U+03C2), the 434 userparts in examples 5 and 7 or examples 6 and 7 would not be 435 matched during comparison. 437 The following examples illustrate strings that are not valid 438 userparts (not usernames) because they violate the format defined 439 above. 441 Table 2: A sample of strings that violate the userpart rule 443 +--------------------------+---------------------------------+ 444 | # | Non-Userpart string | Notes | 445 +--------------------------+---------------------------------+ 446 | 8 | | Space (U+0020) is disallowed in | 447 | | | the userpart | 448 +--------------------------+---------------------------------+ 449 | 9 | <> | Zero-length userpart | 450 +--------------------------+---------------------------------+ 451 | 10| | The sixth character is ROMAN | 452 | | | NUMERAL FOUR (U+2163) | 453 +--------------------------+---------------------------------+ 454 | 11| <♚> | A localpart of BLACK CHESS KING | 455 | | | (U+265A) | 456 +--------------------------+---------------------------------+ 458 Here again, several points are worth noting. Regarding example 10, 459 the Unicode character ROMAN NUMERAL FOUR (U+2163) has a compatibility 460 equivalent of the string formed of LATIN CAPITAL LETTER I (U+0049) 461 and LATIN CAPITAL LETTER V (U+0056), but characters with 462 compatibility equivalents are not allowed in the PRECIS 463 IdentiferClass. Regarding example 11: symbol characters such as 464 BLACK CHESS KING (U+265A) are not allowed in the PRECIS 465 IdentifierClass. 467 4. Passwords 469 4.1. Definition 471 This document specifies that a password is a string of Unicode code 472 points [UNICODE], encoded using UTF-8 [RFC3629], and conformant to 473 the PRECIS FreeformClass. 475 The syntax for a password is defined as follows using the Augmented 476 Backus-Naur Form (ABNF) [RFC5234]. 478 password = 1*(freebyte) 479 ; 480 ; a "freebyte" is a byte used to represent a 481 ; UTF-8 encoded Unicode code point that can be 482 ; contained in a string that conforms to the 483 ; PRECIS "FreefromClass" 484 ; 486 All code points and blocks not explicitly allowed in the PRECIS 487 FreeformClass are disallowed; this includes private use characters, 488 surrogate code points, and the other code points and blocks defined 489 as "Prohibited Output" in Section 2.3 of RFC 4013. 491 A password MUST NOT be zero bytes in length. This rule is to be 492 enforced after any normalization and mapping of code points. 494 Note: The prohibition on zero-length passwords is not a 495 recommendation regarding password strength (since a password of 496 only one byte is highly insecure), but is meant to prevent 497 applications from omitting a password entirely. 499 In protocols that provide passwords as input to a cryptographic 500 algorithm such as a hash function, the client will need to perform 501 proper preparation of the password before applying the algorithm, 502 since the password is not available to the server in plaintext form. 504 4.2. Password Profile 506 The definition of the Password profile is provided in the following 507 sections, including detailed information about preparation, 508 enforcement, and comparison (on the distinction between these 509 actions, refer to [I-D.ietf-precis-framework]). 511 4.2.1. Preparation 513 An entity that prepares a string according to this profile MUST 514 ensure that the string consists only of Unicode code points that 515 conform to the "FreeformClass" base string class defined in 516 [I-D.ietf-precis-framework]. In addition, the string MUST be encoded 517 as UTF-8 [RFC3629]. 519 4.2.2. Enforcement 521 An entity that performs enforcement according to this profile MUST 522 prepare a string as described in the previous section and MUST also 523 apply the rules specified below for the Password (these rules MUST be 524 applied in the order shown). 526 1. Width Mapping Rule: Fullwidth and halfwidth characters MUST NOT 527 be mapped to their decomposition mappings. 529 2. Additional Mapping Rule: Any instances of non-ASCII space MUST be 530 mapped to ASCII space (U+0020); a non-ASCII space is any Unicode 531 code point having a general category of "Zs", naturally with the 532 exception of U+0020. 534 3. Case Mapping Rule: Uppercase and titlecase characters MUST NOT be 535 mapped to their lowercase equivalents. 537 4. Normalization Rule: Unicode Normalization Form C (NFC) MUST be 538 applied to all characters. 540 5. Directionality Rule: There is no directionality rule. The "Bidi 541 Rule" (defined in [RFC5893]) and similar rules are unnecessary 542 and inapplicable to passwords, since they can reduce the range of 543 characters that are allowed in a string and therefore reduce the 544 amount of entropy that is possible in a password. Furthermore, 545 such rules are intended to minimize the possibility that the same 546 string will be displayed differently on a system set for right- 547 to-left display and a system set for left-to-right display; 548 however, passwords are typically not displayed at all and are 549 rarely meant to be interoperable across different systems in the 550 way that non-secret strings like domain names and usernames are. 552 4.2.3. Comparison 554 An entity that performs comparison of two strings according to this 555 profile MUST prepare each string and enforce the rules specified in 556 the previous two sections. The two strings are to be considered 557 equivalent if they are an exact octet-for-octet match (sometimes 558 called "bit-string identity"). 560 4.3. Examples 562 The following examples illustrate a small number of passwords that 563 are consistent with the format defined above (note that the 564 characters < and > are used here to delineate the actual passwords 565 and are not part of the password strings). 567 Table 3: A sample of legal passwords 569 +------------------------------------+------------------------------+ 570 | # | Password | Notes | 571 +------------------------------------+------------------------------+ 572 | 12| | ASCII space is allowed | 573 +------------------------------------+------------------------------+ 574 | 13| | Different from example 12 | 575 +------------------------------------+------------------------------+ 576 | 14| <πßå> | Non-ASCII letters are OK | 577 | | | (e.g., GREEK SMALL LETTER | 578 | | | PI, U+03C0) | 579 +------------------------------------+------------------------------+ 580 | 15| | Symbols are OK (e.g., BLACK | 581 | | | DIAMOND SUIT, U+2666) | 582 +------------------------------------+------------------------------+ 584 The following examples illustrate strings that are not valid 585 passwords because they violate the format defined above. 587 Table 4: A sample of strings that violate the password rules 589 +------------------------------------+------------------------------+ 590 | # | Password | Notes | 591 +------------------------------------+------------------------------+ 592 | 16| | Non-ASCII space (here, OGHAM | 593 | | | SPACE MARK, U+1680) is not | 594 | | | allowed | 595 +------------------------------------+------------------------------+ 596 | 17| | Controls are disallowed | 597 +------------------------------------+------------------------------+ 599 5. Migration 601 The rules defined in this specification differ slightly from those 602 defined by the SASLprep specification [RFC4013]. The following 603 sections describe these differences, along with their implications 604 for migration, in more detail. 606 5.1. Usernames 608 Deployments that currently use SASLprep for handling usernames might 609 need to scrub existing data when migrating to use of the rules 610 defined in this specification. In particular: 612 o SASLprep specified the use of Unicode Normalization Form KC 613 (NFKC), whereas the UsernameCaseMapped and UsernameCasePreserved 614 profiles employ Unicode Normalization Form C (NFC). In practice 615 this change is unlikely to cause significant problems, because 616 NFKC provides methods for mapping Unicode code points with 617 compatibility equivalents to those equivalents, whereas the PRECIS 618 IdentifierClass entirely disallows Unicode code points with 619 compatibility equivalents (i.e., during comparison NFKC is more 620 "aggressive" about finding matches than NFC). A few examples 621 might suffice to indicate the nature of the problem: 623 1. U+017F LATIN SMALL LETTER LONG S is compatibility equivalent 624 to U+0073 LATIN SMALL LETTER S 626 2. U+2163 ROMAN NUMERAL FOUR is compatibility equivalent to 627 U+0049 LATIN CAPITAL LETTER I and U+0056 LATIN CAPITAL LETTER 628 V 630 3. U+FB01 LATIN SMALL LIGATURE FI is compatibility equivalent to 631 U+0066 LATIN SMALL LETTER F and U+0069 LATIN SMALL LETTER I 633 Under SASLprep, the use of NFKC also handled the mapping of 634 fullwidth and halfwidth code points to their decomposition 635 mappings. Although it is expected that code points with 636 compatibility equivalents are rare in existing usernames, for 637 migration purposes deployments might want to search their database 638 of usernames for Unicode code points with compatibility 639 equivalents and map those code points to their compatibility 640 equivalents. 642 o SASLprep mapped the "characters commonly mapped to nothing" from 643 Appendix B.1 of [RFC3454]) to nothing, whereas the PRECIS 644 IdentifierClass entirely disallows most of these characters, which 645 correspond to the code points from the "M" category defined under 646 Section 8.13 of [I-D.ietf-precis-framework] (with the exception of 647 U+1806 MONGOLIAN TODO SOFT HYPHEN, which was "commonly mapped to 648 nothing" in Unicode 3.2 but at the time of this writing does not 649 have a derived property of Default_Ignorable_Code_Point in Unicode 650 7.0). For migration purposes, deployments might want to remove 651 code points contained in the PRECIS "M" category from usernames. 653 o SASLprep allowed uppercase and titlecase characters, whereas the 654 UsernameCaseMapped profile maps uppercase and titlecase characters 655 to their lowercase equivalents (by contrast, the 656 UsernameCasePreserved profile matches SASLprep in this regard). 657 For migration purposes, deployments can either use the 658 UsernameCaseMapped profile (thus losing the case information) or 659 use the UsernameCasePreserved profile (thus ignoring case 660 difference when comparing usernames). 662 5.2. Passwords 664 Depending on local service policy, migration from RFC 4013 to this 665 specification might not involve any scrubbing of data (since 666 passwords might not be stored in the clear anyway); however, service 667 providers need to be aware of possible issues that might arise during 668 migration. In particular: 670 o SASLprep specified the use of Unicode Normalization Form KC 671 (NFKC), whereas the Password profile employs Unicode Normalization 672 Form C (NFC). Because NFKC is more aggressive about finding 673 matches than NFC, in practice this change is unlikely to cause 674 significant problems and indeed has the security benefit of 675 probably resulting in fewer false positives when comparing 676 passwords. A few examples might suffice to indicate the nature of 677 the problem: 679 1. U+017F LATIN SMALL LETTER LONG S is compatibility equivalent 680 to U+0073 LATIN SMALL LETTER S 682 2. U+2163 ROMAN NUMERAL FOUR is compatibility equivalent to 683 U+0049 LATIN CAPITAL LETTER I and U+0056 LATIN CAPITAL LETTER 684 V 686 3. U+FB01 LATIN SMALL LIGATURE FI is compatibility equivalent to 687 U+0066 LATIN SMALL LETTER F and U+0069 LATIN SMALL LETTER I 689 Under SASLprep, the use of NFKC also handled the mapping of 690 fullwidth and halfwidth code points to their decomposition 691 mappings. Although it is expected that code points with 692 compatibility equivalents are rare in existing passwords, some 693 passwords that matched when SASLprep was used might no longer work 694 when the rules in this specification are applied. 696 o SASLprep mapped the "characters commonly mapped to nothing" from 697 Appendix B.1 of [RFC3454]) to nothing, whereas the PRECIS 698 FreeformClass entirely disallows such characters, which correspond 699 to the code points from the "M" category defined under 700 Section 8.13 of [I-D.ietf-precis-framework] (with the exception of 701 U+1806 MONGOLIAN TODO SOFT HYPHEN, which was commonly mapped to 702 nothing in Unicode 3.2 but at the time of this writing is allowed 703 by Unicode 7.0). In practice, this change will probably have no 704 effect on comparison, but user-oriented software might reject such 705 code points instead of ignoring them during password preparation. 707 6. IANA Considerations 709 The IANA shall add the following entries to the PRECIS Profiles 710 Registry. 712 6.1. UsernameCaseMapped Profile 714 Name: UsernameCaseMapped. 716 Base Class: IdentifierClass. 718 Applicability: Usernames in security and application protocols. 720 Replaces: The SASLprep profile of Stringprep. 722 Width Mapping Rule: Map fullwidth and halfwidth characters to their 723 decomposition mappings. 725 Additional Mapping Rule: None. 727 Case Mapping Rule: Map uppercase and titlecase characters to 728 lowercase. 730 Normalization Rule: NFC. 732 Directionality Rule: The "Bidi Rule" defined in RFC 5893 applies. 734 Enforcement: To be defined by security or application protocols that 735 use this profile. 737 Specification: RFC XXXX. [Note to RFC Editor: please change XXXX to 738 the number issued for this specification.] 740 6.2. UsernameCasePreserved Profile 742 Name: UsernameCasePreserved. 744 Base Class: IdentifierClass. 746 Applicability: Usernames in security and application protocols. 748 Replaces: The SASLprep profile of Stringprep. 750 Width Mapping Rule: Map fullwidth and halfwidth characters to their 751 decomposition mappings. 753 Additional Mapping Rule: None. 755 Case Mapping Rule: None. 757 Normalization Rule: NFC. 759 Directionality Rule: The "Bidi Rule" defined in RFC 5893 applies. 761 Enforcement: To be defined by security or application protocols that 762 use this profile. 764 Specification: RFC XXXX. [Note to RFC Editor: please change XXXX to 765 the number issued for this specification.] 767 6.3. Password Profile 769 Name: Password. 771 Base Class: FreeformClass 773 Applicability: Passwords in security and application protocols. 775 Replaces: The SASLprep profile of Stringprep. 777 Width Mapping Rule: None. 779 Additional Mapping Rule: Map non-ASCII space characters to ASCII 780 space. 782 Case Mapping Rule: None. 784 Normalization Rule: NFC. 786 Directionality Rule: None. 788 Enforcement: To be defined by security or application protocols that 789 use this profile. 791 Specification: RFC XXXX. [Note to RFC Editor: please change XXXX to 792 the number issued for this specification.] 794 7. Security Considerations 796 7.1. Password/Passphrase Strength 798 The ability to include a wide range of characters in passwords and 799 passphrases can increase the potential for creating a strong password 800 with high entropy. However, in practice, the ability to include such 801 characters ought to be weighed against the possible need to reproduce 802 them on various devices using various input methods. 804 7.2. Identifier Comparison 806 The process of comparing identifiers (such as SASL simple user names, 807 authentication identifiers, and authorization identifiers) can lead 808 to either false negatives or false positives, both of which have 809 security implications. A more detailed discussion can be found in 810 [RFC6943]. 812 7.3. Reuse of PRECIS 814 The security considerations described in [I-D.ietf-precis-framework] 815 apply to the "IdentifierClass" and "FreeformClass" base string 816 classes used in this document for usernames and passwords, 817 respectively. 819 7.4. Reuse of Unicode 821 The security considerations described in [UTS39] apply to the use of 822 Unicode characters in usernames and passwords. 824 8. References 826 8.1. Normative References 828 [I-D.ietf-precis-framework] 829 Saint-Andre, P. and M. Blanchet, "Precis Framework: 830 Handling Internationalized Strings in Protocols", draft- 831 ietf-precis-framework-20 (work in progress), November 832 2014. 834 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 835 Requirement Levels", BCP 14, RFC 2119, March 1997. 837 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 838 10646", STD 63, RFC 3629, November 2003. 840 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 841 Specifications: ABNF", STD 68, RFC 5234, January 2008. 843 [UNICODE] The Unicode Consortium, "The Unicode Standard, Version 844 6.3", 2013, 845 . 847 8.2. Informative References 849 [I-D.ietf-httpauth-basicauth-update] 850 Reschke, J., "The 'Basic' HTTP Authentication Scheme", 851 draft-ietf-httpauth-basicauth-update-02 (work in 852 progress), October 2014. 854 [I-D.ietf-httpauth-digest] 855 Shekh-Yusef, R., Ahrens, D., and S. Bremer, "HTTP Digest 856 Access Authentication", draft-ietf-httpauth-digest-08 857 (work in progress), August 2014. 859 [I-D.ietf-radext-nai] 860 DeKok, A., "The Network Access Identifier", draft-ietf- 861 radext-nai-11 (work in progress), November 2014. 863 [RFC20] Cerf, V., "ASCII format for network interchange", RFC 20, 864 October 1969. 866 [RFC2617] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S., 867 Leach, P., Luotonen, A., and L. Stewart, "HTTP 868 Authentication: Basic and Digest Access Authentication", 869 RFC 2617, June 1999. 871 [RFC3454] Hoffman, P. and M. Blanchet, "Preparation of 872 Internationalized Strings ("stringprep")", RFC 3454, 873 December 2002. 875 [RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 876 4rev1", RFC 3501, March 2003. 878 [RFC4013] Zeilenga, K., "SASLprep: Stringprep Profile for User Names 879 and Passwords", RFC 4013, February 2005. 881 [RFC4422] Melnikov, A., Ed. and K. Zeilenga, Ed., "Simple 882 Authentication and Security Layer (SASL)", RFC 4422, June 883 2006. 885 [RFC4616] Zeilenga, K., "The PLAIN Simple Authentication and 886 Security Layer (SASL) Mechanism", RFC 4616, August 2006. 888 [RFC5802] Newman, C., Menon-Sen, A., Melnikov, A., and N. Williams, 889 "Salted Challenge Response Authentication Mechanism 890 (SCRAM) SASL and GSS-API Mechanisms", RFC 5802, July 2010. 892 [RFC5890] Klensin, J., "Internationalized Domain Names for 893 Applications (IDNA): Definitions and Document Framework", 894 RFC 5890, August 2010. 896 [RFC5891] Klensin, J., "Internationalized Domain Names in 897 Applications (IDNA): Protocol", RFC 5891, August 2010. 899 [RFC5892] Faltstrom, P., "The Unicode Code Points and 900 Internationalized Domain Names for Applications (IDNA)", 901 RFC 5892, August 2010. 903 [RFC5893] Alvestrand, H. and C. Karp, "Right-to-Left Scripts for 904 Internationalized Domain Names for Applications (IDNA)", 905 RFC 5893, August 2010. 907 [RFC5894] Klensin, J., "Internationalized Domain Names for 908 Applications (IDNA): Background, Explanation, and 909 Rationale", RFC 5894, August 2010. 911 [RFC6120] Saint-Andre, P., "Extensible Messaging and Presence 912 Protocol (XMPP): Core", RFC 6120, March 2011. 914 [RFC6365] Hoffman, P. and J. Klensin, "Terminology Used in 915 Internationalization in the IETF", BCP 166, RFC 6365, 916 September 2011. 918 [RFC6943] Thaler, D., "Issues in Identifier Comparison for Security 919 Purposes", RFC 6943, May 2013. 921 [UTS39] The Unicode Consortium, "Unicode Technical Standard #39: 922 Unicode Security Mechanisms", July 2012, 923 . 925 Appendix A. Differences from RFC 4013 927 This document builds upon the PRECIS framework defined in 928 [I-D.ietf-precis-framework], which differs fundamentally from the 929 stringprep technology [RFC3454] used in SASLprep [RFC4013]. The 930 primary difference is that stringprep profiles allowed all characters 931 except those which were explicitly disallowed, whereas PRECIS 932 profiles disallow all characters except those which are explicitly 933 allowed (this "inclusion model" was originally used for 934 internationalized domain names in [RFC5891]; see [RFC5894] for 935 further discussion). It is important to keep this distinction in 936 mind when comparing the technology defined in this document to 937 SASLprep [RFC4013]. 939 The following substantive modifications were made from RFC 4013. 941 o A single SASLprep algorithm was replaced by three separate 942 algorithms: one for usernames with case mapping, one for usernames 943 with case preservation, and one for passwords. 945 o The new preparation algorithms use PRECIS instead of a stringprep 946 profile. The new algorithms work independenctly of Unicode 947 versions. 949 o As recommended in the PRECIS framework, changed the Unicode 950 normalization form from NFKC to NFC. 952 o Some Unicode code points that were mapped to nothing in RFC 4013 953 are simply disallowed by PRECIS. 955 Appendix B. Acknowledgements 957 The following individuals provided helpful feedback on this document: 958 Marc Blanchet, Alan DeKok, Joe Hildebrand, Jeffrey Hutzelman, Simon 959 Josefsson, Jonathan Lennox, James Manger, Matt Miller, Chris Newman, 960 Yutaka OIWA, Pete Resnick, Andrew Sullivan, and Nico Williams. Nico 961 in particular deserves special recognition for providing text that 962 was used in Section 3.4. Thanks also to Yoshiro YONEYA and Takahiro 963 NEMOTO for implementation feedback. 965 This document borrows some text from [RFC4013] and [RFC6120]. 967 Peter Saint-Andre wishes to acknowledge Cisco Systems, Inc., for 968 employing him during his work on earlier versions of this document. 970 Authors' Addresses 972 Peter Saint-Andre 973 &yet 975 Email: peter@andyet.com 976 URI: https://andyet.com/ 978 Alexey Melnikov 979 Isode Ltd 980 5 Castle Business Village 981 36 Station Road 982 Hampton, Middlesex TW12 2BX 983 UK 985 Email: Alexey.Melnikov@isode.com