idnits 2.17.1 draft-ietf-xmpp-6122bis-04.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 : ---------------------------------------------------------------------------- == There are 1 instance of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (September 23, 2012) is 4232 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-05 -- Possible downref: Non-RFC (?) normative reference: ref. 'UNICODE' -- Possible downref: Non-RFC (?) normative reference: ref. 'UTR36' == Outdated reference: A later version (-03) exists of draft-yoneya-precis-mappings-02 == Outdated reference: A later version (-19) exists of draft-ietf-precis-nickname-01 -- Obsolete informational reference (is this intentional?): RFC 3454 (Obsoleted by RFC 7564) -- Obsolete informational reference (is this intentional?): RFC 3490 (Obsoleted by RFC 5890, RFC 5891) -- Obsolete informational reference (is this intentional?): RFC 3920 (Obsoleted by RFC 6120) -- Obsolete informational reference (is this intentional?): RFC 3921 (Obsoleted by RFC 6121) -- Obsolete informational reference (is this intentional?): RFC 6122 (Obsoleted by RFC 7622) Summary: 0 errors (**), 0 flaws (~~), 5 warnings (==), 8 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 XMPP P. Saint-Andre 3 Internet-Draft Cisco Systems, Inc. 4 Obsoletes: 6122 (if approved) September 23, 2012 5 Intended status: Standards Track 6 Expires: March 27, 2013 8 Extensible Messaging and Presence Protocol (XMPP): Address Format 9 draft-ietf-xmpp-6122bis-04 11 Abstract 13 This document defines the address format for the Extensible Messaging 14 and Presence Protocol (XMPP), including support for code points 15 outside the ASCII range. This document obsoletes RFC 6122. 17 Status of this Memo 19 This Internet-Draft is submitted in full conformance with the 20 provisions of BCP 78 and BCP 79. 22 Internet-Drafts are working documents of the Internet Engineering 23 Task Force (IETF). Note that other groups may also distribute 24 working documents as Internet-Drafts. The list of current Internet- 25 Drafts is at http://datatracker.ietf.org/drafts/current/. 27 Internet-Drafts are draft documents valid for a maximum of six months 28 and may be updated, replaced, or obsoleted by other documents at any 29 time. It is inappropriate to use Internet-Drafts as reference 30 material or to cite them other than as "work in progress." 32 This Internet-Draft will expire on March 27, 2013. 34 Copyright Notice 36 Copyright (c) 2012 IETF Trust and the persons identified as the 37 document authors. All rights reserved. 39 This document is subject to BCP 78 and the IETF Trust's Legal 40 Provisions Relating to IETF Documents 41 (http://trustee.ietf.org/license-info) in effect on the date of 42 publication of this document. Please review these documents 43 carefully, as they describe your rights and restrictions with respect 44 to this document. Code Components extracted from this document must 45 include Simplified BSD License text as described in Section 4.e of 46 the Trust Legal Provisions and are provided without warranty as 47 described in the Simplified BSD License. 49 Table of Contents 51 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 52 1.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . 3 53 1.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 54 2. Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . 3 55 2.1. Fundamentals . . . . . . . . . . . . . . . . . . . . . . . 3 56 2.2. Domainpart . . . . . . . . . . . . . . . . . . . . . . . . 5 57 2.3. Localpart . . . . . . . . . . . . . . . . . . . . . . . . 6 58 2.4. Resourcepart . . . . . . . . . . . . . . . . . . . . . . . 7 59 3. Enforcement in JIDs and JID Parts . . . . . . . . . . . . . . 9 60 4. Internationalization Considerations . . . . . . . . . . . . . 11 61 5. Security Considerations . . . . . . . . . . . . . . . . . . . 11 62 5.1. Reuse of PRECIS . . . . . . . . . . . . . . . . . . . . . 11 63 5.2. Reuse of Unicode . . . . . . . . . . . . . . . . . . . . . 11 64 5.3. Address Spoofing . . . . . . . . . . . . . . . . . . . . . 12 65 5.3.1. Address Forging . . . . . . . . . . . . . . . . . . . 12 66 5.3.2. Address Mimicking . . . . . . . . . . . . . . . . . . 12 67 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 14 68 6.1. Subclasses . . . . . . . . . . . . . . . . . . . . . . . . 14 69 6.2. Usage of NameClass . . . . . . . . . . . . . . . . . . . . 14 70 6.3. Usage of FreeClass . . . . . . . . . . . . . . . . . . . . 14 71 7. Conformance Requirements . . . . . . . . . . . . . . . . . . . 15 72 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 16 73 8.1. Normative References . . . . . . . . . . . . . . . . . . . 16 74 8.2. Informative References . . . . . . . . . . . . . . . . . . 17 75 Appendix A. Differences from RFC 6122 . . . . . . . . . . . . . . 20 76 Appendix B. Acknowledgements . . . . . . . . . . . . . . . . . . 21 77 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 21 79 1. Introduction 81 1.1. Overview 83 The Extensible Messaging and Presence Protocol (XMPP) [RFC6120] is an 84 application profile of the Extensible Markup Language [XML] for 85 streaming XML data in close to real time between any two or more 86 network-aware entities. The address format for XMPP entities was 87 originally developed in the Jabber open-source community in 1999, 88 first described by [XEP-0029] in 2002, and then defined canonically 89 by [RFC3920] in 2004 and [RFC6122] in 2011. 91 As specified in RFC 3920 and RFC 6122, the XMPP address format used 92 the "stringprep" technology for preparation of non-ASCII characters 93 [RFC3454]. Following the migration of internationalized domain names 94 away from stringprep, this document defines the XMPP address format 95 in a way that no longer depends on stringprep. Instead, this 96 document builds upon the internationalization framework defined by 97 the IETF's PRECIS Working Group [FRAMEWORK]. 99 This document obsoletes RFC 6122. 101 1.2. Terminology 103 Many important terms used in this document are defined in 104 [FRAMEWORK], [RFC5890], [RFC6120], [RFC6365], and [UNICODE]. 106 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 107 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 108 "OPTIONAL" in this document are to be interpreted as described in 109 [RFC2119]. 111 2. Addresses 113 2.1. Fundamentals 115 An XMPP entity is anything that is network-addressable and that can 116 communicate using XMPP. For historical reasons, the native address 117 of an XMPP entity is called a Jabber Identifier ("JID"). A valid JID 118 is a string of [UNICODE] code points, encoded using UTF-8 [RFC3629], 119 and structured as an ordered sequence of localpart, domainpart, and 120 resourcepart (where the first two parts are demarcated by the '@' 121 character used as a separator, and the last two parts are similarly 122 demarcated by the '/' character). 124 The syntax for a JID is defined as follows using the Augmented 125 Backus-Naur Form (ABNF) as specified in [RFC5234]. 127 jid = [ localpart "@" ] domainpart [ "/" resourcepart ] 128 localpart = 1*(localpoint) 129 ; 130 ; a "localpoint" is a UTF-8 encoded 131 ; Unicode code point that conforms to 132 ; the "LocalpartNameClass" subclass of 133 ; the "NameClass" string class defined 134 ; in draft-ietf-precis-framework 135 ; 136 domainpart = IP-literal / IPv4address / ifqdn 137 ; 138 ; the "IPv4address" and "IP-literal" 139 ; rules are defined in RFC 3986, and 140 ; the first-match-wins (a.k.a. "greedy") 141 ; algorithm described in RFC 3986 142 ; applies to the matching process 143 ; 144 ; note well that reuse of the IP-literal 145 ; rule from RFC 3986 implies that IPv6 146 ; addresses are enclosed in square 147 ; brackets (i.e., beginning with '[' 148 ; and ending with ']') 149 ; 150 ifqdn = 1*(domainpoint) 151 ; 152 ; a "domainpoint" is a UTF-8 encoded 153 ; Unicode code point that conforms to 154 ; RFC 5890 155 ; 156 resourcepart = 1*(resourcepoint) 157 ; 158 ; a "resourcepoint" is a UTF-8 encoded 159 ; Unicode code point that conforms to 160 ; the "ResourcepartFreeClass" subclass of 161 ; of the "FreeClass" string class defined 162 ; in draft-ietf-precis-framework 163 ; 165 All JIDs are based on the foregoing structure. However, note that 166 the foregoing structure does not capture all of the rules and 167 restrictions that apply to JIDs, which are described below. 169 Each allowable portion of a JID (localpart, domainpart, and 170 resourcepart) MUST NOT be zero bytes in length and MUST NOT be more 171 than 1023 bytes in length, resulting in a maximum total size 172 (including the '@' and '/' separators) of 3071 bytes. 174 Implementation Note: When dividing a JID into its component parts, 175 an implementation needs to match the separator characters '@' and 176 '/' before applying any transformation algorithms, which might 177 decompose certain Unicode code points to the separator characters 178 (e.g., under Unicode Normalization Form KC U+FE6B SMALL COMMERCIAL 179 AT decomposes to U+0040 COMMERCIAL AT, although this is not true 180 under Unicode Normalization C, which is used in this 181 specification). 183 This document defines the native format for JIDs; see [RFC5122] for 184 information about the representation of a JID as a Uniform Resource 185 Identifier (URI) [RFC3986] or Internationalized Resource Identifier 186 (IRI) [RFC3987] and the extraction of a JID from an XMPP URI or IRI. 188 2.2. Domainpart 190 The domainpart of a JID is that portion after the '@' character (if 191 any) and before the '/' character (if any); it is the primary 192 identifier and is the only REQUIRED element of a JID (a mere 193 domainpart is a valid JID). Typically a domainpart identifies the 194 "home" server to which clients connect for XML routing and data 195 management functionality. However, it is not necessary for an XMPP 196 domainpart to identify an entity that provides core XMPP server 197 functionality (e.g., a domainpart can identify an entity such as a 198 multi-user chat service [XEP-0045], a publish-subscribe service 199 [XEP-0060], or a user directory). 201 The domainpart for every XMPP service MUST be a fully-qualified 202 domain name (FQDN), an IPv4 address, an IPv6 address, or an 203 unqualified hostname (i.e., a text label that is resolvable on a 204 local network). 206 Informational Note: The term "fully-qualified domain name" is not 207 well defined. In [RFC1034] it also called an absolute domain 208 name, and the two terms are associated in [RFC1535]. The earliest 209 use of the term can be found in [RFC1123]. References to those 210 older specifications ought not to be construed as limiting the 211 characters of a fully-qualified domain name to the ASCII range; 212 for example, [RFC5890] mentions that a fully-qualified domain name 213 can contain one or more U-labels. 215 Interoperability Note: Domainparts that are IP addresses might not 216 be accepted by other services for the sake of server-to-server 217 communication, and domainparts that are unqualified hostnames 218 cannot be used on public networks because they are resolvable only 219 on a local network. 221 If the domainpart includes a final character considered to be a label 222 separator (dot) by [RFC1034], this character MUST be stripped from 223 the domainpart before the JID of which it is a part is used for the 224 purpose of routing an XML stanza, comparing against another JID, or 225 constructing an XMPP URI or IRI [RFC5122]. In particular, the 226 character MUST be stripped before any other canonicalization steps 227 are taken. 229 In general, the content of a domainpart is an Internationalized 230 Domain Name ("IDN") as described in the specifications for 231 Internationalized Domain Names in Applications (commonly called 232 "IDNA2008") [RFC5890], and a domainpart is an "IDNA-aware domain name 233 slot". The following rules apply to a domainpart that consists of a 234 fully-qualified domain name: 236 o The domainpart MUST contain only NR-LDH labels and U-labels as 237 defined in [RFC5890] and MUST consist only of Unicode code points 238 that conform to the rules specified in [RFC5892]. 240 o The domainpart MUST NOT include A-labels as defined in [RFC5890]; 241 each A-label MUST be converted to a U-label during preparation of 242 a domainpart, and comparison MUST be performed using U-labels, not 243 A-labels. 245 o After conversion of A-labels to U-labels if necessary, all 246 uppercase and titlecase code points within the domainpart MUST be 247 mapped to their lowercase equivalents. 249 o After (and in addition to) casemapping, other mappings MAY be 250 applied to the domainpart, such as those defined in 251 [I-D.yoneya-precis-mappings] or [RFC5895]. 253 After any and all normalization, conversion, and mapping of code 254 points, a domainpart MUST NOT be zero bytes in length and MUST NOT be 255 more than 1023 bytes in length. (Naturally, the length limits of 256 [RFC1034] apply, and nothing in this document is to be interpreted as 257 overriding those more fundamental limits.) 259 2.3. Localpart 261 The localpart of a JID is an optional identifier placed before the 262 domainpart and separated from the latter by the '@' character. 263 Typically a localpart uniquely identifies the entity requesting and 264 using network access provided by a server (i.e., a local account), 265 although it can also represent other kinds of entities (e.g., a chat 266 room associated with a multi-user chat service [XEP-0045]). The 267 entity represented by an XMPP localpart is addressed within the 268 context of a specific domain (i.e., ). 270 A localpart MUST NOT be zero bytes in length and MUST NOT be more 271 than 1023 bytes in length. This rule is to be enforced after any 272 normalization and mapping of code points. 274 A localpart MUST consist only of Unicode code points that conform to 275 the "LocalpartNameClass" subclass of the "NameClass" base string 276 class defined in [FRAMEWORK]. The LocalpartNameClass subclass 277 includes all code points allowed by the NameClass base class, with 278 the exception of the following characters that are explicitly 279 disallowed in XMPP localparts: 281 U+0022 (QUOTATION MARK), i.e., " 282 U+0026 (AMPERSAND), i.e., & 283 U+0027 (APOSTROPHE), i.e., ' 284 U+002F (SOLIDUS), i.e., / 285 U+003A (COLON), i.e., : 286 U+003C (LESS-THAN SIGN), i.e., < 287 U+003E (GREATER-THAN SIGN), i.e., > 288 U+0040 (COMMERCIAL AT), i.e., @ 290 The normalization and mapping rules for the LocalpartNameClass are as 291 follows, where the operations specified MUST be completed in the 292 order shown: 294 1. All characters MUST be mapped using Unicode Normalization Form C 295 (NFC). 297 2. Uppercase and titlecase characters MUST be mapped to their 298 lowercase equivalents. 300 3. Fullwidth and halfwidth characters SHOULD be mapped to their 301 decomposition mappings (see [I-D.yoneya-precis-mappings]). 303 4. Additional mappings MAY be applied, such as those defined in 304 [I-D.yoneya-precis-mappings]. 306 With regard to directionality, applications MUST apply the "Bidi 307 Rule" defined in [RFC5893] (i.e., each of the six conditions of the 308 Bidi Rule must be satisfied). 310 2.4. Resourcepart 312 The resourcepart of a JID is an optional identifier placed after the 313 domainpart and separated from the latter by the '/' character. A 314 resourcepart can modify either a address or a 315 mere address. Typically a resourcepart uniquely 316 identifies a specific connection (e.g., a device or location) or 317 object (e.g., an occupant in a multi-user chat room [XEP-0045]) 318 belonging to the entity associated with an XMPP localpart at a domain 319 (i.e., ). 321 A resourcepart MUST NOT be zero bytes in length and MUST NOT be more 322 than 1023 bytes in length. This rule is to be enforced after any 323 normalization and mapping of code points. 325 A resourcepart MUST consist only of Unicode code points that conform 326 to the "FreeClass" base string class defined in [FRAMEWORK]. (Note 327 that there is no XMPP-specific subclass for resourceparts.) 329 The normalization and mapping rules for the resourcepart of a JID are 330 as follows, where the operations specified MUST be completed in the 331 order shown: 333 1. All characters MUST be mapped using Unicode Normalization Form C 334 (NFC). 336 2. Uppercase and titlecase characters MAY be mapped to their 337 lowercase equivalents. 339 3. Fullwidth and halfwidth characters SHOULD be mapped to their 340 decomposition mappings (see [I-D.yoneya-precis-mappings]). 342 4. Additional mappings MAY be applied, such as those defined in 343 [I-D.yoneya-precis-mappings]. 345 With regard to directionality, applications MUST apply the "Bidi 346 Rule" defined in [RFC5893] (i.e., each of the six conditions of the 347 Bidi Rule must be satisfied). 349 XMPP entities SHOULD consider resourceparts to be opaque strings and 350 SHOULD NOT impute meaning to any given resourcepart. In particular: 352 o Use of the '/' character as a separator between the domainpart and 353 the resourcepart does not imply that XMPP addresses are 354 hierarchical in the way that, say, HTTP addresses are 355 hierarchical; thus for example an XMPP address of the form 356 does not identify a resource "bar" 357 that exists below a resource "foo" in a hierarchy of resources 358 associated with the entity "localpart@domainpart". 360 o The '@' character is allowed in the resourcepart and is often used 361 in the "nick" shown in XMPP chatrooms [XEP-0045]. For example, 362 the JID describes an entity who 363 is an occupant of the room with an 364 (asserted) nick of . However, chatroom services do not 365 necessarily check such an asserted nick against the occupant's 366 real JID. 368 In some contexts, it might be appropriate to apply more restrictive 369 rules to the preparation and comparison of XMPP resourceparts. For 370 example, in the context of XMPP Multi-User Chat [XEP-0045], it might 371 be appropriate to apply the rules specified in 372 [I-D.ietf-precis-nickname]. However, the application of such more 373 restrictive rules is out of scope for resourceparts in general and is 374 properly defined in other specifications. 376 3. Enforcement in JIDs and JID Parts 378 Enforcement of the XMPP address format rules is the responsibility of 379 XMPP servers. Although XMPP clients SHOULD prepare complete JIDs and 380 parts of JIDs in accordance with the rules before including them in 381 protocol slots within XML streams (such that JIDs and parts of JIDs 382 are in conformance), XMPP servers MUST enforce the rules wherever 383 possible and reject stanzas and other XML elements that violate the 384 rules (for stanzas, by returning a error to the 385 sender as described in Section 8.3.3.8 of [RFC6120]). 387 Enforcement applies to complete JIDs and to parts of JIDs. To 388 facilitate implementation, this document defines the concepts of "JID 389 slot", "localpart slot", and "resourcepart slot" (similar to the 390 concept of a "domain name slot" for IDNA2008 defined in Section 391 2.3.2.6 of [RFC5890]): 393 JID Slot: An XML element or attribute explicitly designated in XMPP 394 or in XMPP extensions for carrying a complete JID. 396 Localpart Slot: An XML element or attribute explicitly designated in 397 XMPP or in XMPP extensions for carrying the localpart of a JID. 399 Resourcepart Slot: An XML element or attribute explicitly designated 400 in XMPP or in XMPP extensions for carrying the resourcepart of a 401 JID. 403 A server is responsible for enforcing the address format rules when 404 receiving protocol elements from clients where the server is expected 405 to handle such elements directly or to use them for purposes of 406 routing a stanza to another domain or delivering a stanza to a local 407 entity; two examples from [RFC6120] are the 'to' attribute on XML 408 stanzas (which is a JID slot used by XMPP servers for routing of 409 outbound stanzas) and the child of the element 410 (which is a resourcepart slot used by XMPP servers for binding of a 411 resource to an account for routing of stanzas between the server and 412 a particular client). 414 A server is not responsible for enforcing the rules when the protocol 415 elements are intended for communication among other entities, 416 typically within the payload of a stanza that the server is merely 417 routing to another domain or delivering to a local entity, such as a 418 connected client or an add-on service. Two examples are the 419 'initiator' attribute in the Jingle extension [XEP-0166] (which is a 420 JID slot used for client-to-client coordination of multimedia 421 sessions) and the 'nick' attribute in the Multi-User Chat extension 422 [XEP-0045] (which is a resourcepart slot used for administrative 423 purposes in the context of XMPP chatrooms). In such cases, clients 424 SHOULD enforce the rules themselves and not depend on the server to 425 do so, and client implementers need to understand that not enforcing 426 the rules can lead to a degraded user experience or to security 427 vulnerabilities. However, when an add-on service (e.g., a multi-user 428 chat service) handles a stanza directly, it ought to enforce the 429 rules as well, as defined by the relevant specification for that type 430 of service. 432 This document does not provide an exhaustive list of JID slots, 433 localpart slots, or resourcepart slots. However, implementers of 434 core XMPP servers are advised to consider as JID slots at least the 435 following elements and attributes when they are handled directly or 436 used for purposes of routing to another domain or delivering to a 437 local entity: 439 o The 'from' and 'to' stream attributes and the 'from' and 'to' 440 stanza attributes [RFC6120]. 441 o The 'jid' attribute of the roster element for contact list 442 management [RFC6121]. 443 o The 'value' attribute of the element for Privacy Lists 444 [RFC3921] [XEP-0016] when the value of the 'type' attribute is 445 "jid". 446 o The 'jid' attribute of the element for Service Discovery 447 defined in [XEP-0030]. 448 o The element for Data Forms [XEP-0004], when the 'type' 449 attribute is "jid-single" or "jid-multi". 450 o The 'jid' attribute of the element for Bookmark 451 Storage [XEP-0048]. 452 o The of the element for vCard 3.0 [XEP-0054] 453 and the child of the element for vCard 4.0 454 [XEP-0292] when the XML character data identifies an XMPP URI 455 [RFC5122]. 456 o The 'from' attribute of the element for Delayed Delivery 457 [XEP-0203]. 459 o The 'jid' attribute of the element for the Blocking 460 Command [XEP-0191]. 461 o The 'from' and 'to' attributes of the and 462 elements for Server Dialback [RFC3921], [XEP-0220]. 463 o The 'from' and 'to' attributes of the element for Advanced 464 Message Processing [XEP-0079]. 465 o The 'from' and 'to' attributes of the , , and 466 elements for the Jabber Component Protocol [XEP-0114]. 468 Developers of XMPP clients and specialized XMPP add-on services are 469 advised to check the appropriate specifications for JID slots, 470 localpart slots, and resourcepart slots in XMPP protocol extensions 471 such as Service Discovery [XEP-0030], Multi-User Chat [XEP-0045], 472 Publish-Subscribe [XEP-0060], SOCKS5 Bytestreams [XEP-0065], In-Band 473 Registration [XEP-0077], Roster Item Exchange [XEP-0144], and Jingle 474 [XEP-0166]. 476 4. Internationalization Considerations 478 XMPP applications MUST support IDNA2008 for domainparts as described 479 under Section 2.2, the "LocalpartNameClass" subclass for localparts 480 as described under Section 2.3, and the "FreeClass" base string class 481 for resourceparts as described under Section 2.4. This enables XMPP 482 addresses to include a wide variety of characters outside the ASCII 483 range. Rules for enforcement of the XMPP address format are provided 484 in [RFC6120] and specifications for various XMPP extensions. 486 Implementation Note: For backward compatibility, many XMPP 487 applications support IDNA2003 [RFC3490] for domainparts, and the 488 stringprep [RFC3454] profiles Nodeprep and Resourceprep [RFC3920] 489 for localparts and resourceparts. 491 5. Security Considerations 493 5.1. Reuse of PRECIS 495 The security considerations described in [FRAMEWORK] apply to the 496 "NameClass" and "FreeClass" base string classes used in this document 497 for XMPP localparts and resourceparts. The security considerations 498 described in [RFC5890] apply to internationalized domain names, which 499 are used here for XMPP domainparts. 501 5.2. Reuse of Unicode 503 The security considerations described in [UTR39] apply to the use of 504 Unicode characters in XMPP addresses. 506 5.3. Address Spoofing 508 There are two forms of address spoofing: forging and mimicking. 510 5.3.1. Address Forging 512 In the context of XMPP technologies, address forging occurs when an 513 entity is able to generate an XML stanza whose 'from' address does 514 not correspond to the account credentials with which the entity 515 authenticated onto the network (or an authorization identity provided 516 during negotiation of SASL authentication [RFC4422] as described in 517 [RFC6120]). For example, address forging occurs if an entity that 518 authenticated as "juliet@im.example.com" is able to send XML stanzas 519 from "nurse@im.example.com" or "romeo@example.net". 521 Address forging is difficult in XMPP systems, given the requirement 522 for sending servers to stamp 'from' addresses and for receiving 523 servers to verify sending domains via server-to-server authentication 524 (see [RFC6120]). However, address forging is possible if: 526 o A poorly implemented server ignores the requirement for stamping 527 the 'from' address. This would enable any entity that 528 authenticated with the server to send stanzas from any 529 localpart@domainpart as long as the domainpart matches the sending 530 domain of the server. 532 o An actively malicious server generates stanzas on behalf of any 533 registered account at the domain or domains hosted at that server. 535 Therefore, an entity outside the security perimeter of a particular 536 server cannot reliably distinguish between JIDs of the form 537 at that server and thus can authenticate only 538 the domainpart of such JIDs with any level of assurance. This 539 specification does not define methods for discovering or 540 counteracting the kind of poorly implemented or rogue servers just 541 described. However, the end-to-end authentication or signing of XMPP 542 stanzas could help to mitigate this risk, since it would require the 543 rogue server to generate false credentials for signing or encryption 544 of each stanza, in addition to modifying 'from' addresses. 546 5.3.2. Address Mimicking 548 Address mimicking occurs when an entity provides legitimate 549 authentication credentials for and sends XML stanzas from an account 550 whose JID appears to a human user to be the same as another JID. 551 Because many characters are visually similar, it is relatively easy 552 to mimic JIDs in XMPP systems. As one simple example, the localpart 553 "ju1iet" (using the Arabic numeral one as the third character) might 554 appear the same as the localpart "juliet" (using lowercase "L" as the 555 third character). 557 As explained in [RFC5890], [FRAMEWORK], [UTR36], and [UTR39], there 558 is no straightforward solution to the problem of visually similar 559 characters. Furthermore, IDNA and PRECIS technologies do not attempt 560 to define such a solution. As a result, XMPP domainparts, 561 localparts, and resourceparts could contain such characters, leading 562 to security vulnerabilities such as the following: 564 o A domainpart is always employed as one part of an entity's address 565 in XMPP. One common usage is as the address of a server or 566 server-side service, such as a multi-user chat service [XEP-0045]. 567 The security of such services could be compromised based on 568 different interpretations of the internationalized domainpart; for 569 example, a user might authorize a malicious entity at a fake 570 server to view the user's presence information, or a user could 571 join chatrooms at a fake multi-user chat service. 573 o A localpart can be employed as one part of an entity's address in 574 XMPP. One common usage is as the username of an instant messaging 575 user; another is as the name of a multi-user chat room; and many 576 other kinds of entities could use localparts as part of their 577 addresses. The security of such services could be compromised 578 based on different interpretations of the internationalized 579 localpart; for example, a user entering a single internationalized 580 localpart could access another user's account information, or a 581 user could gain access to a hidden or otherwise restricted chat 582 room or service. 584 o A resourcepart can be employed as one part of an entity's address 585 in XMPP. One common usage is as the name for an instant messaging 586 user's connected resource; another is as the nickname of a user in 587 a multi-user chat room; and many other kinds of entities could use 588 resourceparts as part of their addresses. The security of such 589 services could be compromised based on different interpretations 590 of the internationalized resourcepart; for example, two or more 591 confusable resources could be bound at the same time to the same 592 account (resulting in inconsistent authorization decisions in an 593 XMPP application that uses full JIDs), or a user could send a 594 private message to someone other than the intended recipient in a 595 multi-user chat room. 597 XMPP services and clients are strongly encouraged to define and 598 implement consistent policies regarding the registration, storage, 599 and presentation of visually similar characters in XMPP systems. In 600 particular, service providers and software implementers are strongly 601 encouraged to use the policies recommended in [FRAMEWORK]. 603 6. IANA Considerations 605 6.1. Subclasses 607 The IANA shall add the following entry to the PRECIS Subclass 608 Registry: 610 Subclass: LocalpartNameClass. 611 Base Class: NameClass. 612 Exclusions: Eight legacy characters in the ASCII range. 613 Specification: RFC XXXX. [Note to RFC Editor: please change XXXX to 614 the number issued for this specification.] 616 6.2. Usage of NameClass 618 The IANA shall add the following entry to the PRECIS Usage Registry: 620 Applicability: Localparts of XMPP addresses. 621 Base Class: NameClass. 622 Subclass: Yes, LocalpartNameClass. 623 Replaces: The Nodeprep profile of Stringprep. 624 Normalization: NFC. 625 Casemapping: Map uppercase and titlecase characters to lowercase. 626 Additional Mappings: Map fullwidth and halfwidth characters to their 627 decomposition mappings (recommended). 628 Directionality: The "Bidi Rule" defined in RFC 5893 applies. 629 Specification: RFC XXXX. [Note to RFC Editor: please change XXXX to 630 the number issued for this specification.] 632 6.3. Usage of FreeClass 634 The IANA shall add the following entry to the PRECIS Usage Registry: 636 Applicability: Resourceparts of XMPP addresses. 637 Base Class: FreeClass 638 Subclass: No. 639 Replaces: The Resourceprep profile of Stringprep. 640 Normalization: NFC. 641 Casemapping: None. 642 Additional Mappings: Map fullwidth and halfwidth characters to their 643 decomposition mappings (recommended). 644 Directionality: The "Bidi Rule" defined in RFC 5893 applies. 645 Specification: RFC XXXX. [Note to RFC Editor: please change XXXX to 646 the number issued for this specification.] 648 7. Conformance Requirements 650 This section describes a protocol feature set that summarizes the 651 conformance requirements of this specification. This feature set is 652 appropriate for use in software certification, interoperability 653 testing, and implementation reports. For each feature, this section 654 provides the following information: 656 o A human-readable name 657 o An informational description 658 o A reference to the particular section of this document that 659 normatively defines the feature 660 o Whether the feature applies to the Client role, the Server role, 661 or both (where "N/A" signifies that the feature is not applicable 662 to the specified role) 663 o Whether the feature MUST or SHOULD be implemented, where the 664 capitalized terms are to be understood as described in [RFC2119] 666 The feature set specified here provides a basis for interoperability 667 testing and follows the spirit of a proposal made by Larry Masinter 668 within the IETF's NEWTRK Working Group in 2005 [INTEROP]. 670 Feature: address-domain-length 671 Description: Ensure that the domainpart of an XMPP address is at 672 least one byte in length and at most 1023 bytes in length, and 673 that it conforms to the underlying length limits of the DNS. 674 Section: Section 2.2 675 Roles: Server MUST, client SHOULD. 677 Feature: address-domain-prep 678 Description: Ensure that the domainpart of an XMPP address conforms 679 to IDNA2008, that it contains only NR-LDH labels and U-labels (not 680 A-labels), and that all uppercase and titlecase code points are 681 mapped to their lowercase equivalents. 682 Section: Section 2.2 683 Roles: Server MUST, client SHOULD. 685 Feature: address-localpart-length 686 Description: Ensure that the localpart of an XMPP address is at 687 least one byte in length and at most 1023 bytes in length. 688 Section: Section 2.3 689 Roles: Server MUST, client SHOULD. 691 Feature: address-localpart-prep 692 Description: Ensure that the localpart of an XMPP address conforms 693 to the "LocalpartNameClass" subclass, that all code points are 694 normalized using NFC, and that all uppercase and titlecase code 695 points are mapped to their lowercase equivalents. 696 Section: Section 2.3 697 Roles: Server MUST, client SHOULD. 699 Feature: address-resource-length 700 Description: Ensure that the resourcepart of an XMPP address is at 701 least one byte in length and at most 1023 bytes in length. 702 Section: Section 2.4 703 Roles: Server MUST, client SHOULD. 705 Feature: address-resource-prep 706 Description: Ensure that the resourcepart of an XMPP address 707 conforms to the "FreeClass" base string class from the PRECIS 708 framework, with all code points normalized using NFC. 709 Section: Section 2.4 710 Roles: Server MUST, client SHOULD. 712 8. References 714 8.1. Normative References 716 [FRAMEWORK] 717 Saint-Andre, P. and M. Blanchet, "Precis Framework: 718 Handling Internationalized Strings in Protocols", 719 draft-ietf-precis-framework-05 (work in progress), 720 August 2012. 722 [RFC1034] Mockapetris, P., "Domain names - concepts and facilities", 723 STD 13, RFC 1034, November 1987. 725 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 726 Requirement Levels", BCP 14, RFC 2119, March 1997. 728 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 729 10646", STD 63, RFC 3629, November 2003. 731 [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax 732 Specifications: ABNF", STD 68, RFC 5234, January 2008. 734 [RFC5890] Klensin, J., "Internationalized Domain Names for 735 Applications (IDNA): Definitions and Document Framework", 736 RFC 5890, August 2010. 738 [RFC5891] Klensin, J., "Internationalized Domain Names in 739 Applications (IDNA): Protocol", RFC 5891, August 2010. 741 [RFC5892] Faltstrom, P., "The Unicode Code Points and 742 Internationalized Domain Names for Applications (IDNA)", 743 RFC 5892, August 2010. 745 [RFC5893] Alvestrand, H. and C. Karp, "Right-to-Left Scripts for 746 Internationalized Domain Names for Applications (IDNA)", 747 RFC 5893, August 2010. 749 [RFC6120] Saint-Andre, P., "Extensible Messaging and Presence 750 Protocol (XMPP): Core", RFC 6120, March 2011. 752 [UNICODE] The Unicode Consortium, "The Unicode Standard, Version 753 3.2.0", 2000. 755 The Unicode Standard, Version 3.2.0 is defined by The 756 Unicode Standard, Version 3.0 (Reading, MA, Addison- 757 Wesley, 2000. ISBN 0-201-61633-5), as amended by the 758 Unicode Standard Annex #27: Unicode 3.1 759 (http://www.unicode.org/reports/tr27/) and by the Unicode 760 Standard Annex #28: Unicode 3.2 761 (http://www.unicode.org/reports/tr28/). 763 [UTR36] The Unicode Consortium, "Unicode Technical Report #36: 764 Unicode Security Considerations", 2008, 765 . 767 8.2. Informative References 769 [INTEROP] Masinter, L., "Formalizing IETF Interoperability 770 Reporting", Work in Progress, October 2005. 772 [I-D.yoneya-precis-mappings] 773 YONEYA, Y. and T. NEMOTO, "Mapping characters for PRECIS 774 classes", draft-yoneya-precis-mappings-02 (work in 775 progress), July 2012. 777 [I-D.ietf-precis-nickname] 778 Saint-Andre, P., "Preparation and Comparison of 779 Nicknames", draft-ietf-precis-nickname-01 (work in 780 progress), September 2012. 782 [RFC1123] Braden, R., "Requirements for Internet Hosts - Application 783 and Support", STD 3, RFC 1123, October 1989. 785 [RFC1535] Gavron, E., "A Security Problem and Proposed Correction 786 With Widely Deployed DNS Software", RFC 1535, 787 October 1993. 789 [RFC3454] Hoffman, P. and M. Blanchet, "Preparation of 790 Internationalized Strings ("stringprep")", RFC 3454, 791 December 2002. 793 [RFC3490] Faltstrom, P., Hoffman, P., and A. Costello, 794 "Internationalizing Domain Names in Applications (IDNA)", 795 RFC 3490, March 2003. 797 See Section 1 for an explanation of why the normative 798 reference to an obsoleted specification is needed. 800 [RFC3920] Saint-Andre, P., Ed., "Extensible Messaging and Presence 801 Protocol (XMPP): Core", RFC 3920, October 2004. 803 [RFC3921] Saint-Andre, P., Ed., "Extensible Messaging and Presence 804 Protocol (XMPP): Instant Messaging and Presence", 805 RFC 3921, October 2004. 807 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 808 Resource Identifier (URI): Generic Syntax", STD 66, 809 RFC 3986, January 2005. 811 [RFC3987] Duerst, M. and M. Suignard, "Internationalized Resource 812 Identifiers (IRIs)", RFC 3987, January 2005. 814 [RFC4422] Melnikov, A. and K. Zeilenga, "Simple Authentication and 815 Security Layer (SASL)", RFC 4422, June 2006. 817 [RFC5122] Saint-Andre, P., "Internationalized Resource Identifiers 818 (IRIs) and Uniform Resource Identifiers (URIs) for the 819 Extensible Messaging and Presence Protocol (XMPP)", 820 RFC 5122, February 2008. 822 [RFC5894] Klensin, J., "Internationalized Domain Names for 823 Applications (IDNA): Background, Explanation, and 824 Rationale", RFC 5894, August 2010. 826 [RFC5895] Resnick, P. and P. Hoffman, "Mapping Characters for 827 Internationalized Domain Names in Applications (IDNA) 828 2008", RFC 5895, September 2010. 830 [RFC6121] Saint-Andre, P., "Extensible Messaging and Presence 831 Protocol (XMPP): Instant Messaging and Presence", 832 RFC 6121, March 2011. 834 [RFC6122] Saint-Andre, P., "Extensible Messaging and Presence 835 Protocol (XMPP): Address Format", RFC 6122, March 2011. 837 [RFC6365] Hoffman, P. and J. Klensin, "Terminology Used in 838 Internationalization in the IETF", BCP 166, RFC 6365, 839 September 2011. 841 [UTR39] The Unicode Consortium, "Unicode Technical Report #39: 842 Unicode Security Mechanisms", August 2010, 843 . 845 [XEP-0004] 846 Eatmon, R., Hildebrand, J., Miller, J., Muldowney, T., and 847 P. Saint-Andre, "Data Forms", XSF XEP 0004, August 2007. 849 [XEP-0016] 850 Millard, P. and P. Saint-Andre, "Privacy Lists", XSF 851 XEP 0016, February 2007. 853 [XEP-0029] 854 Kaes, C., "Definition of Jabber Identifiers (JIDs)", XSF 855 XEP 0029, October 2003. 857 [XEP-0030] 858 Hildebrand, J., Millard, P., Eatmon, R., and P. Saint- 859 Andre, "Service Discovery", XSF XEP 0030, June 2008. 861 [XEP-0045] 862 Saint-Andre, P., "Multi-User Chat", XSF XEP 0045, 863 February 2012. 865 [XEP-0048] 866 Blackman, R., Millard, P., and P. Saint-Andre, 867 "Bookmarks", XSF XEP 0048, November 2007. 869 [XEP-0054] 870 Saint-Andre, P., "vcard-temp", XSF XEP 0054, July 2008. 872 [XEP-0060] 873 Millard, P., Saint-Andre, P., and R. Meijer, "Publish- 874 Subscribe", XSF XEP 0060, July 2010. 876 [XEP-0065] 877 Smith, D., Miller, M., Saint-Andre, P., and J. Karneges, 878 "SOCKS5 Bytestreams", XSF XEP 0065, April 2011. 880 [XEP-0077] 881 Saint-Andre, P., "In-Band Registration", XSF XEP 0077, 882 January 2012. 884 [XEP-0079] 885 Miller, M. and P. Saint-Andre, "Advanced Message 886 Processing", XSF XEP 0079, November 2005. 888 [XEP-0114] 889 Saint-Andre, P., "Jabber Component Protocol", XSF 890 XEP 0114, March 2005. 892 [XEP-0144] 893 Saint-Andre, P., "Roster Item Exchange", XSF XEP 0144, 894 August 2005. 896 [XEP-0165] 897 Saint-Andre, P., "Best Practices to Discourage JID 898 Mimicking", XSF XEP 0165, December 2007. 900 [XEP-0166] 901 Ludwig, S., Beda, J., Saint-Andre, P., McQueen, R., Egan, 902 S., and J. Hildebrand, "Jingle", XSF XEP 0166, 903 December 2009. 905 [XEP-0191] 906 Saint-Andre, P., "Blocking Command", XSF XEP 0191, 907 July 2012. 909 [XEP-0203] 910 Saint-Andre, P., "Delayed Delivery", XSF XEP 0203, 911 September 2009. 913 [XEP-0220] 914 Miller, J., Saint-Andre, P., and P. Hancke, "Server 915 Dialback", XSF XEP 0220, August 2012. 917 [XEP-0292] 918 Saint-Andre, P. and S. Mizzi, "vCard4 Over XMPP", XSF 919 XEP 0292, October 2011. 921 [XML] Maler, E., Yergeau, F., Sperberg-McQueen, C., Paoli, J., 922 and T. Bray, "Extensible Markup Language (XML) 1.0 (Fifth 923 Edition)", World Wide Web Consortium Recommendation REC- 924 xml-20081126, November 2008, 925 . 927 Appendix A. Differences from RFC 6122 929 Based on consensus derived from working group discussion, 930 implementation and deployment experience, and formal interoperability 931 testing, the following substantive modifications were made from RFC 932 6122. 934 o Changed domainpart preparation to use IDNA2008 (instead of 935 IDNA2003). 936 o Changed localpart preparation to use the LocalpartNameClass 937 subclass of the PRECIS NameClass (instead of the Nodeprep profile 938 of Stringprep). 939 o Changed resourcepart preparation to use the PRECIS FreeClass 940 (instead of the Resourceprep profile of Stringprep). 941 o Specified that internationalized labels within domainparts must be 942 U-labels (instead of should be U-labels). 943 o Specified the use of Unicode normalization form C (instead of KC 944 as specified in the Nodeprep and Resourceprep profiles of 945 Stringprep). 946 o Specified that fullwidth and halfwidth should be mapped to their 947 decomposition mappings (previously handled through the use of 948 NFKC). 949 o Specified that servers must enforce the address formatting rules. 951 Appendix B. Acknowledgements 953 Thanks to Joe Hildebrand and Florian Zeitz for their feedback. 955 Some text in this document was borrowed or adapted from [RFC5890], 956 [RFC5891], [RFC5894], and [XEP-0165]. 958 Author's Address 960 Peter Saint-Andre 961 Cisco Systems, Inc. 962 1899 Wynkoop Street, Suite 600 963 Denver, CO 80202 964 USA 966 Phone: +1-303-308-3282 967 Email: psaintan@cisco.com