idnits 2.17.1 draft-ietf-precis-saslprepbis-12.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 2, 2014) is 3432 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-20 -- Possible downref: Non-RFC (?) normative reference: ref. 'UNICODE' == Outdated reference: A later version (-07) exists of draft-ietf-httpauth-basicauth-update-03 == Outdated reference: A later version (-19) exists of draft-ietf-httpauth-digest-08 == Outdated reference: A later version (-15) exists of draft-ietf-radext-nai-11 -- 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: June 5, 2015 December 2, 2014 8 Preparation, Enforcement, and Comparison of Internationalized Strings 9 Representing Usernames and Passwords 10 draft-ietf-precis-saslprepbis-12 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 5, 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 . . . . . . . . . . . . . . . . . . . . . . . . . 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. Migration . . . . . . . . . . . . . . . . . . . . . . . . . . 13 75 5.1. Usernames . . . . . . . . . . . . . . . . . . . . . . . . 14 76 5.2. Passwords . . . . . . . . . . . . . . . . . . . . . . . . 15 77 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 16 78 6.1. UsernameCaseMapped Profile . . . . . . . . . . . . . . . 16 79 6.2. UsernameCasePreserved Profile . . . . . . . . . . . . . . 16 80 6.3. OpaqueString Profile . . . . . . . . . . . . . . . . . . 17 81 7. Security Considerations . . . . . . . . . . . . . . . . . . . 18 82 7.1. Password/Passphrase Strength . . . . . . . . . . . . . . 18 83 7.2. Identifier Comparison . . . . . . . . . . . . . . . . . . 18 84 7.3. Reuse of PRECIS . . . . . . . . . . . . . . . . . . . . . 18 85 7.4. Reuse of Unicode . . . . . . . . . . . . . . . . . . . . 18 86 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 18 87 8.1. Normative References . . . . . . . . . . . . . . . . . . 18 88 8.2. Informative References . . . . . . . . . . . . . . . . . 19 89 Appendix A. Differences from RFC 4013 . . . . . . . . . . . . . 20 90 Appendix B. Acknowledgements . . . . . . . . . . . . . . . . . . 21 91 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 21 93 1. Introduction 95 Usernames and passwords are widely used for authentication and 96 authorization on the Internet, either directly when provided in 97 plaintext (as in the SASL PLAIN mechanism [RFC4616] or the HTTP Basic 98 scheme [RFC2617] / [I-D.ietf-httpauth-basicauth-update]) or 99 indirectly when provided as the input to a cryptographic algorithm 100 such as a hash function (as in the SASL SCRAM mechanism [RFC5802] or 101 the HTTP Digest scheme [RFC2617] / [I-D.ietf-httpauth-digest]). 103 To increase the likelihood that the input and comparison of usernames 104 and passwords will work in ways that make sense for typical users 105 throughout the world, this document defines rules for preparing, 106 enforcing, and comparing internationalized strings that represent 107 usernames and passwords. Such strings consist of characters from the 108 Unicode character set [UNICODE], with special attention to characters 109 outside the ASCII range [RFC20]. The rules for handling such strings 110 are specified through profiles of the string classes defined in the 111 PRECIS framework specification [I-D.ietf-precis-framework]. 113 Profiles of the PRECIS framework enable software to handle Unicode 114 characters outside the ASCII range in an automated way, so that such 115 characters are treated carefully and consistently in application 116 protocols. In large measure, these profiles are designed to protect 117 application developers from the potentially negative consequences of 118 supporting the full range of Unicode characters. For instance, in 119 almost all application protocols it would be dangerous to treat the 120 Unicode character SUPERSCRIPT ONE (U+0089) as equivalent to DIGIT ONE 121 (U+0031), since that would result in false positives during 122 comparison, authentication, and authorization (e.g., an attacker 123 could easy spoof an account "user1@example.com"). 125 Whereas a naive use of Unicode would make such attacks trivially 126 easy, the PRECIS profile defined here for usernames generally 127 protects applications from inadvertently causing such problems. 128 (Similar considerations apply to passwords, although here it is 129 desirable to support a wider range of characters so as to maximize 130 entropy during authentication.) 132 The methods defined here might be applicable wherever usernames or 133 passwords are used. However, the methods are not intended for use in 134 preparing strings that are not usernames (e.g., email addresses and 135 LDAP distinguished names), nor in cases where identifiers or secrets 136 are not strings (e.g., keys and certificates) or require specialized 137 handling. 139 This document obsoletes RFC 4013 (the "SASLprep" profile of 140 stringprep [RFC3454]) but can be used by technologies other than the 141 Simple Authentication and Security Layer (SASL) [RFC4422], such as 142 HTTP authentication [RFC2617] / [I-D.ietf-httpauth-basicauth-update] 143 / [I-D.ietf-httpauth-digest]. 145 2. Terminology 147 Many important terms used in this document are defined in 148 [I-D.ietf-precis-framework], [RFC5890], [RFC6365], and [UNICODE]. 149 The term "non-ASCII space" refers to any Unicode code point having a 150 general category of "Zs", with the exception of U+0020 (here called 151 "ASCII space"). 153 As used here, the term "password" is not literally limited to a word; 154 i.e., a password could be a passphrase consisting of more than one 155 word, perhaps separated by spaces or other such characters. 157 Some SASL mechanisms (e.g., CRAM-MD5, DIGEST-MD5, and SCRAM) specify 158 that the authentication identity used in the context of such 159 mechanisms is a "simple user name" (see Section 2 of [RFC4422] as 160 well as [RFC4013]). Various application technologies also assume 161 that the identity of a user or account takes the form of a username 162 (e.g., authentication for the HyperText Transfer Protocol [RFC2617] / 163 [I-D.ietf-httpauth-basicauth-update] / [I-D.ietf-httpauth-digest]), 164 whether or not they use SASL. Note well that the exact form of a 165 username in any particular SASL mechanism or application technology 166 is a matter for implementation and deployment, and that a username 167 does not necessarily map to any particular application identifier 168 (such as the localpart of an email address). 170 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 171 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 172 "OPTIONAL" in this document are to be interpreted as described in 173 [RFC2119]. 175 3. Usernames 177 3.1. Definition 179 This document specifies that a username is a string of Unicode code 180 points [UNICODE], encoded using UTF-8 [RFC3629], and structured as an 181 ordered sequence of "userparts" (where the complete username can 182 consist of a single userpart or a space-separated sequence of 183 userparts). 185 The syntax for a username is defined as follows using the Augmented 186 Backus-Naur Form (ABNF) [RFC5234]. 188 username = userpart *(1*SP userpart) 189 userpart = 1*(idbyte) 190 ; 191 ; an "idbyte" is a byte used to represent a 192 ; UTF-8 encoded Unicode code point that can be 193 ; contained in a string that conforms to the 194 ; PRECIS "IdentifierClass" 195 ; 197 All code points and blocks not explicitly allowed in the PRECIS 198 IdentifierClass are disallowed; this includes private use characters, 199 surrogate code points, and the other code points and blocks that were 200 defined as "Prohibited Output" in [RFC4013]. In addition, common 201 constructions such as "user@example.com" are allowed as usernames 202 under this specification, as they were under [RFC4013]. 204 Implementation Note: The username construct defined in this 205 document does not necessarily match what all deployed applications 206 might refer to as a "username" or "userid", but instead provides a 207 relatively safe subset of Unicode characters that can be used in 208 existing SASL mechanisms and SASL-using application protocols, and 209 even in most application protocols that do not currently use SASL. 211 A username MUST NOT be zero bytes in length. This rule is to be 212 enforced after any normalization and mapping of code points. 214 In protocols that provide usernames as input to a cryptographic 215 algorithm such as a hash function, the client will need to perform 216 proper preparation of the username before applying the algorithm. 218 This specification defines two profiles for usernames: one that 219 performs case mapping and one that performs case preservation (see 220 further discussion under Section 3.4). 222 3.2. UsernameCaseMapped Profile 224 The definition of the UsernameCaseMapped profile of the 225 IdentifierClass is provided in the following sections, including 226 detailed information about preparation, enforcement, and comparison 227 (on the distinction between these actions, refer to 228 [I-D.ietf-precis-framework]). 230 3.2.1. Preparation 232 An entity that prepares a string according to this profile MUST 233 ensure that the string consists only of Unicode code points that 234 conform to the "IdentifierClass" base string class defined in 236 [I-D.ietf-precis-framework]. In addition, the string MUST be encoded 237 as UTF-8 [RFC3629]. 239 3.2.2. Enforcement 241 An entity that performs enforcement according to this profile MUST 242 prepare a string as described in the previous section and MUST also 243 apply the rules specified below for the UsernameCaseMapped profile 244 (these rules MUST be applied in the order shown). 246 1. Width Mapping Rule: Fullwidth and halfwidth characters MUST be 247 mapped to their decomposition mappings. 249 2. Additional Mapping Rule: There is no additional mapping rule. 251 3. Case Mapping Rule: Uppercase and titlecase characters MUST be 252 mapped to their lowercase equivalents, preferably using Unicode 253 Default Case Folding as defined in Chapter 3 of the Unicode 254 Standard [UNICODE]. 256 4. Normalization Rule: Unicode Normalization Form C (NFC) MUST be 257 applied to all characters. 259 5. Directionality Rule: Applications MUST apply the "Bidi Rule" 260 defined in [RFC5893] to strings that contain right-to-left 261 characters (i.e., each of the six conditions of the Bidi Rule 262 must be satisfied). 264 3.2.3. Comparison 266 An entity that performs comparison of two strings according to this 267 profile MUST prepare each string and enforce the rules specified in 268 the previous two sections. The two strings are to be considered 269 equivalent if they are an exact octet-for-octet match (sometimes 270 called "bit-string identity"). 272 3.3. UsernameCasePreserved Profile 274 The definition of the UsernameCasePreserved profile of the 275 IdentifierClass is provided in the following sections, including 276 detailed information about preparation, enforcement, and comparison 277 (on the distinction between these actions, refer to 278 [I-D.ietf-precis-framework]). 280 3.3.1. Preparation 282 An entity that prepares a string according to this profile MUST 283 ensure that the string consists only of Unicode code points that 284 conform to the "IdentifierClass" base string class defined in 285 [I-D.ietf-precis-framework]. In addition, the string MUST be encoded 286 as UTF-8 [RFC3629]. 288 3.3.2. Enforcement 290 An entity that performs enforcement according to this profile MUST 291 prepare a string as described in the previous section and MUST also 292 apply the rules specified below for the UsernameCasePreserved profile 293 (these rules MUST be applied in the order shown). 295 1. Width Mapping Rule: Fullwidth and halfwidth characters MUST be 296 mapped to their decomposition mappings. 298 2. Additional Mapping Rule: There is no additional mapping rule. 300 3. Case Mapping Rule: Uppercase and titlecase characters MUST NOT be 301 mapped to their lowercase equivalents. 303 4. Normalization Rule: Unicode Normalization Form C (NFC) MUST be 304 applied to all characters. 306 5. Directionality Rule: Applications MUST apply the "Bidi Rule" 307 defined in [RFC5893] to strings that contain right-to-left 308 characters (i.e., each of the six conditions of the Bidi Rule 309 must be satisfied). 311 3.3.3. Comparison 313 An entity that performs comparison of two strings according to this 314 profile MUST prepare each string and enforce the rules specified in 315 the previous two sections. The two strings are to be considered 316 equivalent if they are an exact octet-for-octet match (sometimes 317 called "bit-string identity"). 319 3.4. Case Mapping vs. Case Preservation 321 In order to accomodate the widest range of username constructs in 322 applications, this document defines two username profiles: 323 UsernameCaseMapped and UsernameCasePreserved. 325 Case mapping is a matter for the application protocol, protocol 326 implementation, or end deployment. In general, this document 327 suggests that it is preferable to apply the UsernameCaseMapped 328 profile and therefore perform case mapping, since not doing so can 329 lead to false positives during authentication and authorization (as 330 described in [RFC6943]) and can result in confusion among end users 331 given the prevalence of case mapping in many existing protocols and 332 applications. However, there can be good reasons to apply the 333 UsernameCasePreserved profile and thus not perform case mapping, such 334 as backward compatibility with deployed infrastructure. 336 In particular: 338 o SASL mechanisms that follow the recommendations in this document 339 MUST specify whether and when case mapping is to be applied to 340 authentication identifiers. SASL mechanisms SHOULD delay any case 341 mapping to the last possible moment, such as when doing a lookup 342 by username, username comparisons, or generating a cryptographic 343 salt from a username (if the last possible moment happens on the 344 server, then decisions about case mapping can be a matter of 345 deployment policy). In keeping with [RFC4422], SASL mechanisms 346 are not to apply this or any other profile to authorization 347 identifiers. 349 o Application protocols that use SASL (such as IMAP [RFC3501] and 350 XMPP [RFC6120]) and that directly re-use this profile MUST specify 351 whether case mapping is to be applied to authorization 352 identifiers. Such "SASL application protocols" SHOULD delay any 353 case mapping of authorization identifiers to the last possible 354 moment, which happens to necessarily be on the server side (this 355 enables decisions about case mapping to be a matter of deployment 356 policy). In keeping with [RFC4422], SASL application protocols 357 are not to apply this or any other profile to authentication 358 identifiers. 360 o Application protocols that do not use SASL (such as HTTP 361 authentication with the Basic and Digest schemes [RFC2617] / 362 [I-D.ietf-httpauth-basicauth-update] / [I-D.ietf-httpauth-digest]) 363 MUST specify whether and when case mapping is to be applied to 364 authentication identifiers and authorization identifiers. Such 365 "non-SASL application protocols" SHOULD delay any case mapping to 366 the last possible moment, such as when doing a lookup by username, 367 username comparisons, or generating a cryptographic salt from a 368 username (if the last possible moment happens on the server, then 369 decisions about case mapping can be a matter of deployment 370 policy). 372 If the specification for a SASL mechanism, SASL application protocol, 373 or non-SASL application protocol uses the UsernameCaseMapped profile, 374 it MUST clearly describe whether case mapping is to be applied at the 375 level of the protocol itself, implementations thereof, or service 376 deployments (all of these approaches can be legitimate depending on 377 the application in question). 379 3.5. Application-Layer Constructs 381 Both the UsernameCaseMapped and UsernameCasePreserved profiles allow 382 an application protocol, implementation, or deployment to create 383 application-layer constructs such as "user@domain" or "Firstname 384 Middlename Lastname". One example of the former is the Network 385 Access Identifier specified in [I-D.ietf-radext-nai]. (Such 386 constructs are possible because the PRECIS IdentifierClass allows any 387 ASCII7 character, because spaces can be used to separate userpart 388 instances, and because domain names as specified in [RFC5890] and 389 [RFC5892] are a subset of the PRECIS IdentifierClass.) 391 3.6. Examples 393 The following examples illustrate a small number of userparts (not 394 usernames) that are consistent with the format defined above (note 395 that the characters < and > are used here to delineate the actual 396 userparts and are not part of the userpart strings). 398 Table 1: A sample of legal userparts 400 +--------------------------+---------------------------------+ 401 | # | Userpart | Notes | 402 +--------------------------+---------------------------------+ 403 | 1 | | The at-sign is allowed in the | 404 | | | PRECIS IdentifierClass | 405 +--------------------------+---------------------------------+ 406 | 2 | | | 407 +--------------------------+---------------------------------+ 408 | 3 | | The third character is LATIN | 409 | | | SMALL LETTER SHARP S (U+00DF) | 410 +--------------------------+---------------------------------+ 411 | 4 | <π> | A userpart of GREEK SMALL | 412 | | | LETTER PI (U+03C0) | 413 +--------------------------+---------------------------------+ 414 | 5 | <Σ> | A userpart of GREEK CAPITAL | 415 | | | LETTER SIGMA (U+03A3) | 416 +--------------------------+---------------------------------+ 417 | 6 | <σ> | A userpart of GREEK SMALL | 418 | | | LETTER SIGMA (U+03C3) | 419 +--------------------------+---------------------------------+ 420 | 7 | <ς> | A userpart of GREEK SMALL | 421 | | | LETTER FINAL SIGMA (U+03C2) | 422 +--------------------------+---------------------------------+ 423 Several points are worth noting. Regarding examples 2 and 3: 424 although in German the character esszett (LATIN SMALL LETTER SHARP S, 425 U+00DF) can mostly be used interchangeably with the two characters 426 "ss", the userparts in these examples are different and (if desired) 427 a server would need to enforce a registration policy that disallows 428 one of them if the other is registered. Regarding examples 5, 6, and 429 7: optional case-mapping of GREEK CAPITAL LETTER SIGMA (U+03A3) to 430 lowercase (i.e., to GREEK SMALL LETTER SIGMA, U+03C3) during 431 comparison would result in matching the userparts in examples 5 and 432 6; however, because the PRECIS mapping rules do not account for the 433 special status of GREEK SMALL LETTER FINAL SIGMA (U+03C2), the 434 userparts in examples 5 and 7 or examples 6 and 7 would not be 435 matched during comparison. 437 The following examples illustrate strings that are not valid 438 userparts (not usernames) because they violate the format defined 439 above. 441 Table 2: A sample of strings that violate the userpart rule 443 +--------------------------+---------------------------------+ 444 | # | Non-Userpart string | Notes | 445 +--------------------------+---------------------------------+ 446 | 8 | | Space (U+0020) is disallowed in | 447 | | | the userpart | 448 +--------------------------+---------------------------------+ 449 | 9 | <> | Zero-length userpart | 450 +--------------------------+---------------------------------+ 451 | 10| | The sixth character is ROMAN | 452 | | | NUMERAL FOUR (U+2163) | 453 +--------------------------+---------------------------------+ 454 | 11| <♚> | A localpart of BLACK CHESS KING | 455 | | | (U+265A) | 456 +--------------------------+---------------------------------+ 458 Here again, several points are worth noting. Regarding example 10, 459 the Unicode character ROMAN NUMERAL FOUR (U+2163) has a compatibility 460 equivalent of the string formed of LATIN CAPITAL LETTER I (U+0049) 461 and LATIN CAPITAL LETTER V (U+0056), but characters with 462 compatibility equivalents are not allowed in the PRECIS 463 IdentiferClass. Regarding example 11: symbol characters such as 464 BLACK CHESS KING (U+265A) are not allowed in the PRECIS 465 IdentifierClass. 467 4. Passwords 469 4.1. Definition 471 This document specifies that a password is a string of Unicode code 472 points [UNICODE], encoded using UTF-8 [RFC3629], and conformant to 473 OpaqueString profile of the PRECIS FreeformClass specified below. 475 The syntax for a password is defined as follows using the Augmented 476 Backus-Naur Form (ABNF) [RFC5234]. 478 password = 1*(freebyte) 479 ; 480 ; a "freebyte" is a byte used to represent a 481 ; UTF-8 encoded Unicode code point that can be 482 ; contained in a string that conforms to the 483 ; PRECIS "FreefromClass" 484 ; 486 All code points and blocks not explicitly allowed in the PRECIS 487 FreeformClass are disallowed; this includes private use characters, 488 surrogate code points, and the other code points and blocks defined 489 as "Prohibited Output" in Section 2.3 of RFC 4013. 491 A password MUST NOT be zero bytes in length. This rule is to be 492 enforced after any normalization and mapping of code points. 494 Note: The prohibition on zero-length passwords is not a 495 recommendation regarding password strength (since a password of 496 only one byte is highly insecure), but is meant to prevent 497 applications from omitting a password entirely. 499 In protocols that provide passwords as input to a cryptographic 500 algorithm such as a hash function, the client will need to perform 501 proper preparation of the password before applying the algorithm, 502 since the password is not available to the server in plaintext form. 504 4.2. OpaqueString Profile 506 The definition of the OpaqueString profile is provided in the 507 following sections, including detailed information about preparation, 508 enforcement, and comparison (on the distinction between these 509 actions, refer to [I-D.ietf-precis-framework]). 511 4.2.1. Preparation 513 An entity that prepares a string according to this profile MUST 514 ensure that the string consists only of Unicode code points that 515 conform to the "FreeformClass" base string class defined in 516 [I-D.ietf-precis-framework]. In addition, the string MUST be encoded 517 as UTF-8 [RFC3629]. 519 4.2.2. Enforcement 521 An entity that performs enforcement according to this profile MUST 522 prepare a string as described in the previous section and MUST also 523 apply the rules specified below (these rules MUST be applied in the 524 order shown). 526 1. Width Mapping Rule: Fullwidth and halfwidth characters MUST NOT 527 be mapped to their decomposition mappings. 529 2. Additional Mapping Rule: Any instances of non-ASCII space MUST be 530 mapped to ASCII space (U+0020); a non-ASCII space is any Unicode 531 code point having a general category of "Zs", naturally with the 532 exception of U+0020. 534 3. Case Mapping Rule: Uppercase and titlecase characters MUST NOT be 535 mapped to their lowercase equivalents. 537 4. Normalization Rule: Unicode Normalization Form C (NFC) MUST be 538 applied to all characters. 540 5. Directionality Rule: There is no directionality rule. The "Bidi 541 Rule" (defined in [RFC5893]) and similar rules are unnecessary 542 and inapplicable to passwords and other opaque strings, since 543 they can reduce the range of characters that are allowed in a 544 string and therefore reduce the amount of entropy that is 545 possible in a password. Furthermore, such rules are intended to 546 minimize the possibility that the same string will be displayed 547 differently on a system set for right-to-left display and a 548 system set for left-to-right display; however, passwords and 549 other opaque strings are typically not displayed at all and are 550 rarely meant to be interoperable across different systems in the 551 way that non-secret strings like domain names and usernames are. 553 4.2.3. Comparison 555 An entity that performs comparison of two strings according to this 556 profile MUST prepare each string and enforce the rules specified in 557 the previous two sections. The two strings are to be considered 558 equivalent if they are an exact octet-for-octet match (sometimes 559 called "bit-string identity"). 561 4.3. Examples 563 The following examples illustrate a small number of passwords that 564 are consistent with the format defined above (note that the 565 characters < and > are used here to delineate the actual passwords 566 and are not part of the password strings). 568 Table 3: A sample of legal passwords 570 +------------------------------------+------------------------------+ 571 | # | Password | Notes | 572 +------------------------------------+------------------------------+ 573 | 12| | ASCII space is allowed | 574 +------------------------------------+------------------------------+ 575 | 13| | Different from example 12 | 576 +------------------------------------+------------------------------+ 577 | 14| <πßå> | Non-ASCII letters are OK | 578 | | | (e.g., GREEK SMALL LETTER | 579 | | | PI, U+03C0) | 580 +------------------------------------+------------------------------+ 581 | 15| | Symbols are OK (e.g., BLACK | 582 | | | DIAMOND SUIT, U+2666) | 583 +------------------------------------+------------------------------+ 585 The following examples illustrate strings that are not valid 586 passwords because they violate the format defined above. 588 Table 4: A sample of strings that violate the password rules 590 +------------------------------------+------------------------------+ 591 | # | Password | Notes | 592 +------------------------------------+------------------------------+ 593 | 16| | Non-ASCII space (here, OGHAM | 594 | | | SPACE MARK, U+1680) is not | 595 | | | allowed | 596 +------------------------------------+------------------------------+ 597 | 17| | Controls are disallowed | 598 +------------------------------------+------------------------------+ 600 5. Migration 602 The rules defined in this specification differ slightly from those 603 defined by the SASLprep specification [RFC4013]. The following 604 sections describe these differences, along with their implications 605 for migration, in more detail. 607 5.1. Usernames 609 Deployments that currently use SASLprep for handling usernames might 610 need to scrub existing data when migrating to use of the rules 611 defined in this specification. In particular: 613 o SASLprep specified the use of Unicode Normalization Form KC 614 (NFKC), whereas the UsernameCaseMapped and UsernameCasePreserved 615 profiles employ Unicode Normalization Form C (NFC). In practice 616 this change is unlikely to cause significant problems, because 617 NFKC provides methods for mapping Unicode code points with 618 compatibility equivalents to those equivalents, whereas the PRECIS 619 IdentifierClass entirely disallows Unicode code points with 620 compatibility equivalents (i.e., during comparison NFKC is more 621 "aggressive" about finding matches than NFC). A few examples 622 might suffice to indicate the nature of the problem: 624 1. U+017F LATIN SMALL LETTER LONG S is compatibility equivalent 625 to U+0073 LATIN SMALL LETTER S 627 2. U+2163 ROMAN NUMERAL FOUR is compatibility equivalent to 628 U+0049 LATIN CAPITAL LETTER I and U+0056 LATIN CAPITAL LETTER 629 V 631 3. U+FB01 LATIN SMALL LIGATURE FI is compatibility equivalent to 632 U+0066 LATIN SMALL LETTER F and U+0069 LATIN SMALL LETTER I 634 Under SASLprep, the use of NFKC also handled the mapping of 635 fullwidth and halfwidth code points to their decomposition 636 mappings. Although it is expected that code points with 637 compatibility equivalents are rare in existing usernames, for 638 migration purposes deployments might want to search their database 639 of usernames for Unicode code points with compatibility 640 equivalents and map those code points to their compatibility 641 equivalents. 643 o SASLprep mapped the "characters commonly mapped to nothing" from 644 Appendix B.1 of [RFC3454]) to nothing, whereas the PRECIS 645 IdentifierClass entirely disallows most of these characters, which 646 correspond to the code points from the "M" category defined under 647 Section 8.13 of [I-D.ietf-precis-framework] (with the exception of 648 U+1806 MONGOLIAN TODO SOFT HYPHEN, which was "commonly mapped to 649 nothing" in Unicode 3.2 but at the time of this writing does not 650 have a derived property of Default_Ignorable_Code_Point in Unicode 651 7.0). For migration purposes, deployments might want to remove 652 code points contained in the PRECIS "M" category from usernames. 654 o SASLprep allowed uppercase and titlecase characters, whereas the 655 UsernameCaseMapped profile maps uppercase and titlecase characters 656 to their lowercase equivalents (by contrast, the 657 UsernameCasePreserved profile matches SASLprep in this regard). 658 For migration purposes, deployments can either use the 659 UsernameCaseMapped profile (thus losing the case information) or 660 use the UsernameCasePreserved profile (thus ignoring case 661 difference when comparing usernames). 663 5.2. Passwords 665 Depending on local service policy, migration from RFC 4013 to this 666 specification might not involve any scrubbing of data (since 667 passwords might not be stored in the clear anyway); however, service 668 providers need to be aware of possible issues that might arise during 669 migration. In particular: 671 o SASLprep specified the use of Unicode Normalization Form KC 672 (NFKC), whereas the OpaqueString profile employs Unicode 673 Normalization Form C (NFC). Because NFKC is more aggressive about 674 finding matches than NFC, in practice this change is unlikely to 675 cause significant problems and indeed has the security benefit of 676 probably resulting in fewer false positives when comparing 677 passwords. A few examples might suffice to indicate the nature of 678 the problem: 680 1. U+017F LATIN SMALL LETTER LONG S is compatibility equivalent 681 to U+0073 LATIN SMALL LETTER S 683 2. U+2163 ROMAN NUMERAL FOUR is compatibility equivalent to 684 U+0049 LATIN CAPITAL LETTER I and U+0056 LATIN CAPITAL LETTER 685 V 687 3. U+FB01 LATIN SMALL LIGATURE FI is compatibility equivalent to 688 U+0066 LATIN SMALL LETTER F and U+0069 LATIN SMALL LETTER I 690 Under SASLprep, the use of NFKC also handled the mapping of 691 fullwidth and halfwidth code points to their decomposition 692 mappings. Although it is expected that code points with 693 compatibility equivalents are rare in existing passwords, some 694 passwords that matched when SASLprep was used might no longer work 695 when the rules in this specification are applied. 697 o SASLprep mapped the "characters commonly mapped to nothing" from 698 Appendix B.1 of [RFC3454]) to nothing, whereas the PRECIS 699 FreeformClass entirely disallows such characters, which correspond 700 to the code points from the "M" category defined under 701 Section 8.13 of [I-D.ietf-precis-framework] (with the exception of 702 U+1806 MONGOLIAN TODO SOFT HYPHEN, which was commonly mapped to 703 nothing in Unicode 3.2 but at the time of this writing is allowed 704 by Unicode 7.0). In practice, this change will probably have no 705 effect on comparison, but user-oriented software might reject such 706 code points instead of ignoring them during password preparation. 708 6. IANA Considerations 710 The IANA shall add the following entries to the PRECIS Profiles 711 Registry. 713 6.1. UsernameCaseMapped Profile 715 Name: UsernameCaseMapped. 717 Base Class: IdentifierClass. 719 Applicability: Usernames in security and application protocols. 721 Replaces: The SASLprep profile of Stringprep. 723 Width Mapping Rule: Map fullwidth and halfwidth characters to their 724 decomposition mappings. 726 Additional Mapping Rule: None. 728 Case Mapping Rule: Map uppercase and titlecase characters to 729 lowercase. 731 Normalization Rule: NFC. 733 Directionality Rule: The "Bidi Rule" defined in RFC 5893 applies. 735 Enforcement: To be defined by security or application protocols that 736 use this profile. 738 Specification: RFC XXXX. [Note to RFC Editor: please change XXXX to 739 the number issued for this specification.] 741 6.2. UsernameCasePreserved Profile 743 Name: UsernameCasePreserved. 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: None. 758 Normalization Rule: NFC. 760 Directionality Rule: The "Bidi Rule" defined in RFC 5893 applies. 762 Enforcement: To be defined by security or application protocols that 763 use this profile. 765 Specification: RFC XXXX. [Note to RFC Editor: please change XXXX to 766 the number issued for this specification.] 768 6.3. OpaqueString Profile 770 Name: OpaqueString. 772 Base Class: FreeformClass. 774 Applicability: Passwords and other opaque strings in security and 775 application protocols. 777 Replaces: The SASLprep profile of Stringprep. 779 Width Mapping Rule: None. 781 Additional Mapping Rule: Map non-ASCII space characters to ASCII 782 space. 784 Case Mapping Rule: None. 786 Normalization Rule: NFC. 788 Directionality Rule: None. 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. Security Considerations 798 7.1. Password/Passphrase Strength 800 The ability to include a wide range of characters in passwords and 801 passphrases can increase the potential for creating a strong password 802 with high entropy. However, in practice, the ability to include such 803 characters ought to be weighed against the possible need to reproduce 804 them on various devices using various input methods. 806 7.2. Identifier Comparison 808 The process of comparing identifiers (such as SASL simple user names, 809 authentication identifiers, and authorization identifiers) can lead 810 to either false negatives or false positives, both of which have 811 security implications. A more detailed discussion can be found in 812 [RFC6943]. 814 7.3. Reuse of PRECIS 816 The security considerations described in [I-D.ietf-precis-framework] 817 apply to the "IdentifierClass" and "FreeformClass" base string 818 classes used in this document for usernames and passwords, 819 respectively. 821 7.4. Reuse of Unicode 823 The security considerations described in [UTS39] apply to the use of 824 Unicode characters in usernames and passwords. 826 8. References 828 8.1. Normative References 830 [I-D.ietf-precis-framework] 831 Saint-Andre, P. and M. Blanchet, "Precis Framework: 832 Handling Internationalized Strings in Protocols", draft- 833 ietf-precis-framework-20 (work in progress), November 834 2014. 836 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 837 Requirement Levels", BCP 14, RFC 2119, March 1997. 839 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 840 10646", STD 63, RFC 3629, November 2003. 842 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 843 Specifications: ABNF", STD 68, RFC 5234, January 2008. 845 [UNICODE] The Unicode Consortium, "The Unicode Standard, Version 846 6.3", 2013, 847 . 849 8.2. Informative References 851 [I-D.ietf-httpauth-basicauth-update] 852 Reschke, J., "The 'Basic' HTTP Authentication Scheme", 853 draft-ietf-httpauth-basicauth-update-03 (work in 854 progress), December 2014. 856 [I-D.ietf-httpauth-digest] 857 Shekh-Yusef, R., Ahrens, D., and S. Bremer, "HTTP Digest 858 Access Authentication", draft-ietf-httpauth-digest-08 859 (work in progress), August 2014. 861 [I-D.ietf-radext-nai] 862 DeKok, A., "The Network Access Identifier", draft-ietf- 863 radext-nai-11 (work in progress), November 2014. 865 [RFC20] Cerf, V., "ASCII format for network interchange", RFC 20, 866 October 1969. 868 [RFC2617] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S., 869 Leach, P., Luotonen, A., and L. Stewart, "HTTP 870 Authentication: Basic and Digest Access Authentication", 871 RFC 2617, June 1999. 873 [RFC3454] Hoffman, P. and M. Blanchet, "Preparation of 874 Internationalized Strings ("stringprep")", RFC 3454, 875 December 2002. 877 [RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 878 4rev1", RFC 3501, March 2003. 880 [RFC4013] Zeilenga, K., "SASLprep: Stringprep Profile for User Names 881 and Passwords", RFC 4013, February 2005. 883 [RFC4422] Melnikov, A., Ed. and K. Zeilenga, Ed., "Simple 884 Authentication and Security Layer (SASL)", RFC 4422, June 885 2006. 887 [RFC4616] Zeilenga, K., "The PLAIN Simple Authentication and 888 Security Layer (SASL) Mechanism", RFC 4616, August 2006. 890 [RFC5802] Newman, C., Menon-Sen, A., Melnikov, A., and N. Williams, 891 "Salted Challenge Response Authentication Mechanism 892 (SCRAM) SASL and GSS-API Mechanisms", RFC 5802, July 2010. 894 [RFC5890] Klensin, J., "Internationalized Domain Names for 895 Applications (IDNA): Definitions and Document Framework", 896 RFC 5890, August 2010. 898 [RFC5891] Klensin, J., "Internationalized Domain Names in 899 Applications (IDNA): Protocol", RFC 5891, August 2010. 901 [RFC5892] Faltstrom, P., "The Unicode Code Points and 902 Internationalized Domain Names for Applications (IDNA)", 903 RFC 5892, August 2010. 905 [RFC5893] Alvestrand, H. and C. Karp, "Right-to-Left Scripts for 906 Internationalized Domain Names for Applications (IDNA)", 907 RFC 5893, August 2010. 909 [RFC5894] Klensin, J., "Internationalized Domain Names for 910 Applications (IDNA): Background, Explanation, and 911 Rationale", RFC 5894, August 2010. 913 [RFC6120] Saint-Andre, P., "Extensible Messaging and Presence 914 Protocol (XMPP): Core", RFC 6120, March 2011. 916 [RFC6365] Hoffman, P. and J. Klensin, "Terminology Used in 917 Internationalization in the IETF", BCP 166, RFC 6365, 918 September 2011. 920 [RFC6943] Thaler, D., "Issues in Identifier Comparison for Security 921 Purposes", RFC 6943, May 2013. 923 [UTS39] The Unicode Consortium, "Unicode Technical Standard #39: 924 Unicode Security Mechanisms", July 2012, 925 . 927 Appendix A. Differences from RFC 4013 929 This document builds upon the PRECIS framework defined in 930 [I-D.ietf-precis-framework], which differs fundamentally from the 931 stringprep technology [RFC3454] used in SASLprep [RFC4013]. The 932 primary difference is that stringprep profiles allowed all characters 933 except those which were explicitly disallowed, whereas PRECIS 934 profiles disallow all characters except those which are explicitly 935 allowed (this "inclusion model" was originally used for 936 internationalized domain names in [RFC5891]; see [RFC5894] for 937 further discussion). It is important to keep this distinction in 938 mind when comparing the technology defined in this document to 939 SASLprep [RFC4013]. 941 The following substantive modifications were made from RFC 4013. 943 o A single SASLprep algorithm was replaced by three separate 944 algorithms: one for usernames with case mapping, one for usernames 945 with case preservation, and one for passwords. 947 o The new preparation algorithms use PRECIS instead of a stringprep 948 profile. The new algorithms work independenctly of Unicode 949 versions. 951 o As recommended in the PRECIS framework, changed the Unicode 952 normalization form from NFKC to NFC. 954 o Some Unicode code points that were mapped to nothing in RFC 4013 955 are simply disallowed by PRECIS. 957 Appendix B. Acknowledgements 959 The following individuals provided helpful feedback on this document: 960 Marc Blanchet, Alan DeKok, Joe Hildebrand, Jeffrey Hutzelman, Simon 961 Josefsson, Jonathan Lennox, James Manger, Matt Miller, Chris Newman, 962 Yutaka OIWA, Pete Resnick, Andrew Sullivan, and Nico Williams. Nico 963 in particular deserves special recognition for providing text that 964 was used in Section 3.4. Thanks also to Yoshiro YONEYA and Takahiro 965 NEMOTO for implementation feedback. 967 This document borrows some text from [RFC4013] and [RFC6120]. 969 Peter Saint-Andre wishes to acknowledge Cisco Systems, Inc., for 970 employing him during his work on earlier versions of this document. 972 Authors' Addresses 974 Peter Saint-Andre 975 &yet 977 Email: peter@andyet.com 978 URI: https://andyet.com/ 980 Alexey Melnikov 981 Isode Ltd 982 5 Castle Business Village 983 36 Station Road 984 Hampton, Middlesex TW12 2BX 985 UK 987 Email: Alexey.Melnikov@isode.com