idnits 2.17.00 (12 Aug 2021) /tmp/idnits16160/draft-ietf-precis-saslprepbis-09.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 (October 23, 2014) is 2766 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: draft-ietf-precis-framework has been published as RFC 7564 -- Possible downref: Non-RFC (?) normative reference: ref. 'UNICODE' -- 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 (~~), 2 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: April 26, 2015 October 23, 2014 8 Preparation, Enforcement, and Comparison of Internationalized Strings 9 Representing Usernames and Passwords 10 draft-ietf-precis-saslprepbis-09 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 April 26, 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 . . . . . . . . . . . . . . . . . . . . . . . . . 3 54 3. Usernames . . . . . . . . . . . . . . . . . . . . . . . . . . 4 55 3.1. Definition . . . . . . . . . . . . . . . . . . . . . . . 4 56 3.2. Preparation . . . . . . . . . . . . . . . . . . . . . . . 5 57 3.3. Enforcement . . . . . . . . . . . . . . . . . . . . . . . 5 58 3.4. Comparison . . . . . . . . . . . . . . . . . . . . . . . 6 59 3.5. Case Mapping . . . . . . . . . . . . . . . . . . . . . . 6 60 3.6. Application-Layer Constructs . . . . . . . . . . . . . . 7 61 3.7. Examples . . . . . . . . . . . . . . . . . . . . . . . . 7 62 4. Passwords . . . . . . . . . . . . . . . . . . . . . . . . . . 9 63 4.1. Definition . . . . . . . . . . . . . . . . . . . . . . . 9 64 4.2. Preparation . . . . . . . . . . . . . . . . . . . . . . . 10 65 4.3. Enforcement . . . . . . . . . . . . . . . . . . . . . . . 10 66 4.4. Comparison . . . . . . . . . . . . . . . . . . . . . . . 11 67 4.5. Examples . . . . . . . . . . . . . . . . . . . . . . . . 11 68 5. Migration . . . . . . . . . . . . . . . . . . . . . . . . . . 12 69 5.1. Usernames . . . . . . . . . . . . . . . . . . . . . . . . 12 70 5.2. Passwords . . . . . . . . . . . . . . . . . . . . . . . . 13 71 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 14 72 6.1. UsernameIdentifierClass . . . . . . . . . . . . . . . . . 14 73 6.2. PasswordFreeformClass . . . . . . . . . . . . . . . . . . 15 74 7. Security Considerations . . . . . . . . . . . . . . . . . . . 15 75 7.1. Password/Passphrase Strength . . . . . . . . . . . . . . 15 76 7.2. Identifier Comparison . . . . . . . . . . . . . . . . . . 15 77 7.3. Reuse of PRECIS . . . . . . . . . . . . . . . . . . . . . 16 78 7.4. Reuse of Unicode . . . . . . . . . . . . . . . . . . . . 16 79 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 16 80 8.1. Normative References . . . . . . . . . . . . . . . . . . 16 81 8.2. Informative References . . . . . . . . . . . . . . . . . 16 82 Appendix A. Differences from RFC 4013 . . . . . . . . . . . . . 18 83 Appendix B. Acknowledgements . . . . . . . . . . . . . . . . . . 18 84 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 19 86 1. Introduction 88 Usernames and passwords are widely used for authentication and 89 authorization on the Internet, either directly when provided in 90 plaintext (as in the SASL PLAIN mechanism [RFC4616] or the HTTP Basic 91 scheme [RFC2617]) or indirectly when provided as the input to a 92 cryptographic algorithm such as a hash function (as in the SASL SCRAM 93 mechanism [RFC5802] or the HTTP Digest scheme [RFC2617]). 95 To increase the likelihood that the input and comparison of usernames 96 and passwords will work in ways that make sense for typical users 97 throughout the world, this document defines rules for preparing and 98 comparing internationalized strings that represent usernames and 99 passwords. Such strings consist of characters from the Unicode 100 character set [UNICODE], especially characters outside the ASCII 101 range [RFC20]. The rules for handling such strings are specified 102 through profiles of the string classes defined in the PRECIS 103 framework specification [I-D.ietf-precis-framework]. 105 Profiles of the PRECIS framework enable software to handle Unicode 106 characters outside the ASCII range in an automated way, so that such 107 characters are treated carefully and consistently in application 108 protocols. In large measure, these profiles are designed to protect 109 application developers from the potentially negative consequences of 110 supporting the full range of Unicode characters. For instance, in 111 almost all application protocols it would be dangerous to treat the 112 Unicode character SUPERSCRIPT ONE (U+0089) as equivalent to DIGIT ONE 113 (U+0031), since that would result in false positives during 114 comparison, authentication, and authorization (e.g., an attacker 115 could easy spoof an account "user1@example.com"). 117 Whereas a naive use of Unicode would make such attacks trivially 118 easy, the PRECIS profile defined here for usernames generally 119 protects applications from inadvertently causing such problems. 120 (Similar considerations apply to passwords, although here it is 121 desirable to support a wider range of characters so as to maximize 122 entropy during authentication.) 124 The methods defined here might be applicable wherever usernames or 125 passwords are used. However, the methods are not intended for use in 126 preparing strings that are not usernames (e.g., email addresses and 127 LDAP distinguished names), nor in cases where identifiers or secrets 128 are not strings (e.g., keys and certificates) or require specialized 129 handling. 131 This document obsoletes RFC 4013 (the "SASLprep" profile of 132 stringprep [RFC3454]) but can be used by technologies other than the 133 Simple Authentication and Security Layer (SASL) [RFC4422], such as 134 HTTP authentication [RFC2617]. 136 2. Terminology 138 Many important terms used in this document are defined in 139 [I-D.ietf-precis-framework], [RFC5890], [RFC6365], and [UNICODE]. 140 The term "non-ASCII space" refers to any Unicode code point having a 141 general category of "Zs", with the exception of U+0020 (here called 142 "ASCII space"). 144 As used here, the term "password" is not literally limited to a word; 145 i.e., a password could be a passphrase consisting of more than one 146 word, perhaps separated by spaces or other such characters. 148 Some SASL mechanisms (e.g., CRAM-MD5, DIGEST-MD5, and SCRAM) specify 149 that the authentication identity used in the context of such 150 mechanisms is a "simple user name" (see Section 2 of [RFC4422] as 151 well as [RFC4013]). Various application technologies also assume 152 that the identity of a user or account takes the form of a username 153 (e.g., authentication for the HyperText Transfer Protocol [RFC2617]), 154 whether or not they use SASL. Note well that the exact form of a 155 username in any particular SASL mechanism or application technology 156 is a matter for implementation and deployment, and that a username 157 does not necessarily map to any particular application identifier 158 (such as the localpart of an email address). 160 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 161 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 162 "OPTIONAL" in this document are to be interpreted as described in 163 [RFC2119]. 165 3. Usernames 167 Detailed rules for the preparation, enforcement, and comparision of 168 usernames are provided in the following sections (on the distinction 169 between these actions, refer to [I-D.ietf-precis-framework]). 171 3.1. Definition 173 This document specifies that a username is a string of Unicode code 174 points [UNICODE], encoded using UTF-8 [RFC3629], and structured 175 either as an ordered sequence of "userparts" (where the complete 176 username can consist of a single userpart or a space-separated 177 sequence of userparts) or as a userpart@domainpart (where the 178 domainpart is an IP literal, an IPv4 address, or a fully-qualified 179 domain name). 181 The syntax for a username is defined as follows using the Augmented 182 Backus-Naur Form (ABNF) [RFC5234]. 184 username = userpart [1*(1*SP userpart)] 185 userpart = 1*(idbyte) 186 ; 187 ; an "idbyte" is a byte used to represent a 188 ; UTF-8 encoded Unicode code point that can be 189 ; contained in a string that conforms to the 190 ; PRECIS "IdentifierClass" 191 ; 193 All code points and blocks not explicitly allowed in the PRECIS 194 IdentifierClass are disallowed; this includes private use characters, 195 surrogate code points, and the other code points and blocks that were 196 defined as "Prohibited Output" in [RFC4013]. In addition, common 197 constructions such as "user@example.com" are allowed as usernames 198 under this specification, as they were under [RFC4013]. 200 Implementation Note: The username construct defined in this 201 document does not necessarily match what all deployed applications 202 might refer to as a "username" or "userid", but instead provides a 203 relatively safe subset of Unicode characters that can be used in 204 existing SASL mechanisms and SASL-using application protocols, and 205 even in most application protocols that do not currently use SASL. 207 A username MUST NOT be zero bytes in length. This rule is to be 208 enforced after any normalization and mapping of code points. 210 In protocols that provide usernames as input to a cryptographic 211 algorithm such as a hash function, the client will need to perform 212 proper preparation of the username before applying the algorithm. 214 3.2. Preparation 216 An entity that prepares a string for inclusion in a username slot 217 MUST ensure that the string consists only of Unicode code points that 218 conform to the "IdentifierClass" base string class defined in 219 [I-D.ietf-precis-framework]. In addition, the string MUST be encoded 220 as UTF-8 [RFC3629]. 222 3.3. Enforcement 224 An entity that performs enforcement in username slots MUST prepare a 225 string as described in the previous section and MUST also apply the 226 rules specified below for the UsernameIdentifierClass profile (these 227 rules MUST be applied in the order shown). 229 1. Width Mapping Rule: Fullwidth and halfwidth characters MUST be 230 mapped to their decomposition mappings. 232 2. Additional Mapping Rule: There is no additional mapping rule. 234 3. Case Mapping Rule: There is no case mapping rule (although see 235 Section 3.5 below). 237 4. Normalization Rule: Unicode Normalization Form C (NFC) MUST be 238 applied to all characters. 240 5. Exclusion Rule: There is no exclusion rule. 242 6. Directionaity Rule: Applications MUST apply the "Bidi Rule" 243 defined in [RFC5893] (i.e., each of the six conditions of the 244 Bidi Rule must be satisfied). 246 3.4. Comparison 248 An entity that performs comparison of two strings before or after 249 their inclusion in username slots MUST prepare each string and 250 enforce the rules specified in the previous two sections. The two 251 strings are to be considered equivalent if they are an exact octet- 252 for-octet match (sometimes called "bit-string identity"). 254 3.5. Case Mapping 256 Case mapping is a matter for the application protocol, protocol 257 implementation, or end deployment. In general, this document 258 suggests that it is preferable to perform case mapping, since not 259 doing so can lead to false positives during authentication and 260 authorization (as described in [RFC6943]) and can result in confusion 261 among end users given the prevalence of case mapping in many existing 262 protocols and applications. However, there can be good reasons to 263 not perform case mapping, such as backward compatibility with 264 deployed infrastructure. 266 In particular: 268 o SASL mechanisms that directly re-use this profile MUST specify 269 whether and when case mapping is to be applied to authentication 270 identifiers. SASL mechanisms SHOULD delay any case mapping to the 271 last possible moment, such as when doing a lookup by username, 272 username comparisons, or generating a cryptographic salt from a 273 username (if the last possible moment happens on the server, then 274 decisions about case mapping can be a matter of deployment 275 policy). In keeping with [RFC4422], SASL mechanisms are not to 276 apply this or any other profile to authorization identifiers. 278 o Application protocols that use SASL (such as IMAP [RFC3501] and 279 XMPP [RFC6120]) and that directly re-use this profile MUST specify 280 whether case mapping is to be applied to authorization 281 identifiers. Such "SASL application protocols" SHOULD delay any 282 case mapping of authorization identifiers to the last possible 283 moment, which happens to necessarily be on the server side (this 284 enables decisions about case mapping to be a matter of deployment 285 policy). In keeping with [RFC4422], SASL application protocols 286 are not to apply this or any other profile to authentication 287 identifiers. 289 o Application protocols that do not use SASL (such as HTTP 290 authentication with the Basic and Digest schemes [RFC2617]) MUST 291 specify whether and when case mapping is to be applied to 292 authentication identifiers and authorization identifiers. Such 293 "non-SASL application protocols" SHOULD delay any case mapping to 294 the last possible moment, such as when doing a lookup by username, 295 username comparisons, or generating a cryptographic salt from a 296 username (if the last possible moment happens on the server, then 297 decisions about case mapping can be a matter of deployment 298 policy). 300 If the specification for a SASL mechanism, SASL application protocol, 301 or non-SASL application protocol specifies the handling of case 302 mapping for strings that conform to the UsernameIdentifierClass, it 303 MUST clearly describe whether case mapping is required, recommended, 304 or optional at the level of the protocol itself, implementations 305 thereof, or service deployments. 307 3.6. Application-Layer Constructs 309 The username rule allows an application protocol, implementation, or 310 deployment to create application-layer constructs such as 311 "user@domain" or "Firstname Middlename Lastname" (e.g., because the 312 PRECIS IdentifierClass allows any ASCII7 character, because spaces 313 can be used to separate userpart instances, and because domain names 314 as specified in [RFC5890] and [RFC5892] are a subset of the PRECIS 315 IdentifierClass). 317 3.7. Examples 319 The following examples illustrate a small number of userparts (not 320 usernames) that are consistent with the format defined above (note 321 that the characters < and > are used here to delineate the actual 322 userparts and are not part of the userpart strings). 324 Table 1: A sample of legal userparts 326 +--------------------------+---------------------------------+ 327 | # | Userpart | Notes | 328 +--------------------------+---------------------------------+ 329 | 1 | | The at-sign is allowed in the | 330 | | | PRECIS IdentifierClass | 331 +--------------------------+---------------------------------+ 332 | 2 | | | 333 +--------------------------+---------------------------------+ 334 | 3 | | The third character is LATIN | 335 | | | SMALL LETTER SHARP S (U+00DF) | 336 +--------------------------+---------------------------------+ 337 | 4 | <π> | A userpart of GREEK SMALL | 338 | | | LETTER PI (U+03C0) | 339 +--------------------------+---------------------------------+ 340 | 5 | <Σ> | A userpart of GREEK CAPITAL | 341 | | | LETTER SIGMA (U+03A3) | 342 +--------------------------+---------------------------------+ 343 | 6 | <σ> | A userpart of GREEK SMALL | 344 | | | LETTER SIGMA (U+03C3) | 345 +--------------------------+---------------------------------+ 346 | 7 | <ς> | A userpart of GREEK SMALL | 347 | | | LETTER FINAL SIGMA (U+03C2) | 348 +--------------------------+---------------------------------+ 350 Several points are worth noting. Regarding examples 2 and 3: 351 although in German the character esszett (LATIN SMALL LETTER SHARP S, 352 U+00DF) can mostly be used interchangeably with the two characters 353 "ss", the userparts in these examples are different and (if desired) 354 a server would need to enforce a registration policy that disallows 355 one of them if the other is registered. Regarding examples 5, 6, and 356 7: optional case-mapping of GREEK CAPITAL LETTER SIGMA (U+03A3) to 357 lowercase (i.e., to GREEK SMALL LETTER SIGMA, U+03C3) during 358 comparison would result in matching the userparts in examples 5 and 359 6; however, because the PRECIS mapping rules do not account for the 360 special status of GREEK SMALL LETTER FINAL SIGMA (U+03C2), the 361 userparts in examples 5 and 7 or examples 6 and 7 would not be 362 matched. 364 The following examples illustrate strings that are not valid 365 userparts (not usernames) because they violate the format defined 366 above. 368 Table 2: A sample of strings that violate the userpart rule 370 +--------------------------+---------------------------------+ 371 | # | Non-Userpart string | Notes | 372 +--------------------------+---------------------------------+ 373 | 8 | | Space (U+0020) is disallowed in | 374 | | | the userpart | 375 +--------------------------+---------------------------------+ 376 | 9 | <> | Zero-length userpart | 377 +--------------------------+---------------------------------+ 378 | 10| | The sixth character is ROMAN | 379 | | | NUMERAL FOUR (U+2163) | 380 +--------------------------+---------------------------------+ 381 | 11| <♚> | A localpart of BLACK CHESS KING | 382 | | | (U+265A) | 383 +--------------------------+---------------------------------+ 385 Here again, several points are worth noting. Regarding example 10, 386 the Unicode character ROMAN NUMERAL FOUR (U+2163) has a compatibility 387 equivalent of the string formed of LATIN CAPITAL LETTER I (U+0049) 388 and LATIN CAPITAL LETTER V (U+0056), but characters with 389 compatibility equivalents are not allowed in the PRECIS 390 IdentiferClass. Regarding example 11: symbol characters such as 391 BLACK CHESS KING (U+265A) are not allowed in the PRECIS 392 IdentifierClass. 394 4. Passwords 396 Detailed rules for the preparation, enforcement, and comparision of 397 passwords are provided in the following sections (on the distinction 398 between these actions, refer to [I-D.ietf-precis-framework]). 400 4.1. Definition 402 This document specifies that a password is a string of Unicode code 403 points [UNICODE], encoded using UTF-8 [RFC3629], and conformant to 404 the PRECIS FreeformClass. 406 The syntax for a password is defined as follows using the Augmented 407 Backus-Naur Form (ABNF) [RFC5234]. 409 password = 1*(freepoint) 410 ; 411 ; a "freepoint" is a UTF-8 encoded 412 ; Unicode code point that conforms to 413 ; the PRECIS "FreeformClass" 414 ; 416 All code points and blocks not explicitly allowed in the PRECIS 417 FreeformClass are disallowed; this includes private use characters, 418 surrogate code points, and the other code points and blocks defined 419 as "Prohibited Output" in Section 2.3 of RFC 4013. 421 A password MUST NOT be zero bytes in length. This rule is to be 422 enforced after any normalization and mapping of code points. 424 In protocols that provide passwords as input to a cryptographic 425 algorithm such as a hash function, the client will need to perform 426 proper preparation of the password before applying the algorithm, 427 since the password is not available to the server in plaintext form. 429 4.2. Preparation 431 An entity that prepares a string for inclusion in a password slot 432 MUST ensure that the string consists only of Unicode code points that 433 conform to the "FreeformClass" base string class defined in 434 [I-D.ietf-precis-framework]. In addition, the string MUST be encoded 435 as UTF-8 [RFC3629]. 437 4.3. Enforcement 439 An entity that performs enforcement in password slots MUST prepare a 440 string as described in the previous section and MUST also apply the 441 rules specified below for the PasswordFreeformClass (these rules MUST 442 be applied in the order shown). 444 1. Width Mapping Rule: Fullwidth and halfwidth characters MUST NOT 445 be mapped to their decomposition mappings. 447 2. Additional Mapping Rule: Any instances of non-ASCII space MUST be 448 mapped to ASCII space (U+0020); such an instance is any Unicode 449 code point that has a compatibility mapping of any kind to U+0020 450 SPACE (including but not limited to as for U+0384 GREEK 451 TONOS, as for U+2007 FIGURE SPACE, and as for 452 U+3000 IDEOGRAPHIC SPACE). 454 3. Case Mapping Rule: Uppercase and titlecase characters MUST NOT be 455 mapped to their lowercase equivalents. 457 4. Normalization Rule: Unicode Normalization Form C (NFC) MUST be 458 applied to all characters. 460 5. Exclusion Rule: There is no exclusion rule. 462 6. Directionality Rule: There is no directionality rule. The "Bidi 463 Rule" (defined in [RFC5893]) and similar rules are unnecessary 464 and inapplicable to passwords, since they can reduce the range of 465 characters that are allowed in a string and therefore reduce the 466 amount of entropy that is possible in a password. Furthermore, 467 such rules are intended to minimize the possibility that the same 468 string will be displayed differently on a system set for right- 469 to-left display and a system set for left-to-right display; 470 however, passwords are typically not displayed at all and are 471 rarely meant to be interoperable across different systems in the 472 way that non-secret strings like domain names and usernames are. 474 4.4. Comparison 476 An entity that performs comparison of two strings before or after 477 their inclusion in password slots MUST prepare each string and 478 enforce the rules specified in the previous two sections. The two 479 strings are to be considered equivalent if they are an exact octet- 480 for-octet match (sometimes called "bit-string identity"). 482 4.5. Examples 484 The following examples illustrate a small number of passwords that 485 are consistent with the format defined above (note that the 486 characters < and > are used here to delineate the actual passwords 487 and are not part of the username strings). 489 Table 3: A sample of legal passwords 491 +------------------------------------+------------------------------+ 492 | # | Password | Notes | 493 +------------------------------------+------------------------------+ 494 | 13| | ASCII space is allowed | 495 +------------------------------------+------------------------------+ 496 | 14| | | 497 +------------------------------------+------------------------------+ 498 | 15| <πßå> | Non-ASCII letters are OK | 499 | | | (e.g., GREEK SMALL LETTER | 500 | | | PI, U+03C0) | 501 +------------------------------------+------------------------------+ 502 | 16| | Symbols are OK (e.g., BLACK | 503 | | | DIAMOND SUIT, U+2666) | 504 +------------------------------------+------------------------------+ 506 The following examples illustrate strings that are not valid 507 passwords because they violate the format defined above. 509 Table 4: A sample of strings that violate the password rules 511 +------------------------------------+------------------------------+ 512 | # | Password | Notes | 513 +------------------------------------+------------------------------+ 514 | 17| | Non-ASCII space (here, OGHAM | 515 | | | SPACE MARK, U+1680) is not | 516 | | | allowed | 517 +------------------------------------+------------------------------+ 518 | 18| | Controls are disallowed | 519 +------------------------------------+------------------------------+ 521 5. Migration 523 The rules defined in this specification differ slightly from those 524 defined by the SASLprep specification [RFC4013]. The following 525 sections describe these differences, along with their implications 526 for migration, in more detail. 528 5.1. Usernames 530 Deployments that currently use SASLprep for handling usernames might 531 need to scrub existing data when migrating to use of the rules 532 defined in this specification. In particular: 534 o SASLprep specified the use of Unicode Normalization Form KC 535 (NFKC), whereas this usage of the PRECIS IdentifierClass employs 536 Unicode Normalization Form C (NFC). In practice this change is 537 unlikely to cause significant problems, because NFKC provides 538 methods for mapping Unicode code points with compatibility 539 equivalents to those equivalents, whereas the PRECIS 540 IdentifierClass entirely disallows Unicode code points with 541 compatibility equivalents (i.e., during comparison NFKC is more 542 "aggressive" about finding matches than is NFC). A few examples 543 might suffice to indicate the nature of the problem: (1) U+017F 544 LATIN SMALL LETTER LONG S is compatibility equivalent to U+0073 545 LATIN SMALL LETTER S (2) U+2163 ROMAN NUMERAL FOUR is 546 compatibility equivalent to U+0049 LATIN CAPITAL LETTER I and 547 U+0056 LATIN CAPITAL LETTER V (3) U+FB01 LATIN SMALL LIGATURE FI 548 is compatibility equivalent to U+0066 LATIN SMALL LETTER F and 549 U+0069 LATIN SMALL LETTER I. Under SASLprep, the use of NFKC also 550 handled the mapping of fullwidth and halfwidth code points to 551 their decomposition mappings. Although it is expected that code 552 points with compatibility equivalents are rare in existing 553 usernames, for migration purposes deployments might want to search 554 their database of usernames for Unicode code points with 555 compatibility equivalents and map those code points to their 556 compatibility equivalents. 558 o SASLprep mapped the "characters commonly mapped to nothing" from 559 Appendix B.1 of [RFC3454]) to nothing, whereas the PRECIS 560 IdentifierClass entirely disallows most of these characters, which 561 correspond to the code points from the "M" category defined under 562 Section 6.13 of [I-D.ietf-precis-framework] (with the exception of 563 U+1806 MONGOLIAN TODO SOFT HYPHEN, which was "commonly mapped to 564 nothing" in Unicode 3.2 but at the time of this writing does not 565 have a derived property of Default_Ignorable_Code_Point in Unicode 566 6.2). For migration purposes, deployments might want to remove 567 code points contained in the PRECIS "M" category from usernames. 569 o SASLprep allowed uppercase and titlecase characters, whereas this 570 usage of the PRECIS IdentifierClass maps uppercase and titlecase 571 characters to their lowercase equivalents. For migration 572 purposes, deployments can either convert uppercase and titlecase 573 characters to their lowercase equivalents in usernames (thus 574 losing the case information) or preserve uppercase and titlecase 575 characters and ignore the case difference when comparing 576 usernames. 578 5.2. Passwords 580 Depending on local service policy, migration from RFC 4013 to this 581 specification might not involve any scrubbing of data (since 582 passwords might not be stored in the clear anyway); however, service 583 providers need to be aware of possible issues that might arise during 584 migration. In particular: 586 o SASLprep specified the use of Unicode Normalization Form KC 587 (NFKC), whereas this usage of the PRECIS FreeformClass employs 588 Unicode Normalization Form C (NFC). Because NFKC is more 589 aggressive about finding matches than NFC, in practice this change 590 is unlikely to cause significant problems and indeed has the 591 security benefit of probably resulting in fewer false positives 592 when comparing passwords. A few examples might suffice to 593 indicate the nature of the problem: (1) U+017F LATIN SMALL LETTER 594 LONG S is compatibility equivalent to U+0073 LATIN SMALL LETTER S 595 (2) U+2163 ROMAN NUMERAL FOUR is compatibility equivalent to 596 U+0049 LATIN CAPITAL LETTER I and U+0056 LATIN CAPITAL LETTER V 597 (3) U+FB01 LATIN SMALL LIGATURE FI is compatibility equivalent to 598 U+0066 LATIN SMALL LETTER F and U+0069 LATIN SMALL LETTER I. 599 Under SASLprep, the use of NFKC also handled the mapping of 600 fullwidth and halfwidth code points to their decomposition 601 mappings. Although it is expected that code points with 602 compatibility equivalents are rare in existing passwords, some 603 passwords that matched when SASLprep was used might no longer work 604 when the rules in this specification are applied. 606 o SASLprep mapped the "characters commonly mapped to nothing" from 607 Appendix B.1 of [RFC3454]) to nothing, whereas the PRECIS 608 FreeformClass entirely disallows such characters, which correspond 609 to the code points from the "M" category defined under 610 Section 6.13 of [I-D.ietf-precis-framework] (with the exception of 611 U+1806 MONGOLIAN TODO SOFT HYPHEN, which was commonly mapped to 612 nothing in Unicode 3.2 but at the time of this writing is allowed 613 by Unicode 6.2). In practice, this change will probably have no 614 effect on comparison, but user-oriented software might reject such 615 code points instead of ignoring them during password preparation. 617 6. IANA Considerations 619 The IANA shall add the following entries to the PRECIS Profiles 620 Registry. 622 6.1. UsernameIdentifierClass 624 Name: UsernameIdentifierClass. 626 Applicability: Usernames in security and application protocols. 628 Base Class: IdentifierClass. 630 Replaces: The SASLprep profile of Stringprep. 632 Width Mapping Rule: Map fullwidth and halfwidth characters to their 633 decomposition mappings. 635 Additional Mapping Rule: None. 637 Case Mapping Rule: To be defined by security or application 638 protocols that use this profile. 640 Normalization Rule: NFC. 642 Exclusion Rule: None. 644 Directionality Rule: The "Bidi Rule" defined in RFC 5893 applies. 646 Enforcement: To be defined by security or application protocols that 647 use this profile. 649 Specification: RFC XXXX. [Note to RFC Editor: please change XXXX to 650 the number issued for this specification.] 652 6.2. PasswordFreeformClass 654 Name: PasswordFreeformClass. 656 Applicability: Passwords in security and application protocols. 658 Base Class: FreeformClass 660 Replaces: The SASLprep profile of Stringprep. 662 Width Mapping Rule: None. 664 Additional Mapping Rule: Map non-ASCII space characters to ASCII 665 space. 667 Case Mapping Rule: None. 669 Normalization Rule: NFC. 671 Exclusion Rule: None. 673 Directionality Rule: None. 675 Enforcement: To be defined by security or application protocols that 676 use this profile. 678 Specification: RFC XXXX. [Note to RFC Editor: please change XXXX to 679 the number issued for this specification.] 681 7. Security Considerations 683 7.1. Password/Passphrase Strength 685 The ability to include a wide range of characters in passwords and 686 passphrases can increase the potential for creating a strong password 687 with high entropy. However, in practice, the ability to include such 688 characters ought to be weighed against the possible need to reproduce 689 them on various devices using various input methods. 691 7.2. Identifier Comparison 693 The process of comparing identifiers (such as SASL simple user names, 694 authentication identifiers, and authorization identifiers) can lead 695 to either false negatives or false positives, both of which have 696 security implications. A more detailed discussion can be found in 697 [RFC6943]. 699 7.3. Reuse of PRECIS 701 The security considerations described in [I-D.ietf-precis-framework] 702 apply to the "IdentifierClass" and "FreeformClass" base string 703 classes used in this document for usernames and passwords, 704 respectively. 706 7.4. Reuse of Unicode 708 The security considerations described in [UTS39] apply to the use of 709 Unicode characters in usernames and passwords. 711 8. References 713 8.1. Normative References 715 [I-D.ietf-precis-framework] 716 Saint-Andre, P. and M. Blanchet, "Precis Framework: 717 Handling Internationalized Strings in Protocols", draft- 718 ietf-precis-framework-19 (work in progress), October 2014. 720 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 721 Requirement Levels", BCP 14, RFC 2119, March 1997. 723 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 724 10646", STD 63, RFC 3629, November 2003. 726 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 727 Specifications: ABNF", STD 68, RFC 5234, January 2008. 729 [UNICODE] The Unicode Consortium, "The Unicode Standard, Version 730 6.3", 2013, 731 . 733 8.2. Informative References 735 [RFC20] Cerf, V., "ASCII format for network interchange", RFC 20, 736 October 1969. 738 [RFC2617] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S., 739 Leach, P., Luotonen, A., and L. Stewart, "HTTP 740 Authentication: Basic and Digest Access Authentication", 741 RFC 2617, June 1999. 743 [RFC3454] Hoffman, P. and M. Blanchet, "Preparation of 744 Internationalized Strings ("stringprep")", RFC 3454, 745 December 2002. 747 [RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 748 4rev1", RFC 3501, March 2003. 750 [RFC4013] Zeilenga, K., "SASLprep: Stringprep Profile for User Names 751 and Passwords", RFC 4013, February 2005. 753 [RFC4422] Melnikov, A., Ed. and K. Zeilenga, Ed., "Simple 754 Authentication and Security Layer (SASL)", RFC 4422, June 755 2006. 757 [RFC4616] Zeilenga, K., "The PLAIN Simple Authentication and 758 Security Layer (SASL) Mechanism", RFC 4616, August 2006. 760 [RFC5802] Newman, C., Menon-Sen, A., Melnikov, A., and N. Williams, 761 "Salted Challenge Response Authentication Mechanism 762 (SCRAM) SASL and GSS-API Mechanisms", RFC 5802, July 2010. 764 [RFC5890] Klensin, J., "Internationalized Domain Names for 765 Applications (IDNA): Definitions and Document Framework", 766 RFC 5890, August 2010. 768 [RFC5891] Klensin, J., "Internationalized Domain Names in 769 Applications (IDNA): Protocol", RFC 5891, August 2010. 771 [RFC5892] Faltstrom, P., "The Unicode Code Points and 772 Internationalized Domain Names for Applications (IDNA)", 773 RFC 5892, August 2010. 775 [RFC5893] Alvestrand, H. and C. Karp, "Right-to-Left Scripts for 776 Internationalized Domain Names for Applications (IDNA)", 777 RFC 5893, August 2010. 779 [RFC5894] Klensin, J., "Internationalized Domain Names for 780 Applications (IDNA): Background, Explanation, and 781 Rationale", RFC 5894, August 2010. 783 [RFC6120] Saint-Andre, P., "Extensible Messaging and Presence 784 Protocol (XMPP): Core", RFC 6120, March 2011. 786 [RFC6365] Hoffman, P. and J. Klensin, "Terminology Used in 787 Internationalization in the IETF", BCP 166, RFC 6365, 788 September 2011. 790 [RFC6943] Thaler, D., "Issues in Identifier Comparison for Security 791 Purposes", RFC 6943, May 2013. 793 [UTS39] The Unicode Consortium, "Unicode Technical Standard #39: 794 Unicode Security Mechanisms", July 2012, 795 . 797 Appendix A. Differences from RFC 4013 799 This document builds upon the PRECIS framework defined in 800 [I-D.ietf-precis-framework], which differs fundamentally from the 801 stringprep technology [RFC3454] used in SASLprep [RFC4013]. The 802 primary difference is that stringprep profiles allowed all characters 803 except those which were explicitly disallowed, whereas PRECIS 804 profiles disallow all characters except those which are explicitly 805 allowed (this "inclusion model" was originally used for 806 internationalized domain names in [RFC5891]; see [RFC5894] for 807 further discussion). It is important to keep this distinction in 808 mind when comparing the technology defined in this document to 809 SASLprep [RFC4013]. 811 The following substantive modifications were made from RFC 4013. 813 o A single SASLprep algorithm was replaced by two separate 814 algorithms: one for usernames and another for passwords. 816 o The new preparation algorithms use PRECIS instead of a stringprep 817 profile. The new algorithms work independenctly of Unicode 818 versions. 820 o As recommended in the PRECIS framework, changed the Unicode 821 normalization form from NFKC to NFC. 823 o Some Unicode code points that were mapped to nothing in RFC 4013 824 are simply disallowed by PRECIS. 826 Appendix B. Acknowledgements 828 The following individuals provided helpful feedback on this document: 829 Marc Blanchet, Alan DeKok, Joe Hildebrand, Jeffrey Hutzelman, Simon 830 Josefsson, Jonathan Lennox, Matt Miller, Chris Newman, Yutaka OIWA, 831 Pete Resnick, Andrew Sullivan, and Nico Williams. Nico in particular 832 deserves special recognition for providing text that was used in 833 Section 3.5. Thanks also to Yoshiro YONEYA and Takahiro NEMOTO for 834 implementation feedback. 836 This document borrows some text from [RFC4013] and [RFC6120]. 838 Authors' Addresses 840 Peter Saint-Andre 841 &yet 843 Email: peter@andyet.com 844 URI: https://andyet.com/ 846 Alexey Melnikov 847 Isode Ltd 848 5 Castle Business Village 849 36 Station Road 850 Hampton, Middlesex TW12 2BX 851 UK 853 Email: Alexey.Melnikov@isode.com