idnits 2.17.1 draft-ietf-precis-saslprepbis-08.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 10, 2014) is 3486 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-18 -- 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 13, 2015 October 10, 2014 8 Preparation and Comparison of Internationalized Strings Representing 9 Usernames and Passwords 10 draft-ietf-precis-saslprepbis-08 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 13, 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. Preparation, Comparison, and Enforcement . . . . . . . . . . 4 55 4. Usernames . . . . . . . . . . . . . . . . . . . . . . . . . . 5 56 4.1. Definition . . . . . . . . . . . . . . . . . . . . . . . 5 57 4.2. Preparation . . . . . . . . . . . . . . . . . . . . . . . 6 58 4.3. Enforcement . . . . . . . . . . . . . . . . . . . . . . . 6 59 4.4. Comparison . . . . . . . . . . . . . . . . . . . . . . . 6 60 4.5. Case Mapping . . . . . . . . . . . . . . . . . . . . . . 7 61 4.6. Examples . . . . . . . . . . . . . . . . . . . . . . . . 8 62 5. Passwords . . . . . . . . . . . . . . . . . . . . . . . . . . 9 63 5.1. Definition . . . . . . . . . . . . . . . . . . . . . . . 9 64 5.2. Preparation . . . . . . . . . . . . . . . . . . . . . . . 10 65 5.3. Enforcement . . . . . . . . . . . . . . . . . . . . . . . 10 66 5.4. Comparison . . . . . . . . . . . . . . . . . . . . . . . 11 67 5.5. Examples . . . . . . . . . . . . . . . . . . . . . . . . 11 68 6. Migration . . . . . . . . . . . . . . . . . . . . . . . . . . 12 69 6.1. Usernames . . . . . . . . . . . . . . . . . . . . . . . . 12 70 6.2. Passwords . . . . . . . . . . . . . . . . . . . . . . . . 13 71 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 14 72 7.1. UsernameIdentifierClass . . . . . . . . . . . . . . . . . 14 73 7.2. PasswordFreeformClass . . . . . . . . . . . . . . . . . . 15 74 8. Security Considerations . . . . . . . . . . . . . . . . . . . 16 75 8.1. Password/Passphrase Strength . . . . . . . . . . . . . . 16 76 8.2. Identifier Comparison . . . . . . . . . . . . . . . . . . 16 77 8.3. Reuse of PRECIS . . . . . . . . . . . . . . . . . . . . . 16 78 8.4. Reuse of Unicode . . . . . . . . . . . . . . . . . . . . 16 79 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 16 80 9.1. Normative References . . . . . . . . . . . . . . . . . . 16 81 9.2. Informative References . . . . . . . . . . . . . . . . . 17 82 Appendix A. Differences from RFC 4013 . . . . . . . . . . . . . 18 83 Appendix B. Acknowledgements . . . . . . . . . . . . . . . . . . 19 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. Preparation, Comparison, and Enforcement 167 This document distinguishes between three different actions that an 168 entity can take in handling a username or password: 170 o Enforcement entails applying all of the rules specified for a 171 particular profile (UsernameIdentifierClass or 172 PasswordFreeformClass) to an individual string. 174 o Comparison entails applying all of the rules specified for a 175 particular profile to two separate strings, for the purpose of 176 determining if the two strings are equivalent. 178 o Preparation entails only ensuring that the characters in an 179 individual string are allowed by the underlying PRECIS base class 180 (IdentifierClass or FreeformClass). 182 In most cases, "servers" are responsible for enforcement and 183 "clients" are responsible only for preparation. Although some 184 information regarding these responsibilities (e.g., the protocol 185 slots in which usernames or passwords can be placed) needs to be 186 provided in specifications that use the profiles defined in this 187 document, the general outlines of such responsibilities are explained 188 in the following sections. 190 4. Usernames 192 4.1. Definition 194 This document specifies that a username is a string of Unicode code 195 points [UNICODE], encoded using UTF-8 [RFC3629], and structured 196 either as an ordered sequence of "userparts" (where the complete 197 username can consist of a single userpart or a space-separated 198 sequence of userparts) or as a userpart@domainpart (where the 199 domainpart is an IP literal, an IPv4 address, or a fully-qualified 200 domain name). 202 The syntax for a username is defined as follows using the Augmented 203 Backus-Naur Form (ABNF) [RFC5234]. 205 username = userpart [1*(1*SP userpart)] 206 / userpart '@' domainpart 207 userpart = 1*(idpoint) 208 ; 209 ; an "idpoint" is a UTF-8 encoded Unicode code point 210 ; that conforms to the PRECIS "IdentifierClass" 211 ; 212 domainpart = IP-literal / IPv4address / ifqdn 213 ; 214 ; the "IPv4address" and "IP-literal" rules are 215 ; defined in RFC 3986, and the first-match-wins 216 ; (a.k.a. "greedy") algorithm described in RFC 3986 217 ; applies 218 ; 219 ; reuse of the IP-literal rule from RFC 3986 implies 220 ; that IPv6 addresses are enclosed in square brackets 221 ; (i.e., beginning with '[' and ending with ']') 222 ; 223 ifqdn = 1*1023(domainpoint) 224 ; 225 ; a "domainpoint" is a UTF-8 encoded Unicode code 226 ; point that conforms to RFC 5890 227 ; 229 All code points and blocks not explicitly allowed in the PRECIS 230 IdentifierClass are disallowed; this includes private use characters, 231 surrogate code points, and the other code points and blocks that were 232 defined as "Prohibited Output" in [RFC4013]. In addition, common 233 constructions such as "user@example.com" are allowed as usernames 234 under this specification, as they were under [RFC4013]. 236 Implementation Note: The username construct defined in this 237 document does not necessarily match what all deployed applications 238 might refer to as a "username" or "userid", but instead provides a 239 relatively safe subset of Unicode characters that can be used in 240 existing SASL mechanisms and SASL-using application protocols, and 241 even in most application protocols that do not currently use SASL. 243 A username MUST NOT be zero bytes in length. This rule is to be 244 enforced after any normalization and mapping of code points. 246 In protocols that provide usernames as input to a cryptographic 247 algorithm such as a hash function, the client will need to perform 248 proper preparation of the username before applying the algorithm. 250 4.2. Preparation 252 An entity that prepares a string for inclusion in a username slot 253 MUST ensure that the string consists only of Unicode code points that 254 conform to the "IdentifierClass" base string class defined in 255 [I-D.ietf-precis-framework]. In addition, the string MUST be encoded 256 as UTF-8 [RFC3629]. 258 4.3. Enforcement 260 An entity that performs enforcement in username slots MUST prepare a 261 string as described in the previous section and MUST also apply the 262 rules specified below for the UsernameIdentifierClass profile (these 263 rules MUST be applied in the order shown). 265 1. Width Mapping Rule: Fullwidth and halfwidth characters MUST be 266 mapped to their decomposition mappings. 268 2. Additional Mapping Rule: There is no additional mapping rule. 270 3. Case Mapping Rule: There is no case mapping rule (although see 271 Section 4.5 below). 273 4. Normalization Rule: Unicode Normalization Form C (NFC) MUST be 274 applied to all characters. 276 5. Exclusion Rule: There is no exclusion rule. 278 6. Directionality Rule: The "Bidi Rule" provided in [RFC5893] 279 applies. 281 4.4. Comparison 283 An entity that performs comparison of two strings before or after 284 their inclusion in username slots MUST prepare each string and 285 enforce the rules specified in the previous two sections. The two 286 strings are to be considered equivalent if they are an exact octet- 287 for-octet match (sometimes called "bit-string identity"). 289 4.5. Case Mapping 291 Case mapping is a matter for the application protocol, protocol 292 implementation, or end deployment. In general, this document 293 suggests that it is preferable to perform case mapping, since not 294 doing so can lead to false positives during authentication and 295 authorization (as described in [RFC6943]) and can result in confusion 296 among end users given the prevalence of case mapping in many existing 297 protocols and applications. However, there can be good reasons to 298 not perform case mapping, such as backward compatibility with 299 deployed infrastructure. 301 In particular: 303 o SASL mechanisms that directly re-use this profile MUST specify 304 whether and when case mapping is to be applied to authentication 305 identifiers. SASL mechanisms SHOULD delay any case mapping to the 306 last possible moment, such as when doing a lookup by username, 307 username comparisons, or generating a cryptographic salt from a 308 username (if the last possible moment happens on the server, then 309 decisions about case mapping can be a matter of deployment 310 policy). In keeping with [RFC4422], SASL mechanisms are not to 311 apply this or any other profile to authorization identifiers. 313 o Application protocols that use SASL (such as IMAP [RFC3501] and 314 XMPP [RFC6120]) and that directly re-use this profile MUST specify 315 whether case mapping is to be applied to authorization 316 identifiers. Such "SASL application protocols" SHOULD delay any 317 case mapping of authorization identifiers to the last possible 318 moment, which happens to necessarily be on the server side (this 319 enables decisions about case mapping to be a matter of deployment 320 policy). In keeping with [RFC4422], SASL application protocols 321 are not to apply this or any other profile to authentication 322 identifiers. 324 o Application protocols that do not use SASL (such as HTTP 325 authentication with the Basic and Digest schemes [RFC2617]) MUST 326 specify whether and when case mapping is to be applied to 327 authentication identifiers and authorization identifiers. Such 328 "non-SASL application protocols" SHOULD delay any case mapping to 329 the last possible moment, such as when doing a lookup by username, 330 username comparisons, or generating a cryptographic salt from a 331 username (if the last possible moment happens on the server, then 332 decisions about case mapping can be a matter of deployment 333 policy). 335 If the specification for a SASL mechanism, SASL application protocol, 336 or non-SASL application protocol specifies the handling of case 337 mapping for strings that conform to the UsernameIdentifierClass, it 338 MUST clearly describe whether case mapping is required, recommended, 339 or optional at the level of the protocol itself, implementations 340 thereof, or service deployments. 342 4.6. Examples 344 The following examples illustrate a small number of usernames that 345 are consistent with the format defined above (note that the 346 characters < and > are used here to delineate the actual usernames 347 and are not part of the username strings). 349 Table 1: A sample of legal usernames 351 +---------------------------------+---------------------------------+ 352 | # | Username | Notes | 353 +---------------------------------+---------------------------------+ 354 | 1 | | A userpart only | 355 +---------------------------------+---------------------------------+ 356 | 2 | | A userpart and domainpart | 357 +---------------------------------+---------------------------------+ 358 | 3 | | The third character is LATIN | 359 | | | SMALL LETTER SHARP S (U+00DF) | 360 +---------------------------------+---------------------------------+ 361 | 4 | <π@example.com> | A userpart of GREEK SMALL | 362 | | | LETTER PI (U+03C0) | 363 +---------------------------------+---------------------------------+ 364 | 5 | <Σ@example.com> | A userpart of GREEK CAPITAL | 365 | | | LETTER SIGMA (U+03A3) | 366 +---------------------------------+---------------------------------+ 367 | 6 | <σ@example.com> | A userpart of GREEK SMALL | 368 | | | LETTER SIGMA (U+03C3) | 369 +---------------------------------+---------------------------------+ 370 | 7 | <ς@example.com> | A userpart of GREEK SMALL | 371 | | | LETTER FINAL SIGMA (U+03C2) | 372 +---------------------------------+---------------------------------+ 374 Several points are worth noting. Regarding examples 2 and 3: 375 although in German the character esszett (LATIN SMALL LETTER SHARP S, 376 U+00DF) can mostly be used interchangeably with the two characters 377 "ss", the userparts in these examples are different and (if desired) 378 a server would need to enforce a registration policy that disallows 379 one of them if the other is registered. Regarding examples 5, 6, and 380 7: optional case-mapping of GREEK CAPITAL LETTER SIGMA (U+03A3) to 381 lowercase (i.e., to GREEK SMALL LETTER SIGMA, U+03C3) during 382 comparison would result in matching the usernames in examples 5 and 383 6; however, because the PRECIS mapping rules do not account for the 384 special status of GREEK SMALL LETTER FINAL SIGMA (U+03C2), the 385 usernames in examples 5 and 7 or examples 6 and 7 would not be 386 matched. 388 The following examples illustrate strings that are not valid 389 usernames because they violate the format defined above. 391 Table 2: A sample of strings that violate the username rules 393 +---------------------------------+---------------------------------+ 394 | # | Non-Username string | Notes | 395 +---------------------------------+---------------------------------+ 396 | 8 | <"juliet"@example.com> | Quotation marks (U+0022) in | 397 | | | userpart | 398 +---------------------------------+---------------------------------+ 399 | 9 | | Space (U+0020) in userpart | 400 +---------------------------------+---------------------------------+ 401 | 10| <@example.com> | Zero-length userpart | 402 +---------------------------------+---------------------------------+ 403 | 11| | The sixth character is ROMAN | 404 | | | NUMERAL FOUR (U+2163) | 405 +---------------------------------+---------------------------------+ 406 | 12| <♚@example.com> | A localpart of BLACK CHESS KING | 407 | | | (U+265A) | 408 +---------------------------------+---------------------------------+ 410 Here again, several points are worth noting. Regarding example 11, 411 the Unicode character ROMAN NUMERAL FOUR (U+2163) has a compatibility 412 equivalent of the string formed of LATIN CAPITAL LETTER I (U+0049) 413 and LATIN CAPITAL LETTER V (U+0056), but characters with 414 compatibility equivalents are not allowed in the PRECIS 415 IdentiferClass. Regarding example 12: symbol characters such as 416 BLACK CHESS KING (U+265A) are not allowed in the PRECIS 417 IdentifierClass. 419 5. Passwords 421 5.1. Definition 423 This document specifies that a password is a string of Unicode code 424 points [UNICODE], encoded using UTF-8 [RFC3629], and conformant to 425 the PRECIS FreeformClass. 427 The syntax for a password is defined as follows using the Augmented 428 Backus-Naur Form (ABNF) [RFC5234]. 430 password = 1*(freepoint) 431 ; 432 ; a "freepoint" is a UTF-8 encoded 433 ; Unicode code point that conforms to 434 ; the PRECIS "FreeformClass" 435 ; 437 All code points and blocks not explicitly allowed in the PRECIS 438 FreeformClass are disallowed; this includes private use characters, 439 surrogate code points, and the other code points and blocks defined 440 as "Prohibited Output" in Section 2.3 of RFC 4013. 442 A password MUST NOT be zero bytes in length. This rule is to be 443 enforced after any normalization and mapping of code points. 445 In protocols that provide passwords as input to a cryptographic 446 algorithm such as a hash function, the client will need to perform 447 proper preparation of the password before applying the algorithm, 448 since the password is not available to the server in plaintext form. 450 5.2. Preparation 452 An entity that prepares a string for inclusion in a password slot 453 MUST ensure that the string consists only of Unicode code points that 454 conform to the "FreeformClass" base string class defined in 455 [I-D.ietf-precis-framework]. In addition, the string MUST be encoded 456 as UTF-8 [RFC3629]. 458 5.3. Enforcement 460 An entity that performs enforcement in password slots MUST prepare a 461 string as described in the previous section and MUST also apply the 462 rules specified below for the PasswordFreeformClass (these rules MUST 463 be applied in the order shown). 465 1. Width Mapping Rule: Fullwidth and halfwidth characters MUST NOT 466 be mapped to their decomposition mappings. 468 2. Additional Mapping Rule: Any instances of non-ASCII space MUST be 469 mapped to ASCII space (U+0020); such an instance is any Unicode 470 code point that has a compatibility mapping of any kind to U+0020 471 SPACE (including but not limited to as for U+0384 GREEK 472 TONOS, as for U+2007 FIGURE SPACE, and as for 473 U+3000 IDEOGRAPHIC SPACE). 475 3. Case Mapping Rule: Uppercase and titlecase characters MUST NOT be 476 mapped to their lowercase equivalents. 478 4. Normalization Rule: Unicode Normalization Form C (NFC) MUST be 479 applied to all characters. 481 5. Exclusion Rule: There is no exclusion rule. 483 6. Directionality Rule: There is no directionality rule. 485 With regard to directionality, the "Bidi Rule" (defined in [RFC5893]) 486 and similar rules are unnecessary and inapplicable to passwords, 487 since they can reduce the range of characters that are allowed in a 488 string and therefore reduce the amount of entropy that is possible in 489 a password. Furthermore, such rules are intended to minimize the 490 possibility that the same string will be displayed differently on a 491 system set for right-to-left display and a system set for left-to- 492 right display; however, passwords are typically not displayed at all 493 and are rarely meant to be interoperable across different systems in 494 the way that non-secret strings like domain names and usernames are. 496 5.4. Comparison 498 An entity that performs comparison of two strings before or after 499 their inclusion in password slots MUST prepare each string and 500 enforce the rules specified in the previous two sections. The two 501 strings are to be considered equivalent if they are an exact octet- 502 for-octet match (sometimes called "bit-string identity"). 504 5.5. Examples 506 The following examples illustrate a small number of passwords that 507 are consistent with the format defined above (note that the 508 characters < and > are used here to delineate the actual passwords 509 and are not part of the username strings). 511 Table 3: A sample of legal passwords 513 +------------------------------------+------------------------------+ 514 | # | Password | Notes | 515 +------------------------------------+------------------------------+ 516 | 13| | ASCII space is allowed | 517 +------------------------------------+------------------------------+ 518 | 14| | | 519 +------------------------------------+------------------------------+ 520 | 15| <πßå> | Non-ASCII letters are OK | 521 | | | (e.g., GREEK SMALL LETTER | 522 | | | PI, U+03C0) | 523 +------------------------------------+------------------------------+ 524 | 16| | Symbols are OK (e.g., BLACK | 525 | | | DIAMOND SUIT, U+2666) | 526 +------------------------------------+------------------------------+ 528 The following examples illustrate strings that are not valid 529 passwords because they violate the format defined above. 531 Table 4: A sample of strings that violate the password rules 533 +------------------------------------+------------------------------+ 534 | # | Password | Notes | 535 +------------------------------------+------------------------------+ 536 | 17| | Non-ASCII space (here, OGHAM | 537 | | | SPACE MARK, U+1680) is not | 538 | | | allowed | 539 +------------------------------------+------------------------------+ 540 | 18| | Controls are disallowed | 541 +------------------------------------+------------------------------+ 543 6. Migration 545 The rules defined in this specification differ slightly from those 546 defined by the SASLprep specification [RFC4013]. The following 547 sections describe these differences, along with their implications 548 for migration, in more detail. 550 6.1. Usernames 552 Deployments that currently use SASLprep for handling usernames might 553 need to scrub existing data when migrating to use of the rules 554 defined in this specification. In particular: 556 o SASLprep specified the use of Unicode Normalization Form KC 557 (NFKC), whereas this usage of the PRECIS IdentifierClass employs 558 Unicode Normalization Form C (NFC). In practice this change is 559 unlikely to cause significant problems, because NFKC provides 560 methods for mapping Unicode code points with compatibility 561 equivalents to those equivalents, whereas the PRECIS 562 IdentifierClass entirely disallows Unicode code points with 563 compatibility equivalents (i.e., during comparison NFKC is more 564 "aggressive" about finding matches than is NFC). A few examples 565 might suffice to indicate the nature of the problem: (1) U+017F 566 LATIN SMALL LETTER LONG S is compatibility equivalent to U+0073 567 LATIN SMALL LETTER S (2) U+2163 ROMAN NUMERAL FOUR is 568 compatibility equivalent to U+0049 LATIN CAPITAL LETTER I and 569 U+0056 LATIN CAPITAL LETTER V (3) U+FB01 LATIN SMALL LIGATURE FI 570 is compatibility equivalent to U+0066 LATIN SMALL LETTER F and 571 U+0069 LATIN SMALL LETTER I. Under SASLprep, the use of NFKC also 572 handled the mapping of fullwidth and halfwidth code points to 573 their decomposition mappings. Although it is expected that code 574 points with compatibility equivalents are rare in existing 575 usernames, for migration purposes deployments might want to search 576 their database of usernames for Unicode code points with 577 compatibility equivalents and map those code points to their 578 compatibility equivalents. 580 o SASLprep mapped the "characters commonly mapped to nothing" from 581 Appendix B.1 of [RFC3454]) to nothing, whereas the PRECIS 582 IdentifierClass entirely disallows most of these characters, which 583 correspond to the code points from the "M" category defined under 584 Section 6.13 of [I-D.ietf-precis-framework] (with the exception of 585 U+1806 MONGOLIAN TODO SOFT HYPHEN, which was "commonly mapped to 586 nothing" in Unicode 3.2 but at the time of this writing does not 587 have a derived property of Default_Ignorable_Code_Point in Unicode 588 6.2). For migration purposes, deployments might want to remove 589 code points contained in the PRECIS "M" category from usernames. 591 o SASLprep allowed uppercase and titlecase characters, whereas this 592 usage of the PRECIS IdentifierClass maps uppercase and titlecase 593 characters to their lowercase equivalents. For migration 594 purposes, deployments can either convert uppercase and titlecase 595 characters to their lowercase equivalents in usernames (thus 596 losing the case information) or preserve uppercase and titlecase 597 characters and ignore the case difference when comparing 598 usernames. 600 6.2. Passwords 602 Depending on local service policy, migration from RFC 4013 to this 603 specification might not involve any scrubbing of data (since 604 passwords might not be stored in the clear anyway); however, service 605 providers need to be aware of possible issues that might arise during 606 migration. In particular: 608 o SASLprep specified the use of Unicode Normalization Form KC 609 (NFKC), whereas this usage of the PRECIS FreeformClass employs 610 Unicode Normalization Form C (NFC). Because NFKC is more 611 aggressive about finding matches than NFC, in practice this change 612 is unlikely to cause significant problems and indeed has the 613 security benefit of probably resulting in fewer false positives 614 when comparing passwords. A few examples might suffice to 615 indicate the nature of the problem: (1) U+017F LATIN SMALL LETTER 616 LONG S is compatibility equivalent to U+0073 LATIN SMALL LETTER S 617 (2) U+2163 ROMAN NUMERAL FOUR is compatibility equivalent to 618 U+0049 LATIN CAPITAL LETTER I and U+0056 LATIN CAPITAL LETTER V 619 (3) U+FB01 LATIN SMALL LIGATURE FI is compatibility equivalent to 620 U+0066 LATIN SMALL LETTER F and U+0069 LATIN SMALL LETTER I. 621 Under SASLprep, the use of NFKC also handled the mapping of 622 fullwidth and halfwidth code points to their decomposition 623 mappings. Although it is expected that code points with 624 compatibility equivalents are rare in existing passwords, some 625 passwords that matched when SASLprep was used might no longer work 626 when the rules in this specification are applied. 628 o SASLprep mapped the "characters commonly mapped to nothing" from 629 Appendix B.1 of [RFC3454]) to nothing, whereas the PRECIS 630 FreeformClass entirely disallows such characters, which correspond 631 to the code points from the "M" category defined under 632 Section 6.13 of [I-D.ietf-precis-framework] (with the exception of 633 U+1806 MONGOLIAN TODO SOFT HYPHEN, which was commonly mapped to 634 nothing in Unicode 3.2 but at the time of this writing is allowed 635 by Unicode 6.2). In practice, this change will probably have no 636 effect on comparison, but user-oriented software might reject such 637 code points instead of ignoring them during password preparation. 639 7. IANA Considerations 641 The IANA shall add the following entries to the PRECIS Profiles 642 Registry. 644 7.1. UsernameIdentifierClass 646 Name: UsernameIdentifierClass. 648 Applicability: Usernames in security and application protocols. 650 Base Class: IdentifierClass. 652 Replaces: The SASLprep profile of Stringprep. 654 Width Mapping Rule: Map fullwidth and halfwidth characters to their 655 decomposition mappings. 657 Additional Mapping Rule: None. 659 Case Mapping Rule: To be defined by security or application 660 protocols that use this profile. 662 Normalization Rule: NFC. 664 Exclusion Rule: None. 666 Directionality Rule: The "Bidi Rule" defined in RFC 5893 applies. 668 Enforcement: To be defined by security or application protocols that 669 use this profile. 671 Specification: RFC XXXX. [Note to RFC Editor: please change XXXX to 672 the number issued for this specification.] 674 7.2. PasswordFreeformClass 676 Name: PasswordFreeformClass. 678 Applicability: Passwords in security and application protocols. 680 Base Class: FreeformClass 682 Replaces: The SASLprep profile of Stringprep. 684 Width Mapping Rule: None. 686 Additional Mapping Rule: Map non-ASCII space characters to ASCII 687 space. 689 Case Mapping Rule: None. 691 Normalization Rule: NFC. 693 Exclusion Rule: None. 695 Directionality Rule: None. 697 Enforcement: To be defined by security or application protocols that 698 use this profile. 700 Specification: RFC XXXX. [Note to RFC Editor: please change XXXX to 701 the number issued for this specification.] 703 8. Security Considerations 705 8.1. Password/Passphrase Strength 707 The ability to include a wide range of characters in passwords and 708 passphrases can increase the potential for creating a strong password 709 with high entropy. However, in practice, the ability to include such 710 characters ought to be weighed against the possible need to reproduce 711 them on various devices using various input methods. 713 8.2. Identifier Comparison 715 The process of comparing identifiers (such as SASL simple user names, 716 authentication identifiers, and authorization identifiers) can lead 717 to either false negatives or false positives, both of which have 718 security implications. A more detailed discussion can be found in 719 [RFC6943]. 721 8.3. Reuse of PRECIS 723 The security considerations described in [I-D.ietf-precis-framework] 724 apply to the "IdentifierClass" and "FreeformClass" base string 725 classes used in this document for usernames and passwords, 726 respectively. 728 8.4. Reuse of Unicode 730 The security considerations described in [UTS39] apply to the use of 731 Unicode characters in usernames and passwords. 733 9. References 735 9.1. Normative References 737 [I-D.ietf-precis-framework] 738 Saint-Andre, P. and M. Blanchet, "Precis Framework: 739 Handling Internationalized Strings in Protocols", draft- 740 ietf-precis-framework-18 (work in progress), September 741 2014. 743 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 744 Requirement Levels", BCP 14, RFC 2119, March 1997. 746 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 747 10646", STD 63, RFC 3629, November 2003. 749 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 750 Specifications: ABNF", STD 68, RFC 5234, January 2008. 752 [UNICODE] The Unicode Consortium, "The Unicode Standard, Version 753 6.3", 2013, 754 . 756 9.2. Informative References 758 [RFC20] Cerf, V., "ASCII format for network interchange", RFC 20, 759 October 1969. 761 [RFC2617] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S., 762 Leach, P., Luotonen, A., and L. Stewart, "HTTP 763 Authentication: Basic and Digest Access Authentication", 764 RFC 2617, June 1999. 766 [RFC3454] Hoffman, P. and M. Blanchet, "Preparation of 767 Internationalized Strings ("stringprep")", RFC 3454, 768 December 2002. 770 [RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 771 4rev1", RFC 3501, March 2003. 773 [RFC4013] Zeilenga, K., "SASLprep: Stringprep Profile for User Names 774 and Passwords", RFC 4013, February 2005. 776 [RFC4422] Melnikov, A., Ed. and K. Zeilenga, Ed., "Simple 777 Authentication and Security Layer (SASL)", RFC 4422, June 778 2006. 780 [RFC4616] Zeilenga, K., "The PLAIN Simple Authentication and 781 Security Layer (SASL) Mechanism", RFC 4616, August 2006. 783 [RFC5802] Newman, C., Menon-Sen, A., Melnikov, A., and N. Williams, 784 "Salted Challenge Response Authentication Mechanism 785 (SCRAM) SASL and GSS-API Mechanisms", RFC 5802, July 2010. 787 [RFC5890] Klensin, J., "Internationalized Domain Names for 788 Applications (IDNA): Definitions and Document Framework", 789 RFC 5890, August 2010. 791 [RFC5891] Klensin, J., "Internationalized Domain Names in 792 Applications (IDNA): Protocol", RFC 5891, August 2010. 794 [RFC5893] Alvestrand, H. and C. Karp, "Right-to-Left Scripts for 795 Internationalized Domain Names for Applications (IDNA)", 796 RFC 5893, August 2010. 798 [RFC5894] Klensin, J., "Internationalized Domain Names for 799 Applications (IDNA): Background, Explanation, and 800 Rationale", RFC 5894, August 2010. 802 [RFC6120] Saint-Andre, P., "Extensible Messaging and Presence 803 Protocol (XMPP): Core", RFC 6120, March 2011. 805 [RFC6365] Hoffman, P. and J. Klensin, "Terminology Used in 806 Internationalization in the IETF", BCP 166, RFC 6365, 807 September 2011. 809 [RFC6943] Thaler, D., "Issues in Identifier Comparison for Security 810 Purposes", RFC 6943, May 2013. 812 [UTS39] The Unicode Consortium, "Unicode Technical Standard #39: 813 Unicode Security Mechanisms", July 2012, 814 . 816 Appendix A. Differences from RFC 4013 818 This document builds upon the PRECIS framework defined in 819 [I-D.ietf-precis-framework], which differs fundamentally from the 820 stringprep technology [RFC3454] used in SASLprep [RFC4013]. The 821 primary difference is that stringprep profiles allowed all characters 822 except those which were explicitly disallowed, whereas PRECIS 823 profiles disallow all characters except those which are explicitly 824 allowed (this "inclusion model" was originally used for 825 internationalized domain names in [RFC5891]; see [RFC5894] for 826 further discussion). It is important to keep this distinction in 827 mind when comparing the technology defined in this document to 828 SASLprep [RFC4013]. 830 The following substantive modifications were made from RFC 4013. 832 o A single SASLprep algorithm was replaced by two separate 833 algorithms: one for usernames and another for passwords. 835 o The new preparation algorithms use PRECIS instead of a stringprep 836 profile. The new algorithms work independenctly of Unicode 837 versions. 839 o As recommended in the PRECIS framwork, changed the Unicode 840 normalization form from NFKC to NFC. 842 o Some Unicode code points that were mapped to nothing in RFC 4013 843 are simply disallowed by PRECIS. 845 Appendix B. Acknowledgements 847 The following individuals provided helpful feedback on this document: 848 Marc Blanchet, Alan DeKok, Joe Hildebrand, Jeffrey Hutzelman, Simon 849 Josefsson, Jonathan Lennox, Matt Miller, Chris Newman, Yutaka OIWA, 850 Pete Resnick, Andrew Sullivan, and Nico Williams. Nico in particular 851 deserves special recognition for providing text that was used in 852 Section 4.5. Thanks also to Yoshiro YONEYA and Takahiro NEMOTO for 853 implementation feedback. 855 This document borrows some text from [RFC4013] and [RFC6120]. 857 Authors' Addresses 859 Peter Saint-Andre 860 &yet 862 Email: peter@andyet.com 863 URI: https://andyet.com/ 865 Alexey Melnikov 866 Isode Ltd 867 5 Castle Business Village 868 36 Station Road 869 Hampton, Middlesex TW12 2BX 870 UK 872 Email: Alexey.Melnikov@isode.com