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