idnits 2.17.00 (12 Aug 2021) /tmp/idnits16836/draft-ietf-precis-saslprepbis-10.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (November 21, 2014) is 2737 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-httpauth-basicauth-update has been published as RFC 7617 == Outdated reference: draft-ietf-httpauth-digest has been published as RFC 7616 == Outdated reference: draft-ietf-xmpp-6122bis has been published as RFC 7622 -- Obsolete informational reference (is this intentional?): RFC 2617 (Obsoleted by RFC 7235, RFC 7615, RFC 7616, RFC 7617) -- Obsolete informational reference (is this intentional?): RFC 3454 (Obsoleted by RFC 7564) -- Obsolete informational reference (is this intentional?): RFC 3501 (Obsoleted by RFC 9051) -- Obsolete informational reference (is this intentional?): RFC 4013 (Obsoleted by RFC 7613) Summary: 0 errors (**), 0 flaws (~~), 5 warnings (==), 6 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 PRECIS P. Saint-Andre 3 Internet-Draft &yet 4 Obsoletes: 4013 (if approved) A. Melnikov 5 Intended status: Standards Track Isode Ltd 6 Expires: May 25, 2015 November 21, 2014 8 Preparation, Enforcement, and Comparison of Internationalized Strings 9 Representing Usernames and Passwords 10 draft-ietf-precis-saslprepbis-10 12 Abstract 14 This document describes methods for handling Unicode strings 15 representing usernames and passwords. This document obsoletes RFC 16 4013. 18 Status of This Memo 20 This Internet-Draft is submitted in full conformance with the 21 provisions of BCP 78 and BCP 79. 23 Internet-Drafts are working documents of the Internet Engineering 24 Task Force (IETF). Note that other groups may also distribute 25 working documents as Internet-Drafts. The list of current Internet- 26 Drafts is at http://datatracker.ietf.org/drafts/current/. 28 Internet-Drafts are draft documents valid for a maximum of six months 29 and may be updated, replaced, or obsoleted by other documents at any 30 time. It is inappropriate to use Internet-Drafts as reference 31 material or to cite them other than as "work in progress." 33 This Internet-Draft will expire on May 25, 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. UsernameIdentifierClass Profile . . . . . . . . . . . . . 5 57 3.2.1. Preparation . . . . . . . . . . . . . . . . . . . . . 5 58 3.2.2. Enforcement . . . . . . . . . . . . . . . . . . . . . 5 59 3.2.3. Comparison . . . . . . . . . . . . . . . . . . . . . 6 60 3.3. Case Mapping . . . . . . . . . . . . . . . . . . . . . . 6 61 3.4. Application-Layer Constructs . . . . . . . . . . . . . . 7 62 3.5. Examples . . . . . . . . . . . . . . . . . . . . . . . . 7 63 4. Passwords . . . . . . . . . . . . . . . . . . . . . . . . . . 9 64 4.1. Definition . . . . . . . . . . . . . . . . . . . . . . . 9 65 4.2. PasswordFreeformClass Profile . . . . . . . . . . . . . . 10 66 4.2.1. Preparation . . . . . . . . . . . . . . . . . . . . . 10 67 4.2.2. Enforcement . . . . . . . . . . . . . . . . . . . . . 10 68 4.2.3. Comparison . . . . . . . . . . . . . . . . . . . . . 11 69 4.3. Examples . . . . . . . . . . . . . . . . . . . . . . . . 11 70 5. Migration . . . . . . . . . . . . . . . . . . . . . . . . . . 12 71 5.1. Usernames . . . . . . . . . . . . . . . . . . . . . . . . 12 72 5.2. Passwords . . . . . . . . . . . . . . . . . . . . . . . . 13 73 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 14 74 6.1. UsernameIdentifierClass Profile . . . . . . . . . . . . . 14 75 6.2. PasswordFreeformClass Profile . . . . . . . . . . . . . . 15 76 7. Security Considerations . . . . . . . . . . . . . . . . . . . 15 77 7.1. Password/Passphrase Strength . . . . . . . . . . . . . . 15 78 7.2. Identifier Comparison . . . . . . . . . . . . . . . . . . 16 79 7.3. Reuse of PRECIS . . . . . . . . . . . . . . . . . . . . . 16 80 7.4. Reuse of Unicode . . . . . . . . . . . . . . . . . . . . 16 81 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 16 82 8.1. Normative References . . . . . . . . . . . . . . . . . . 16 83 8.2. Informative References . . . . . . . . . . . . . . . . . 16 84 Appendix A. Differences from RFC 4013 . . . . . . . . . . . . . 18 85 Appendix B. Acknowledgements . . . . . . . . . . . . . . . . . . 19 86 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 19 88 1. Introduction 90 Usernames and passwords are widely used for authentication and 91 authorization on the Internet, either directly when provided in 92 plaintext (as in the SASL PLAIN mechanism [RFC4616] or the HTTP Basic 93 scheme [RFC2617] / [I-D.ietf-httpauth-basicauth-update]) or 94 indirectly when provided as the input to a cryptographic algorithm 95 such as a hash function (as in the SASL SCRAM mechanism [RFC5802] or 96 the HTTP Digest scheme [RFC2617] / [I-D.ietf-httpauth-digest]). 98 To increase the likelihood that the input and comparison of usernames 99 and passwords will work in ways that make sense for typical users 100 throughout the world, this document defines rules for preparing, 101 enforcing, and comparing internationalized strings that represent 102 usernames and passwords. Such strings consist of characters from the 103 Unicode character set [UNICODE], with special attention to characters 104 outside the ASCII range [RFC20]. The rules for handling such strings 105 are specified through profiles of the string classes defined in the 106 PRECIS framework specification [I-D.ietf-precis-framework]. 108 Profiles of the PRECIS framework enable software to handle Unicode 109 characters outside the ASCII range in an automated way, so that such 110 characters are treated carefully and consistently in application 111 protocols. In large measure, these profiles are designed to protect 112 application developers from the potentially negative consequences of 113 supporting the full range of Unicode characters. For instance, in 114 almost all application protocols it would be dangerous to treat the 115 Unicode character SUPERSCRIPT ONE (U+0089) as equivalent to DIGIT ONE 116 (U+0031), since that would result in false positives during 117 comparison, authentication, and authorization (e.g., an attacker 118 could easy spoof an account "user1@example.com"). 120 Whereas a naive use of Unicode would make such attacks trivially 121 easy, the PRECIS profile defined here for usernames generally 122 protects applications from inadvertently causing such problems. 123 (Similar considerations apply to passwords, although here it is 124 desirable to support a wider range of characters so as to maximize 125 entropy during authentication.) 127 The methods defined here might be applicable wherever usernames or 128 passwords are used. However, the methods are not intended for use in 129 preparing strings that are not usernames (e.g., email addresses and 130 LDAP distinguished names), nor in cases where identifiers or secrets 131 are not strings (e.g., keys and certificates) or require specialized 132 handling. 134 This document obsoletes RFC 4013 (the "SASLprep" profile of 135 stringprep [RFC3454]) but can be used by technologies other than the 136 Simple Authentication and Security Layer (SASL) [RFC4422], such as 137 HTTP authentication [RFC2617] / [I-D.ietf-httpauth-basicauth-update] 138 / [I-D.ietf-httpauth-digest]. 140 2. Terminology 142 Many important terms used in this document are defined in 143 [I-D.ietf-precis-framework], [RFC5890], [RFC6365], and [UNICODE]. 144 The term "non-ASCII space" refers to any Unicode code point having a 145 general category of "Zs", with the exception of U+0020 (here called 146 "ASCII space"). 148 As used here, the term "password" is not literally limited to a word; 149 i.e., a password could be a passphrase consisting of more than one 150 word, perhaps separated by spaces or other such characters. 152 Some SASL mechanisms (e.g., CRAM-MD5, DIGEST-MD5, and SCRAM) specify 153 that the authentication identity used in the context of such 154 mechanisms is a "simple user name" (see Section 2 of [RFC4422] as 155 well as [RFC4013]). Various application technologies also assume 156 that the identity of a user or account takes the form of a username 157 (e.g., authentication for the HyperText Transfer Protocol [RFC2617] / 158 [I-D.ietf-httpauth-basicauth-update] / [I-D.ietf-httpauth-digest]), 159 whether or not they use SASL. Note well that the exact form of a 160 username in any particular SASL mechanism or application technology 161 is a matter for implementation and deployment, and that a username 162 does not necessarily map to any particular application identifier 163 (such as the localpart of an email address). 165 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 166 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 167 "OPTIONAL" in this document are to be interpreted as described in 168 [RFC2119]. 170 3. Usernames 172 3.1. Definition 174 This document specifies that a username is a string of Unicode code 175 points [UNICODE], encoded using UTF-8 [RFC3629], and structured as an 176 ordered sequence of "userparts" (where the complete username can 177 consist of a single userpart or a space-separated sequence of 178 userparts). 180 The syntax for a username is defined as follows using the Augmented 181 Backus-Naur Form (ABNF) [RFC5234]. 183 username = userpart *(1*SP userpart) 184 userpart = 1*(idbyte) 185 ; 186 ; an "idbyte" is a byte used to represent a 187 ; UTF-8 encoded Unicode code point that can be 188 ; contained in a string that conforms to the 189 ; PRECIS "IdentifierClass" 190 ; 192 All code points and blocks not explicitly allowed in the PRECIS 193 IdentifierClass are disallowed; this includes private use characters, 194 surrogate code points, and the other code points and blocks that were 195 defined as "Prohibited Output" in [RFC4013]. In addition, common 196 constructions such as "user@example.com" are allowed as usernames 197 under this specification, as they were under [RFC4013]. 199 Implementation Note: The username construct defined in this 200 document does not necessarily match what all deployed applications 201 might refer to as a "username" or "userid", but instead provides a 202 relatively safe subset of Unicode characters that can be used in 203 existing SASL mechanisms and SASL-using application protocols, and 204 even in most application protocols that do not currently use SASL. 206 A username MUST NOT be zero bytes in length. This rule is to be 207 enforced after any normalization and mapping of code points. 209 In protocols that provide usernames as input to a cryptographic 210 algorithm such as a hash function, the client will need to perform 211 proper preparation of the username before applying the algorithm. 213 3.2. UsernameIdentifierClass Profile 215 The definition of the UsernameIdentifierClass profile is provided in 216 the following sections, including detailed information about 217 preparation, enforcement, and comparison (on the distinction between 218 these actions, refer to [I-D.ietf-precis-framework]). 220 3.2.1. Preparation 222 An entity that prepares a string for inclusion in a username slot 223 MUST ensure that the string consists only of Unicode code points that 224 conform to the "IdentifierClass" base string class defined in 225 [I-D.ietf-precis-framework]. In addition, the string MUST be encoded 226 as UTF-8 [RFC3629]. 228 3.2.2. Enforcement 230 An entity that performs enforcement in username slots MUST prepare a 231 string as described in the previous section and MUST also apply the 232 rules specified below for the UsernameIdentifierClass profile (these 233 rules MUST be applied in the order shown). 235 1. Width Mapping Rule: Fullwidth and halfwidth characters MUST be 236 mapped to their decomposition mappings. 238 2. Additional Mapping Rule: There is no additional mapping rule. 240 3. Case Mapping Rule: There is no case mapping rule (although see 241 Section 3.3 below). 243 4. Normalization Rule: Unicode Normalization Form C (NFC) MUST be 244 applied to all characters. 246 5. Directionality Rule: Applications MUST apply the "Bidi Rule" 247 defined in [RFC5893] (i.e., each of the six conditions of the 248 Bidi Rule must be satisfied). 250 3.2.3. Comparison 252 An entity that performs comparison of two strings before or after 253 their inclusion in username slots MUST prepare each string and 254 enforce the rules specified in the previous two sections. The two 255 strings are to be considered equivalent if they are an exact octet- 256 for-octet match (sometimes called "bit-string identity"). 258 3.3. Case Mapping 260 Case mapping is a matter for the application protocol, protocol 261 implementation, or end deployment. In general, this document 262 suggests that it is preferable to perform case mapping, since not 263 doing so can lead to false positives during authentication and 264 authorization (as described in [RFC6943]) and can result in confusion 265 among end users given the prevalence of case mapping in many existing 266 protocols and applications. However, there can be good reasons to 267 not perform case mapping, such as backward compatibility with 268 deployed infrastructure. 270 In particular: 272 o SASL mechanisms that directly re-use this profile MUST specify 273 whether and when case mapping is to be applied to authentication 274 identifiers. SASL mechanisms SHOULD delay any case mapping to the 275 last possible moment, such as when doing a lookup by username, 276 username comparisons, or generating a cryptographic salt from a 277 username (if the last possible moment happens on the server, then 278 decisions about case mapping can be a matter of deployment 279 policy). In keeping with [RFC4422], SASL mechanisms are not to 280 apply this or any other profile to authorization identifiers. 282 o Application protocols that use SASL (such as IMAP [RFC3501] and 283 XMPP [RFC6120]) and that directly re-use this profile MUST specify 284 whether case mapping is to be applied to authorization 285 identifiers. Such "SASL application protocols" SHOULD delay any 286 case mapping of authorization identifiers to the last possible 287 moment, which happens to necessarily be on the server side (this 288 enables decisions about case mapping to be a matter of deployment 289 policy). In keeping with [RFC4422], SASL application protocols 290 are not to apply this or any other profile to authentication 291 identifiers. 293 o Application protocols that do not use SASL (such as HTTP 294 authentication with the Basic and Digest schemes [RFC2617] / 295 [I-D.ietf-httpauth-basicauth-update] / [I-D.ietf-httpauth-digest]) 296 MUST specify whether and when case mapping is to be applied to 297 authentication identifiers and authorization identifiers. Such 298 "non-SASL application protocols" SHOULD delay any case mapping to 299 the last possible moment, such as when doing a lookup by username, 300 username comparisons, or generating a cryptographic salt from a 301 username (if the last possible moment happens on the server, then 302 decisions about case mapping can be a matter of deployment 303 policy). 305 If the specification for a SASL mechanism, SASL application protocol, 306 or non-SASL application protocol specifies the handling of case 307 mapping for strings that conform to the UsernameIdentifierClass, it 308 MUST clearly describe whether case mapping is required, recommended, 309 or optional at the level of the protocol itself, implementations 310 thereof, or service deployments. 312 Informational Note: The LocalpartIdentifierClass profile defined 313 in [I-D.ietf-xmpp-6122bis] is identical to the 314 UsernameIdentifierClass profile defined here, except that the 315 LocalpartIdentifierClass profile specifies case mapping. 317 3.4. Application-Layer Constructs 319 The username rule allows an application protocol, implementation, or 320 deployment to create application-layer constructs such as 321 "user@domain" or "Firstname Middlename Lastname" (e.g., because the 322 PRECIS IdentifierClass allows any ASCII7 character, because spaces 323 can be used to separate userpart instances, and because domain names 324 as specified in [RFC5890] and [RFC5892] are a subset of the PRECIS 325 IdentifierClass). 327 3.5. Examples 329 The following examples illustrate a small number of userparts (not 330 usernames) that are consistent with the format defined above (note 331 that the characters < and > are used here to delineate the actual 332 userparts and are not part of the userpart strings). 334 Table 1: A sample of legal userparts 336 +--------------------------+---------------------------------+ 337 | # | Userpart | Notes | 338 +--------------------------+---------------------------------+ 339 | 1 | | The at-sign is allowed in the | 340 | | | PRECIS IdentifierClass | 341 +--------------------------+---------------------------------+ 342 | 2 | | | 343 +--------------------------+---------------------------------+ 344 | 3 | | The third character is LATIN | 345 | | | SMALL LETTER SHARP S (U+00DF) | 346 +--------------------------+---------------------------------+ 347 | 4 | <π> | A userpart of GREEK SMALL | 348 | | | LETTER PI (U+03C0) | 349 +--------------------------+---------------------------------+ 350 | 5 | <Σ> | A userpart of GREEK CAPITAL | 351 | | | LETTER SIGMA (U+03A3) | 352 +--------------------------+---------------------------------+ 353 | 6 | <σ> | A userpart of GREEK SMALL | 354 | | | LETTER SIGMA (U+03C3) | 355 +--------------------------+---------------------------------+ 356 | 7 | <ς> | A userpart of GREEK SMALL | 357 | | | LETTER FINAL SIGMA (U+03C2) | 358 +--------------------------+---------------------------------+ 360 Several points are worth noting. Regarding examples 2 and 3: 361 although in German the character esszett (LATIN SMALL LETTER SHARP S, 362 U+00DF) can mostly be used interchangeably with the two characters 363 "ss", the userparts in these examples are different and (if desired) 364 a server would need to enforce a registration policy that disallows 365 one of them if the other is registered. Regarding examples 5, 6, and 366 7: optional case-mapping of GREEK CAPITAL LETTER SIGMA (U+03A3) to 367 lowercase (i.e., to GREEK SMALL LETTER SIGMA, U+03C3) during 368 comparison would result in matching the userparts in examples 5 and 369 6; however, because the PRECIS mapping rules do not account for the 370 special status of GREEK SMALL LETTER FINAL SIGMA (U+03C2), the 371 userparts in examples 5 and 7 or examples 6 and 7 would not be 372 matched during comparison. 374 The following examples illustrate strings that are not valid 375 userparts (not usernames) because they violate the format defined 376 above. 378 Table 2: A sample of strings that violate the userpart rule 380 +--------------------------+---------------------------------+ 381 | # | Non-Userpart string | Notes | 382 +--------------------------+---------------------------------+ 383 | 8 | | Space (U+0020) is disallowed in | 384 | | | the userpart | 385 +--------------------------+---------------------------------+ 386 | 9 | <> | Zero-length userpart | 387 +--------------------------+---------------------------------+ 388 | 10| | The sixth character is ROMAN | 389 | | | NUMERAL FOUR (U+2163) | 390 +--------------------------+---------------------------------+ 391 | 11| <♚> | A localpart of BLACK CHESS KING | 392 | | | (U+265A) | 393 +--------------------------+---------------------------------+ 395 Here again, several points are worth noting. Regarding example 10, 396 the Unicode character ROMAN NUMERAL FOUR (U+2163) has a compatibility 397 equivalent of the string formed of LATIN CAPITAL LETTER I (U+0049) 398 and LATIN CAPITAL LETTER V (U+0056), but characters with 399 compatibility equivalents are not allowed in the PRECIS 400 IdentiferClass. Regarding example 11: symbol characters such as 401 BLACK CHESS KING (U+265A) are not allowed in the PRECIS 402 IdentifierClass. 404 4. Passwords 406 4.1. Definition 408 This document specifies that a password is a string of Unicode code 409 points [UNICODE], encoded using UTF-8 [RFC3629], and conformant to 410 the PRECIS FreeformClass. 412 The syntax for a password is defined as follows using the Augmented 413 Backus-Naur Form (ABNF) [RFC5234]. 415 password = 1*(freebyte) 416 ; 417 ; a "freebyte" is a byte used to represent a 418 ; UTF-8 encoded Unicode code point that can be 419 ; contained in a string that conforms to the 420 ; PRECIS "FreefromClass" 421 ; 423 All code points and blocks not explicitly allowed in the PRECIS 424 FreeformClass are disallowed; this includes private use characters, 425 surrogate code points, and the other code points and blocks defined 426 as "Prohibited Output" in Section 2.3 of RFC 4013. 428 A password MUST NOT be zero bytes in length. This rule is to be 429 enforced after any normalization and mapping of code points. 431 Note: The prohibition on zero-length passwords is not a 432 recommendation regarding password strength (since a password of 433 only one byte is highly insecure), but is meant to prevent 434 applications from omitting a password entirely. 436 In protocols that provide passwords as input to a cryptographic 437 algorithm such as a hash function, the client will need to perform 438 proper preparation of the password before applying the algorithm, 439 since the password is not available to the server in plaintext form. 441 4.2. PasswordFreeformClass Profile 443 The definition of the PasswordFreeformClass profile is provided in 444 the following sections, including detailed information about 445 preparation, enforcement, and comparison (on the distinction between 446 these actions, refer to [I-D.ietf-precis-framework]). 448 4.2.1. Preparation 450 An entity that prepares a string for inclusion in a password slot 451 MUST ensure that the string consists only of Unicode code points that 452 conform to the "FreeformClass" base string class defined in 453 [I-D.ietf-precis-framework]. In addition, the string MUST be encoded 454 as UTF-8 [RFC3629]. 456 4.2.2. Enforcement 458 An entity that performs enforcement in password slots MUST prepare a 459 string as described in the previous section and MUST also apply the 460 rules specified below for the PasswordFreeformClass (these rules MUST 461 be applied in the order shown). 463 1. Width Mapping Rule: Fullwidth and halfwidth characters MUST NOT 464 be mapped to their decomposition mappings. 466 2. Additional Mapping Rule: Any instances of non-ASCII space MUST be 467 mapped to ASCII space (U+0020); a non-ASCII space is any Unicode 468 code point having a general category of "Zs", naturally with the 469 exception of U+0020. 471 3. Case Mapping Rule: Uppercase and titlecase characters MUST NOT be 472 mapped to their lowercase equivalents. 474 4. Normalization Rule: Unicode Normalization Form C (NFC) MUST be 475 applied to all characters. 477 5. Directionality Rule: There is no directionality rule. The "Bidi 478 Rule" (defined in [RFC5893]) and similar rules are unnecessary 479 and inapplicable to passwords, since they can reduce the range of 480 characters that are allowed in a string and therefore reduce the 481 amount of entropy that is possible in a password. Furthermore, 482 such rules are intended to minimize the possibility that the same 483 string will be displayed differently on a system set for right- 484 to-left display and a system set for left-to-right display; 485 however, passwords are typically not displayed at all and are 486 rarely meant to be interoperable across different systems in the 487 way that non-secret strings like domain names and usernames are. 489 4.2.3. Comparison 491 An entity that performs comparison of two strings before or after 492 their inclusion in password slots MUST prepare each string and 493 enforce the rules specified in the previous two sections. The two 494 strings are to be considered equivalent if they are an exact octet- 495 for-octet match (sometimes called "bit-string identity"). 497 4.3. Examples 499 The following examples illustrate a small number of passwords that 500 are consistent with the format defined above (note that the 501 characters < and > are used here to delineate the actual passwords 502 and are not part of the password strings). 504 Table 3: A sample of legal passwords 506 +------------------------------------+------------------------------+ 507 | # | Password | Notes | 508 +------------------------------------+------------------------------+ 509 | 12| | ASCII space is allowed | 510 +------------------------------------+------------------------------+ 511 | 13| | Different from example 12 | 512 +------------------------------------+------------------------------+ 513 | 14| <πßå> | Non-ASCII letters are OK | 514 | | | (e.g., GREEK SMALL LETTER | 515 | | | PI, U+03C0) | 516 +------------------------------------+------------------------------+ 517 | 15| | Symbols are OK (e.g., BLACK | 518 | | | DIAMOND SUIT, U+2666) | 519 +------------------------------------+------------------------------+ 520 The following examples illustrate strings that are not valid 521 passwords because they violate the format defined above. 523 Table 4: A sample of strings that violate the password rules 525 +------------------------------------+------------------------------+ 526 | # | Password | Notes | 527 +------------------------------------+------------------------------+ 528 | 16| | Non-ASCII space (here, OGHAM | 529 | | | SPACE MARK, U+1680) is not | 530 | | | allowed | 531 +------------------------------------+------------------------------+ 532 | 17| | Controls are disallowed | 533 +------------------------------------+------------------------------+ 535 5. Migration 537 The rules defined in this specification differ slightly from those 538 defined by the SASLprep specification [RFC4013]. The following 539 sections describe these differences, along with their implications 540 for migration, in more detail. 542 5.1. Usernames 544 Deployments that currently use SASLprep for handling usernames might 545 need to scrub existing data when migrating to use of the rules 546 defined in this specification. In particular: 548 o SASLprep specified the use of Unicode Normalization Form KC 549 (NFKC), whereas the UsernameIdentifierClass profile employs 550 Unicode Normalization Form C (NFC). In practice this change is 551 unlikely to cause significant problems, because NFKC provides 552 methods for mapping Unicode code points with compatibility 553 equivalents to those equivalents, whereas the PRECIS 554 IdentifierClass entirely disallows Unicode code points with 555 compatibility equivalents (i.e., during comparison NFKC is more 556 "aggressive" about finding matches than NFC). A few examples 557 might suffice to indicate the nature of the problem: 559 1. U+017F LATIN SMALL LETTER LONG S is compatibility equivalent 560 to U+0073 LATIN SMALL LETTER S 562 2. U+2163 ROMAN NUMERAL FOUR is compatibility equivalent to 563 U+0049 LATIN CAPITAL LETTER I and U+0056 LATIN CAPITAL LETTER 564 V 566 3. U+FB01 LATIN SMALL LIGATURE FI is compatibility equivalent to 567 U+0066 LATIN SMALL LETTER F and U+0069 LATIN SMALL LETTER I 569 Under SASLprep, the use of NFKC also handled the mapping of 570 fullwidth and halfwidth code points to their decomposition 571 mappings. Although it is expected that code points with 572 compatibility equivalents are rare in existing usernames, for 573 migration purposes deployments might want to search their database 574 of usernames for Unicode code points with compatibility 575 equivalents and map those code points to their compatibility 576 equivalents. 578 o SASLprep mapped the "characters commonly mapped to nothing" from 579 Appendix B.1 of [RFC3454]) to nothing, whereas the PRECIS 580 IdentifierClass entirely disallows most of these characters, which 581 correspond to the code points from the "M" category defined under 582 Section 8.13 of [I-D.ietf-precis-framework] (with the exception of 583 U+1806 MONGOLIAN TODO SOFT HYPHEN, which was "commonly mapped to 584 nothing" in Unicode 3.2 but at the time of this writing does not 585 have a derived property of Default_Ignorable_Code_Point in Unicode 586 7.0). For migration purposes, deployments might want to remove 587 code points contained in the PRECIS "M" category from usernames. 589 o SASLprep allowed uppercase and titlecase characters, whereas the 590 UsernameIdentifierClass profile maps uppercase and titlecase 591 characters to their lowercase equivalents. For migration 592 purposes, deployments can either convert uppercase and titlecase 593 characters to their lowercase equivalents in usernames (thus 594 losing the case information) or preserve uppercase and titlecase 595 characters and ignore the case difference when comparing 596 usernames. 598 5.2. Passwords 600 Depending on local service policy, migration from RFC 4013 to this 601 specification might not involve any scrubbing of data (since 602 passwords might not be stored in the clear anyway); however, service 603 providers need to be aware of possible issues that might arise during 604 migration. In particular: 606 o SASLprep specified the use of Unicode Normalization Form KC 607 (NFKC), whereas the PasswordFreeformClass profile employs Unicode 608 Normalization Form C (NFC). Because NFKC is more aggressive about 609 finding matches than NFC, in practice this change is unlikely to 610 cause significant problems and indeed has the security benefit of 611 probably resulting in fewer false positives when comparing 612 passwords. A few examples might suffice to indicate the nature of 613 the problem: 615 1. U+017F LATIN SMALL LETTER LONG S is compatibility equivalent 616 to U+0073 LATIN SMALL LETTER S 618 2. U+2163 ROMAN NUMERAL FOUR is compatibility equivalent to 619 U+0049 LATIN CAPITAL LETTER I and U+0056 LATIN CAPITAL LETTER 620 V 622 3. U+FB01 LATIN SMALL LIGATURE FI is compatibility equivalent to 623 U+0066 LATIN SMALL LETTER F and U+0069 LATIN SMALL LETTER I 625 Under SASLprep, the use of NFKC also handled the mapping of 626 fullwidth and halfwidth code points to their decomposition 627 mappings. Although it is expected that code points with 628 compatibility equivalents are rare in existing passwords, some 629 passwords that matched when SASLprep was used might no longer work 630 when the rules in this specification are applied. 632 o SASLprep mapped the "characters commonly mapped to nothing" from 633 Appendix B.1 of [RFC3454]) to nothing, whereas the PRECIS 634 FreeformClass entirely disallows such characters, which correspond 635 to the code points from the "M" category defined under 636 Section 8.13 of [I-D.ietf-precis-framework] (with the exception of 637 U+1806 MONGOLIAN TODO SOFT HYPHEN, which was commonly mapped to 638 nothing in Unicode 3.2 but at the time of this writing is allowed 639 by Unicode 7.0). In practice, this change will probably have no 640 effect on comparison, but user-oriented software might reject such 641 code points instead of ignoring them during password preparation. 643 6. IANA Considerations 645 The IANA shall add the following entries to the PRECIS Profiles 646 Registry. 648 6.1. UsernameIdentifierClass Profile 650 Name: UsernameIdentifierClass. 652 Applicability: Usernames in security and application protocols. 654 Base Class: IdentifierClass. 656 Replaces: The SASLprep profile of Stringprep. 658 Width Mapping Rule: Map fullwidth and halfwidth characters to their 659 decomposition mappings. 661 Additional Mapping Rule: None. 663 Case Mapping Rule: To be defined by security or application 664 protocols that use this profile. 666 Normalization Rule: NFC. 668 Directionality Rule: The "Bidi Rule" defined in RFC 5893 applies. 670 Enforcement: To be defined by security or application protocols that 671 use this profile. 673 Specification: RFC XXXX. [Note to RFC Editor: please change XXXX to 674 the number issued for this specification.] 676 6.2. PasswordFreeformClass Profile 678 Name: PasswordFreeformClass. 680 Applicability: Passwords in security and application protocols. 682 Base Class: FreeformClass 684 Replaces: The SASLprep profile of Stringprep. 686 Width Mapping Rule: None. 688 Additional Mapping Rule: Map non-ASCII space characters to ASCII 689 space. 691 Case Mapping Rule: None. 693 Normalization Rule: NFC. 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 7. Security Considerations 705 7.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 7.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 7.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 7.4. Reuse of Unicode 730 The security considerations described in [UTS39] apply to the use of 731 Unicode characters in usernames and passwords. 733 8. References 735 8.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-20 (work in progress), November 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 8.2. Informative References 758 [I-D.ietf-httpauth-basicauth-update] 759 Reschke, J., "The 'Basic' HTTP Authentication Scheme", 760 draft-ietf-httpauth-basicauth-update-02 (work in 761 progress), October 2014. 763 [I-D.ietf-httpauth-digest] 764 Shekh-Yusef, R., Ahrens, D., and S. Bremer, "HTTP Digest 765 Access Authentication", draft-ietf-httpauth-digest-08 766 (work in progress), August 2014. 768 [I-D.ietf-xmpp-6122bis] 769 Saint-Andre, P., "Extensible Messaging and Presence 770 Protocol (XMPP): Address Format", draft-ietf-xmpp- 771 6122bis-16 (work in progress), November 2014. 773 [RFC20] Cerf, V., "ASCII format for network interchange", RFC 20, 774 October 1969. 776 [RFC2617] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S., 777 Leach, P., Luotonen, A., and L. Stewart, "HTTP 778 Authentication: Basic and Digest Access Authentication", 779 RFC 2617, June 1999. 781 [RFC3454] Hoffman, P. and M. Blanchet, "Preparation of 782 Internationalized Strings ("stringprep")", RFC 3454, 783 December 2002. 785 [RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 786 4rev1", RFC 3501, March 2003. 788 [RFC4013] Zeilenga, K., "SASLprep: Stringprep Profile for User Names 789 and Passwords", RFC 4013, February 2005. 791 [RFC4422] Melnikov, A., Ed. and K. Zeilenga, Ed., "Simple 792 Authentication and Security Layer (SASL)", RFC 4422, June 793 2006. 795 [RFC4616] Zeilenga, K., "The PLAIN Simple Authentication and 796 Security Layer (SASL) Mechanism", RFC 4616, August 2006. 798 [RFC5802] Newman, C., Menon-Sen, A., Melnikov, A., and N. Williams, 799 "Salted Challenge Response Authentication Mechanism 800 (SCRAM) SASL and GSS-API Mechanisms", RFC 5802, July 2010. 802 [RFC5890] Klensin, J., "Internationalized Domain Names for 803 Applications (IDNA): Definitions and Document Framework", 804 RFC 5890, August 2010. 806 [RFC5891] Klensin, J., "Internationalized Domain Names in 807 Applications (IDNA): Protocol", RFC 5891, August 2010. 809 [RFC5892] Faltstrom, P., "The Unicode Code Points and 810 Internationalized Domain Names for Applications (IDNA)", 811 RFC 5892, August 2010. 813 [RFC5893] Alvestrand, H. and C. Karp, "Right-to-Left Scripts for 814 Internationalized Domain Names for Applications (IDNA)", 815 RFC 5893, August 2010. 817 [RFC5894] Klensin, J., "Internationalized Domain Names for 818 Applications (IDNA): Background, Explanation, and 819 Rationale", RFC 5894, August 2010. 821 [RFC6120] Saint-Andre, P., "Extensible Messaging and Presence 822 Protocol (XMPP): Core", RFC 6120, March 2011. 824 [RFC6365] Hoffman, P. and J. Klensin, "Terminology Used in 825 Internationalization in the IETF", BCP 166, RFC 6365, 826 September 2011. 828 [RFC6943] Thaler, D., "Issues in Identifier Comparison for Security 829 Purposes", RFC 6943, May 2013. 831 [UTS39] The Unicode Consortium, "Unicode Technical Standard #39: 832 Unicode Security Mechanisms", July 2012, 833 . 835 Appendix A. Differences from RFC 4013 837 This document builds upon the PRECIS framework defined in 838 [I-D.ietf-precis-framework], which differs fundamentally from the 839 stringprep technology [RFC3454] used in SASLprep [RFC4013]. The 840 primary difference is that stringprep profiles allowed all characters 841 except those which were explicitly disallowed, whereas PRECIS 842 profiles disallow all characters except those which are explicitly 843 allowed (this "inclusion model" was originally used for 844 internationalized domain names in [RFC5891]; see [RFC5894] for 845 further discussion). It is important to keep this distinction in 846 mind when comparing the technology defined in this document to 847 SASLprep [RFC4013]. 849 The following substantive modifications were made from RFC 4013. 851 o A single SASLprep algorithm was replaced by two separate 852 algorithms: one for usernames and another for passwords. 854 o The new preparation algorithms use PRECIS instead of a stringprep 855 profile. The new algorithms work independenctly of Unicode 856 versions. 858 o As recommended in the PRECIS framework, changed the Unicode 859 normalization form from NFKC to NFC. 861 o Some Unicode code points that were mapped to nothing in RFC 4013 862 are simply disallowed by PRECIS. 864 Appendix B. Acknowledgements 866 The following individuals provided helpful feedback on this document: 867 Marc Blanchet, Alan DeKok, Joe Hildebrand, Jeffrey Hutzelman, Simon 868 Josefsson, Jonathan Lennox, James Manger, Matt Miller, Chris Newman, 869 Yutaka OIWA, Pete Resnick, Andrew Sullivan, and Nico Williams. Nico 870 in particular deserves special recognition for providing text that 871 was used in Section 3.3. Thanks also to Yoshiro YONEYA and Takahiro 872 NEMOTO for implementation feedback. 874 This document borrows some text from [RFC4013] and [RFC6120]. 876 Peter Saint-Andre wishes to acknowledge Cisco Systems, Inc., for 877 employing him during his work on earlier versions of this document. 879 Authors' Addresses 881 Peter Saint-Andre 882 &yet 884 Email: peter@andyet.com 885 URI: https://andyet.com/ 887 Alexey Melnikov 888 Isode Ltd 889 5 Castle Business Village 890 36 Station Road 891 Hampton, Middlesex TW12 2BX 892 UK 894 Email: Alexey.Melnikov@isode.com