idnits 2.17.00 (12 Aug 2021) /tmp/idnits15397/draft-ietf-precis-saslprepbis-07.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 (March 24, 2014) is 2979 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' == Outdated reference: draft-ietf-precis-mappings has been published as RFC 7790 -- 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 (~~), 3 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: September 25, 2014 March 24, 2014 8 Preparation and Comparison of Internationalized Strings Representing 9 Usernames and Passwords 10 draft-ietf-precis-saslprepbis-07 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 September 25, 2014. 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. What the Username and Password Profiles Provide . . . . . . . 3 54 3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 55 4. Usernames . . . . . . . . . . . . . . . . . . . . . . . . . . 4 56 4.1. Definition . . . . . . . . . . . . . . . . . . . . . . . 4 57 4.2. Preparation . . . . . . . . . . . . . . . . . . . . . . . 5 58 4.2.1. Case Mapping . . . . . . . . . . . . . . . . . . . . 6 59 4.3. Examples . . . . . . . . . . . . . . . . . . . . . . . . 7 60 5. Passwords . . . . . . . . . . . . . . . . . . . . . . . . . . 9 61 5.1. Definition . . . . . . . . . . . . . . . . . . . . . . . 9 62 5.2. Preparation . . . . . . . . . . . . . . . . . . . . . . . 10 63 5.3. Examples . . . . . . . . . . . . . . . . . . . . . . . . 10 64 6. Migration . . . . . . . . . . . . . . . . . . . . . . . . . . 11 65 6.1. Usernames . . . . . . . . . . . . . . . . . . . . . . . . 11 66 6.2. Passwords . . . . . . . . . . . . . . . . . . . . . . . . 12 67 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 13 68 7.1. UsernameIdentifierClass . . . . . . . . . . . . . . . . . 13 69 7.2. PasswordFreeformClass . . . . . . . . . . . . . . . . . . 14 70 8. Security Considerations . . . . . . . . . . . . . . . . . . . 15 71 8.1. Password/Passphrase Strength . . . . . . . . . . . . . . 15 72 8.2. Identifier Comparison . . . . . . . . . . . . . . . . . . 15 73 8.3. Reuse of PRECIS . . . . . . . . . . . . . . . . . . . . . 15 74 8.4. Reuse of Unicode . . . . . . . . . . . . . . . . . . . . 15 75 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 15 76 9.1. Normative References . . . . . . . . . . . . . . . . . . 15 77 9.2. Informative References . . . . . . . . . . . . . . . . . 16 78 Appendix A. Differences from RFC 4013 . . . . . . . . . . . . . 17 79 Appendix B. Acknowledgements . . . . . . . . . . . . . . . . . . 18 80 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 18 82 1. Introduction 84 Usernames and passwords are widely used for authentication and 85 authorization on the Internet, either directly when provided in 86 plaintext (as in the SASL PLAIN mechanism [RFC4616] or the HTTP Basic 87 scheme [RFC2617]) or indirectly when provided as the input to a 88 cryptographic algorithm such as a hash function (as in the SASL SCRAM 89 mechanism [RFC5802] or the HTTP Digest scheme [RFC2617]). To 90 increase the likelihood that the input and comparison of usernames 91 and passwords will work in ways that make sense for typical users 92 throughout the world, this document defines rules for preparing and 93 comparing internationalized strings that represent usernames and 94 passwords. 96 The methods specified in this document define two PRECIS profiles as 97 explained in the PRECIS framework specification 99 [I-D.ietf-precis-framework]. This document assumes that all strings 100 are comprised of characters from the Unicode character set [UNICODE], 101 with special attention to characters outside the ASCII range [RFC20]. 102 The methods defined here might be applicable wherever usernames or 103 passwords are used. However, the methods are not intended for use in 104 preparing strings that are not usernames (e.g., email addresses and 105 LDAP distinguished names), nor in cases where identifiers or secrets 106 are not strings (e.g., keys and certificates) or require specialized 107 handling. 109 This document obsoletes RFC 4013 (the "SASLprep" profile of 110 stringprep [RFC3454]) but can be used by technologies other than the 111 Simple Authentication and Security Layer (SASL) [RFC4422], such as 112 HTTP authentication [RFC2617]. 114 2. What the Username and Password Profiles Provide 116 Profiles of the PRECIS framework enable software to handle Unicode 117 characters outside the ASCII range in an automated way, so that such 118 characters are treated carefully and consistently in application 119 protocols. In large measure, these profiles are designed to protect 120 application developers from the potentially negative consequences of 121 supporting the full range of Unicode characters. For instance, in 122 almost all application protocols it would be dangerous to treat the 123 Unicode character SUPERSCRIPT ONE (U+0089) as equivalent to DIGIT ONE 124 (U+0031), since that would result in false positives during 125 comparison, authentication, and authorization (e.g., an attacker 126 could easy spoof an account "user1@example.com"). 128 Whereas a naive use of Unicode would make such attacks trivially 129 easy, the Username PRECIS profile defined in this document generally 130 protects applications from inadvertently causing such problems. 131 (Similar considerations apply to passwords, although here it is 132 desirable to support a wider range of characters so as to maximize 133 entropy during authentication.) 135 3. Terminology 137 Many important terms used in this document are defined in 138 [I-D.ietf-precis-framework], [RFC5890], [RFC6365], and [UNICODE]. 139 The term "non-ASCII space" refers to any Unicode code point having a 140 general category of "Zs", with the exception of U+0020 (here called 141 "ASCII space"). 143 As used here, the term "password" is not literally limited to a word; 144 i.e., a password could be a passphrase consisting of more than one 145 word, perhaps separated by spaces or other such characters. 147 Some SASL mechanisms (e.g., CRAM-MD5, DIGEST-MD5, and SCRAM) specify 148 that the authentication identity used in the context of such 149 mechanisms is a "simple user name" (see Section 2 of [RFC4422] as 150 well as [RFC4013]). Various application technologies also assume 151 that the identity of a user or account takes the form of a username 152 (e.g., authentication for the HyperText Transfer Protocol [RFC2617]), 153 whether or not they use SASL. Note well that the exact form of a 154 username in any particular SASL mechanism or application technology 155 is a matter for implementation and deployment, and that a username 156 does not necessarily map to any particular application identifier 157 (such as the localpart of an email address). 159 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 160 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 161 "OPTIONAL" in this document are to be interpreted as described in 162 [RFC2119]. 164 4. Usernames 166 4.1. Definition 168 This document specifies that a username is a string of Unicode code 169 points [UNICODE], encoded using UTF-8 [RFC3629], and structured 170 either as an ordered sequence of "userparts" (where the complete 171 username can consist of a single userpart or a space-separated 172 sequence of userparts) or as a userpart@domainpart (where the 173 domainpart is an IP literal, an IPv4 address, or a fully-qualified 174 domain name). 176 The syntax for a username is defined as follows using the Augmented 177 Backus-Naur Form (ABNF) [RFC5234]. 179 username = userpart [1*(1*SP userpart)] 180 / userpart '@' domainpart 181 userpart = 1*(idpoint) 182 ; 183 ; an "idpoint" is a UTF-8 encoded Unicode code point 184 ; that conforms to the PRECIS "IdentifierClass" 185 ; 186 domainpart = IP-literal / IPv4address / ifqdn 187 ; 188 ; the "IPv4address" and "IP-literal" rules are 189 ; defined in RFC 3986, and the first-match-wins 190 ; (a.k.a. "greedy") algorithm described in RFC 3986 191 ; applies 192 ; 193 ; reuse of the IP-literal rule from RFC 3986 implies 194 ; that IPv6 addresses are enclosed in square brackets 195 ; (i.e., beginning with '[' and ending with ']') 196 ; 197 ifqdn = 1*1023(domainpoint) 198 ; 199 ; a "domainpoint" is a UTF-8 encoded Unicode code 200 ; point that conforms to RFC 5890 201 ; 203 All code points and blocks not explicitly allowed in the PRECIS 204 IdentifierClass are disallowed; this includes private use characters, 205 surrogate code points, and the other code points and blocks that were 206 defined as "Prohibited Output" in [RFC4013]. In addition, common 207 constructions such as "user@example.com" are allowed as usernames 208 under this specification, as they were under [RFC4013]. 210 Implementation Note: The username construct defined in this 211 document does not necessarily match what all deployed applications 212 might refer to as a "username" or "userid", but instead provides a 213 relatively safe subset of Unicode characters that can be used in 214 existing SASL mechanisms and SASL-using application protocols, and 215 even in most application protocols that do not currently use SASL. 217 4.2. Preparation 219 Each userpart of a username MUST conform to the 220 "UsernameIdentifierClass" profile of the PRECIS IdentifierClass, 221 which is defined as follows: 223 1. The base string class is the "IdentifierClass" specified in 224 [I-D.ietf-precis-framework]. 226 2. Fullwidth and halfwidth characters MUST be mapped to their 227 decomposition mappings. 229 3. So-called additional mappings MAY be applied, such as mapping of 230 delimiters (e.g., characters such as '@', ':', '/', '+', and '-') 231 and special handling of certain characters or classes of 232 characters (e.g., mapping of non-ASCII spaces to ASCII space or 233 mapping of control characters to nothing); the PRECIS mappings 234 document [I-D.ietf-precis-mappings] describes such mappings in 235 more detail. 237 4. Depending on the SASL mechanism, SASL-using application protocol, 238 or non-SASL-using application protocol in question, uppercase and 239 titlecase characters might or might not be mapped to their 240 lowercase equivalents (see Section 4.2.1 below). 242 5. Unicode Normalization Form C (NFC) MUST be applied to all 243 characters. 245 With regard to directionality, the "Bidi Rule" provided in [RFC5893] 246 applies. 248 A username MUST NOT be zero bytes in length. This rule is to be 249 enforced after any normalization and mapping of code points. 251 In protocols that provide usernames as input to a cryptographic 252 algorithm such as a hash function, the client will need to perform 253 proper preparation of the username before applying the algorithm. 255 4.2.1. Case Mapping 257 Case mapping is a matter for the application protocol, protocol 258 implementation, or end deployment. In general, this document 259 suggests that it is preferable to perform case mapping, since not 260 doing so can lead to false positives during authentication and 261 authorization (as described in [RFC6943]) and can result in confusion 262 among end users given the prevalence of case mapping in many existing 263 protocols and applications. However, there can be good reasons to 264 not perform case mapping, such as backward compatibility with 265 deployed infrastructure. 267 In particular: 269 o SASL mechanisms that directly re-use this profile MUST specify 270 whether and when case mapping is to be applied to authentication 271 identifiers. SASL mechanisms SHOULD delay any case mapping to the 272 last possible moment, such as when doing a lookup by username, 273 username comparisons, or generating a cryptographic salt from a 274 username (if the last possible moment happens on the server, then 275 decisions about case mapping can be a matter of deployment 276 policy). In keeping with [RFC4422], SASL mechanisms are not to 277 apply this or any other profile to authorization identifiers. 279 o Application protocols that use SASL (such as IMAP [RFC3501] and 280 XMPP [RFC6120]) and that directly re-use this profile MUST specify 281 whether case mapping is to be applied to authorization 282 identifiers. Such "SASL application protocols" SHOULD delay any 283 case mapping of authorization identifiers to the last possible 284 moment, which happens to necessarily be on the server side (this 285 enables decisions about case mapping to be a matter of deployment 286 policy). In keeping with [RFC4422], SASL application protocols 287 are not to apply this or any other profile to authentication 288 identifiers. 290 o Application protocols that do not use SASL (such as HTTP 291 authentication with the Basic and Digest schemes [RFC2617]) MUST 292 specify whether and when case mapping is to be applied to 293 authentication identifiers and authorization identifiers. Such 294 "non-SASL application protocols" SHOULD delay any case mapping to 295 the last possible moment, such as when doing a lookup by username, 296 username comparisons, or generating a cryptographic salt from a 297 username (if the last possible moment happens on the server, then 298 decisions about case mapping can be a matter of deployment 299 policy). 301 If the specification for a SASL mechanism, SASL application protocol, 302 or non-SASL application protocol specifies the handling of case 303 mapping for strings that conform to the UsernameIdentifierClass, it 304 MUST clearly describe whether case mapping is required, recommended, 305 or optional at the level of the protocol itself, implementations 306 thereof, or service deployments. 308 4.3. Examples 310 The following examples illustrate a small number of usernames that 311 are consistent with the format defined above (note that the 312 characters < and > are used here to delineate the actual usernames 313 and are not part of the username strings). 315 Table 1: A sample of legal usernames 317 +---------------------------------+---------------------------------+ 318 | # | Username | Notes | 319 +---------------------------------+---------------------------------+ 320 | 1 | | A userpart only | 321 +---------------------------------+---------------------------------+ 322 | 2 | | A userpart and domainpart | 323 +---------------------------------+---------------------------------+ 324 | 3 | | The third character is LATIN | 325 | | | SMALL LETTER SHARP S (U+00DF) | 326 +---------------------------------+---------------------------------+ 327 | 4 | <π@example.com> | A userpart of GREEK SMALL | 328 | | | LETTER PI (U+03C0) | 329 +---------------------------------+---------------------------------+ 330 | 5 | <Σ@example.com> | A userpart of GREEK CAPITAL | 331 | | | LETTER SIGMA (U+03A3) | 332 +---------------------------------+---------------------------------+ 333 | 6 | <σ@example.com> | A userpart of GREEK SMALL | 334 | | | LETTER SIGMA (U+03C3) | 335 +---------------------------------+---------------------------------+ 336 | 7 | <ς@example.com> | A userpart of GREEK SMALL | 337 | | | LETTER FINAL SIGMA (U+03C2) | 338 +---------------------------------+---------------------------------+ 340 Several points are worth noting. Regarding examples 2 and 3: 341 although in German the character esszett (LATIN SMALL LETTER SHARP S, 342 U+00DF) can mostly be used interchangeably with the two characters 343 "ss", the userparts in these examples are different and (if desired) 344 a server would need to enforce a registration policy that disallows 345 one of them if the other is registered. Regarding examples 5, 6, and 346 7: optional case-mapping of GREEK CAPITAL LETTER SIGMA (U+03A3) to 347 lowercase (i.e., to GREEK SMALL LETTER SIGMA, U+03C3) during 348 comparison would result in matching the usernames in examples 5 and 349 6; however, because the PRECIS mapping rules do not account for the 350 special status of GREEK SMALL LETTER FINAL SIGMA (U+03C2), the 351 usernames in examples 5 and 7 or examples 6 and 7 would not be 352 matched. 354 The following examples illustrate strings that are not valid 355 usernames because they violate the format defined above. 357 Table 2: A sample of strings that violate the username rules 359 +---------------------------------+---------------------------------+ 360 | # | Non-Username string | Notes | 361 +---------------------------------+---------------------------------+ 362 | 8 | <"juliet"@example.com> | Quotation marks (U+0022) in | 363 | | | userpart | 364 +---------------------------------+---------------------------------+ 365 | 9 | | Space (U+0020) in userpart | 366 +---------------------------------+---------------------------------+ 367 | 10| <@example.com> | Zero-length userpart | 368 +---------------------------------+---------------------------------+ 369 | 11| | The sixth character is ROMAN | 370 | | | NUMERAL FOUR (U+2163) | 371 +---------------------------------+---------------------------------+ 372 | 12| <♚@example.com> | A localpart of BLACK CHESS KING | 373 | | | (U+265A) | 374 +---------------------------------+---------------------------------+ 376 Here again, several points are worth noting. Regarding example 11, 377 the Unicode character ROMAN NUMERAL FOUR (U+2163) has a compatibility 378 equivalent of the string formed of LATIN CAPITAL LETTER I (U+0049) 379 and LATIN CAPITAL LETTER V (U+0056), but characters with 380 compatibility equivalents are not allowed in the PRECIS 381 IdentiferClass. Regarding example 12: symbol characters such as 382 BLACK CHESS KING (U+265A) are not allowed in the PRECIS 383 IdentifierClass. 385 5. Passwords 387 5.1. Definition 389 This document specifies that a password is a string of Unicode code 390 points [UNICODE], encoded using UTF-8 [RFC3629], and conformant to 391 the PRECIS FreeformClass. 393 The syntax for a password is defined as follows using the Augmented 394 Backus-Naur Form (ABNF) [RFC5234]. 396 password = 1*(freepoint) 397 ; 398 ; a "freepoint" is a UTF-8 encoded 399 ; Unicode code point that conforms to 400 ; the PRECIS "FreeformClass" 401 ; 403 All code points and blocks not explicitly allowed in the PRECIS 404 FreeformClass are disallowed; this includes private use characters, 405 surrogate code points, and the other code points and blocks defined 406 as "Prohibited Output" in Section 2.3 of RFC 4013. 408 5.2. Preparation 410 A password MUST conform to the "PasswordFreeformClass" profile of the 411 PRECIS FreeformClass, which is defined as follows: 413 1. The base string class is the "FreeformClass" specified in 414 [I-D.ietf-precis-framework]. 416 2. Fullwidth and halfwidth characters MUST NOT be mapped to their 417 decomposition mappings. 419 3. Any instances of non-ASCII space MUST be mapped to ASCII space 420 (U+0020). 422 4. Uppercase and titlecase characters MUST NOT be mapped to their 423 lowercase equivalents. 425 5. Unicode Normalization Form C (NFC) MUST be applied to all 426 characters. 428 With regard to directionality, the "Bidi Rule" (defined in [RFC5893]) 429 and similar rules are unnecessary and inapplicable to passwords, 430 since they can reduce the range of characters that are allowed in a 431 string and therefore reduce the amount of entropy that is possible in 432 a password. Furthermore, such rules are intended to minimize the 433 possibility that the same string will be displayed differently on a 434 system set for right-to-left display and a system set for left-to- 435 right display; however, passwords are typically not displayed at all 436 and are rarely meant to be interoperable across different systems in 437 the way that non-secret strings like domain names and usernames are. 439 A password MUST NOT be zero bytes in length. This rule is to be 440 enforced after any normalization and mapping of code points. 442 In protocols that provide passwords as input to a cryptographic 443 algorithm such as a hash function, the client will need to perform 444 proper preparation of the password before applying the algorithm, 445 since the password is not available to the server in plaintext form. 447 5.3. Examples 449 The following examples illustrate a small number of passwords that 450 are consistent with the format defined above (note that the 451 characters < and > are used here to delineate the actual passwords 452 and are not part of the username strings). 454 Table 3: A sample of legal passwords 456 +------------------------------------+------------------------------+ 457 | # | Password | Notes | 458 +------------------------------------+------------------------------+ 459 | 13| | ASCII space is allowed | 460 +------------------------------------+------------------------------+ 461 | 14| | | 462 +------------------------------------+------------------------------+ 463 | 15| <πßå> | Non-ASCII letters are OK | 464 | | | (e.g., GREEK SMALL LETTER | 465 | | | PI, U+03C0) | 466 +------------------------------------+------------------------------+ 467 | 16| | Symbols are OK (e.g., BLACK | 468 | | | DIAMOND SUIT, U+2666) | 469 +------------------------------------+------------------------------+ 471 The following examples illustrate strings that are not valid 472 passwords because they violate the format defined above. 474 Table 4: A sample of strings that violate the password rules 476 +------------------------------------+------------------------------+ 477 | # | Password | Notes | 478 +------------------------------------+------------------------------+ 479 | 17| | Non-ASCII space (here, OGHAM | 480 | | | SPACE MARK, U+1680) is not | 481 | | | allowed | 482 +------------------------------------+------------------------------+ 483 | 18| | Controls are disallowed | 484 +------------------------------------+------------------------------+ 486 6. Migration 488 The rules defined in this specification differ slightly from those 489 defined by the SASLprep specification [RFC4013]. The following 490 sections describe these differences, along with their implications 491 for migration, in more detail. 493 6.1. Usernames 495 Deployments that currently use SASLprep for handling usernames might 496 need to scrub existing data when migrating to use of the rules 497 defined in this specification. In particular: 499 o SASLprep specified the use of Unicode Normalization Form KC 500 (NFKC), whereas this usage of the PRECIS IdentifierClass employs 501 Unicode Normalization Form C (NFC). In practice this change is 502 unlikely to cause significant problems, because NFKC provides 503 methods for mapping Unicode code points with compatibility 504 equivalents to those equivalents, whereas the PRECIS 505 IdentifierClass entirely disallows Unicode code points with 506 compatibility equivalents (i.e., during comparison NFKC is more 507 "aggressive" about finding matches than is NFC). A few examples 508 might suffice to indicate the nature of the problem: (1) U+017F 509 LATIN SMALL LETTER LONG S is compatibility equivalent to U+0073 510 LATIN SMALL LETTER S (2) U+2163 ROMAN NUMERAL FOUR is 511 compatibility equivalent to U+0049 LATIN CAPITAL LETTER I and 512 U+0056 LATIN CAPITAL LETTER V (3) U+FB01 LATIN SMALL LIGATURE FI 513 is compatibility equivalent to U+0066 LATIN SMALL LETTER F and 514 U+0069 LATIN SMALL LETTER I. Under SASLprep, the use of NFKC also 515 handled the mapping of fullwidth and halfwidth code points to 516 their decomposition mappings. Although it is expected that code 517 points with compatibility equivalents are rare in existing 518 usernames, for migration purposes deployments might want to search 519 their database of usernames for Unicode code points with 520 compatibility equivalents and map those code points to their 521 compatibility equivalents. 523 o SASLprep mapped the "characters commonly mapped to nothing" from 524 Appendix B.1 of [RFC3454]) to nothing, whereas the PRECIS 525 IdentifierClass entirely disallows most of these characters, which 526 correspond to the code points from the "M" category defined under 527 Section 6.13 of [I-D.ietf-precis-framework] (with the exception of 528 U+1806 MONGOLIAN TODO SOFT HYPHEN, which was "commonly mapped to 529 nothing" in Unicode 3.2 but at the time of this writing does not 530 have a derived property of Default_Ignorable_Code_Point in Unicode 531 6.2). For migration purposes, deployments might want to remove 532 code points contained in the PRECIS "M" category from usernames. 534 o SASLprep allowed uppercase and titlecase characters, whereas this 535 usage of the PRECIS IdentifierClass maps uppercase and titlecase 536 characters to their lowercase equivalents. For migration 537 purposes, deployments can either convert uppercase and titlecase 538 characters to their lowercase equivalents in usernames (thus 539 losing the case information) or preserve uppercase and titlecase 540 characters and ignore the case difference when comparing 541 usernames. 543 6.2. Passwords 545 Depending on local service policy, migration from RFC 4013 to this 546 specification might not involve any scrubbing of data (since 547 passwords might not be stored in the clear anyway); however, service 548 providers need to be aware of possible issues that might arise during 549 migration. In particular: 551 o SASLprep specified the use of Unicode Normalization Form KC 552 (NFKC), whereas this usage of the PRECIS FreeformClass employs 553 Unicode Normalization Form C (NFC). Because NFKC is more 554 aggressive about finding matches than NFC, in practice this change 555 is unlikely to cause significant problems and indeed has the 556 security benefit of probably resulting in fewer false positives 557 when comparing passwords. A few examples might suffice to 558 indicate the nature of the problem: (1) U+017F LATIN SMALL LETTER 559 LONG S is compatibility equivalent to U+0073 LATIN SMALL LETTER S 560 (2) U+2163 ROMAN NUMERAL FOUR is compatibility equivalent to 561 U+0049 LATIN CAPITAL LETTER I and U+0056 LATIN CAPITAL LETTER V 562 (3) U+FB01 LATIN SMALL LIGATURE FI is compatibility equivalent to 563 U+0066 LATIN SMALL LETTER F and U+0069 LATIN SMALL LETTER I. 564 Under SASLprep, the use of NFKC also handled the mapping of 565 fullwidth and halfwidth code points to their decomposition 566 mappings. Although it is expected that code points with 567 compatibility equivalents are rare in existing passwords, some 568 passwords that matched when SASLprep was used might no longer work 569 when the rules in this specification are applied. 571 o SASLprep mapped the "characters commonly mapped to nothing" from 572 Appendix B.1 of [RFC3454]) to nothing, whereas the PRECIS 573 FreeformClass entirely disallows such characters, which correspond 574 to the code points from the "M" category defined under 575 Section 6.13 of [I-D.ietf-precis-framework] (with the exception of 576 U+1806 MONGOLIAN TODO SOFT HYPHEN, which was commonly mapped to 577 nothing in Unicode 3.2 but at the time of this writing is allowed 578 by Unicode 6.2). In practice, this change will probably have no 579 effect on comparison, but user-oriented software might reject such 580 code points instead of ignoring them during password preparation. 582 7. IANA Considerations 584 The IANA shall add the following entries to the PRECIS Profiles 585 Registry. 587 7.1. UsernameIdentifierClass 589 Name: UsernameIdentifierClass. 591 Applicability: Usernames in security and application protocols. 593 Base Class: IdentifierClass. 595 Replaces: The SASLprep profile of Stringprep. 597 Width Mapping: Map fullwidth and halfwidth characters to their 598 decomposition mappings. 600 Additional Mappings: None required or recommended. 602 Case Mapping: To be defined by security or application protocols 603 that use this profile. 605 Normalization: NFC. 607 Directionality: The "Bidi Rule" defined in RFC 5893 applies. 609 Exclusions: None. 611 Enforcement: To be defined by security or application protocols that 612 use this profile. 614 Specification: RFC XXXX. [Note to RFC Editor: please change XXXX to 615 the number issued for this specification.] 617 7.2. PasswordFreeformClass 619 Name: PasswordFreeformClass. 621 Applicability: Passwords in security and application protocols. 623 Base Class: FreeformClass 625 Replaces: The SASLprep profile of Stringprep. 627 Width Mapping: None. 629 Additional Mappings: Map non-ASCII space characters to ASCII space. 631 Case Mapping: None. 633 Normalization: NFC. 635 Directionality: None. 637 Exclusions: None. 639 Enforcement: To be defined by security or application protocols that 640 use this profile. 642 Specification: RFC XXXX. 644 8. Security Considerations 646 8.1. Password/Passphrase Strength 648 The ability to include a wide range of characters in passwords and 649 passphrases can increase the potential for creating a strong password 650 with high entropy. However, in practice, the ability to include such 651 characters ought to be weighed against the possible need to reproduce 652 them on various devices using various input methods. 654 8.2. Identifier Comparison 656 The process of comparing identifiers (such as SASL simple user names, 657 authentication identifiers, and authorization identifiers) can lead 658 to either false negatives or false positives, both of which have 659 security implications. A more detailed discussion can be found in 660 [RFC6943]. 662 8.3. Reuse of PRECIS 664 The security considerations described in [I-D.ietf-precis-framework] 665 apply to the "IdentifierClass" and "FreeformClass" base string 666 classes used in this document for usernames and passwords, 667 respectively. 669 8.4. Reuse of Unicode 671 The security considerations described in [UTS39] apply to the use of 672 Unicode characters in usernames and passwords. 674 9. References 676 9.1. Normative References 678 [I-D.ietf-precis-framework] 679 Saint-Andre, P. and M. Blanchet, "Precis Framework: 680 Handling Internationalized Strings in Protocols", draft- 681 ietf-precis-framework-15 (work in progress), March 2014. 683 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 684 Requirement Levels", BCP 14, RFC 2119, March 1997. 686 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 687 10646", STD 63, RFC 3629, November 2003. 689 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 690 Specifications: ABNF", STD 68, RFC 5234, January 2008. 692 [UNICODE] The Unicode Consortium, "The Unicode Standard, Version 693 6.1", 2012, 694 . 696 9.2. Informative References 698 [I-D.ietf-precis-mappings] 699 Yoneya, Y. and T. NEMOTO, "Mapping characters for PRECIS 700 classes", draft-ietf-precis-mappings-07 (work in 701 progress), February 2014. 703 [RFC20] Cerf, V., "ASCII format for network interchange", RFC 20, 704 October 1969. 706 [RFC2617] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S., 707 Leach, P., Luotonen, A., and L. Stewart, "HTTP 708 Authentication: Basic and Digest Access Authentication", 709 RFC 2617, June 1999. 711 [RFC3454] Hoffman, P. and M. Blanchet, "Preparation of 712 Internationalized Strings ("stringprep")", RFC 3454, 713 December 2002. 715 [RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 716 4rev1", RFC 3501, March 2003. 718 [RFC4013] Zeilenga, K., "SASLprep: Stringprep Profile for User Names 719 and Passwords", RFC 4013, February 2005. 721 [RFC4422] Melnikov, A., Ed. and K. Zeilenga, Ed., "Simple 722 Authentication and Security Layer (SASL)", RFC 4422, June 723 2006. 725 [RFC4616] Zeilenga, K., "The PLAIN Simple Authentication and 726 Security Layer (SASL) Mechanism", RFC 4616, August 2006. 728 [RFC5802] Newman, C., Menon-Sen, A., Melnikov, A., and N. Williams, 729 "Salted Challenge Response Authentication Mechanism 730 (SCRAM) SASL and GSS-API Mechanisms", RFC 5802, July 2010. 732 [RFC5890] Klensin, J., "Internationalized Domain Names for 733 Applications (IDNA): Definitions and Document Framework", 734 RFC 5890, August 2010. 736 [RFC5891] Klensin, J., "Internationalized Domain Names in 737 Applications (IDNA): Protocol", RFC 5891, August 2010. 739 [RFC5893] Alvestrand, H. and C. Karp, "Right-to-Left Scripts for 740 Internationalized Domain Names for Applications (IDNA)", 741 RFC 5893, August 2010. 743 [RFC5894] Klensin, J., "Internationalized Domain Names for 744 Applications (IDNA): Background, Explanation, and 745 Rationale", RFC 5894, August 2010. 747 [RFC6120] Saint-Andre, P., "Extensible Messaging and Presence 748 Protocol (XMPP): Core", RFC 6120, March 2011. 750 [RFC6365] Hoffman, P. and J. Klensin, "Terminology Used in 751 Internationalization in the IETF", BCP 166, RFC 6365, 752 September 2011. 754 [RFC6943] Thaler, D., "Issues in Identifier Comparison for Security 755 Purposes", RFC 6943, May 2013. 757 [UTS39] The Unicode Consortium, "Unicode Technical Standard #39: 758 Unicode Security Mechanisms", July 2012, 759 . 761 Appendix A. Differences from RFC 4013 763 This document builds upon the PRECIS framework defined in 764 [I-D.ietf-precis-framework], which differs fundamentally from the 765 stringprep technology [RFC3454] used in SASLprep [RFC4013]. The 766 primary difference is that stringprep profiles allowed all characters 767 except those which were explicitly disallowed, whereas PRECIS 768 profiles disallow all characters except those which are explicitly 769 allowed (this "inclusion model" was originally used for 770 internationalized domain names in [RFC5891]; see [RFC5894] for 771 further discussion). It is important to keep this distinction in 772 mind when comparing the technology defined in this document to 773 SASLprep [RFC4013]. 775 The following substantive modifications were made from RFC 4013. 777 o A single SASLprep algorithm was replaced by two separate 778 algorithms: one for usernames and another for passwords. 780 o The new preparation algorithms use PRECIS instead of a stringprep 781 profile. The new algorithms work independenctly of Unicode 782 versions. 784 o As recommended in the PRECIS framwork, changed the Unicode 785 normalization form to NFC (from NFKC). 787 o Some Unicode code points that were mapped to nothing in RFC 4013 788 are simply disallowed by PRECIS. 790 Appendix B. Acknowledgements 792 The following individuals provided helpful feedback on this document: 793 Marc Blanchet, Alan DeKok, Joe Hildebrand, Jeffrey Hutzelman, Simon 794 Josefsson, Jonathan Lennox, Matt Miller, Chris Newman, Yutaka OIWA, 795 Pete Resnick, Andrew Sullivan, and Nico Williams (Nico in particular 796 provided text that was used in Section 4.2.1). Thanks also to 797 Yoshiro YONEYA and Takahiro NEMOTO for implementation feedback. 799 This document borrows some text from [RFC4013] and [RFC6120]. 801 Authors' Addresses 803 Peter Saint-Andre 804 &yet 805 P.O. Box 787 806 Parker, CO 80134 807 USA 809 Email: ietf@stpeter.im 811 Alexey Melnikov 812 Isode Ltd 813 5 Castle Business Village 814 36 Station Road 815 Hampton, Middlesex TW12 2BX 816 UK 818 Email: Alexey.Melnikov@isode.com