1 INTERNET-DRAFT Editor: Kurt D. Zeilenga
2 Intended Category: Standards Track OpenLDAP Foundation
3 Expires April 2005 25 October 2004
9 The Plain SASL Mechanism
10 <draft-ietf-sasl-plain-05.txt>
18 This document is intended to be, after appropriate review and
19 revision, submitted to the RFC Editor as a Standards Track document.
20 Distribution of this memo is unlimited. Technical discussion of this
21 document will take place on the IETF SASL mailing list
22 <ietf-sasl@imc.org>. Please send editorial comments directly to the
23 document editor <Kurt@OpenLDAP.org>.
26 By submitting this Internet-Draft, I accept the provisions of Section
27 4 of RFC 3667. By submitting this Internet-Draft, I certify that any
28 applicable patent or other IPR claims of which I am aware have been
29 disclosed, or will be disclosed, and any of which I become aware will
30 be disclosed, in accordance with RFC 3668.
33 Internet-Drafts are working documents of the Internet Engineering Task
34 Force (IETF), its areas, and its working groups. Note that other
35 groups may also distribute working documents as Internet-Drafts.
38 Internet-Drafts are draft documents valid for a maximum of six months
39 and may be updated, replaced, or obsoleted by other documents at any
40 time. It is inappropriate to use Internet-Drafts as reference material
41 or to cite them other than as "work in progress."
44 The list of current Internet-Drafts can be accessed at
45 <http://www.ietf.org/ietf/1id-abstracts.txt>. The list of
46 Internet-Draft Shadow Directories can be accessed at
47 <http://www.ietf.org/shadow.html>.
50 Copyright (C) The Internet Society (2004). All Rights Reserved.
53 Please see the Full Copyright section near the end of this document
62 Zeilenga Plain SASL Mechanism [Page 1]
63 INTERNET-DRAFT draft-ietf-sasl-plain-05.txt 25 October 2004
70 This document defines a simple clear-text user/password Simple
71 Authentication and Security Layer (SASL) mechanism called the PLAIN
72 mechanism. The PLAIN mechanism is intended to be used, in combination
73 with data confidentiality services provided by a lower layer, in
74 protocols which lack a simple password authentication command.
81 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
82 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
83 document are to be interpreted as described in [Keywords].
87 1. Background and Intended Usage
90 Clear-text passwords are simple, interoperate with almost all existing
91 operating system authentication databases, and are useful for a smooth
92 transition to a more secure password-based authentication mechanism.
93 The drawback is that they are unacceptable for use over an unencrypted
97 This document defines the PLAIN Simple Authentication and Security
98 Layer ([SASL]) mechanism for use in protocols with no clear-text login
99 command (e.g., [ACAP] or [SMTP-AUTH]).
102 The name associated with this mechanism is "PLAIN".
105 The PLAIN SASL mechanism does not provide a security layer. This
106 mechanism MUST NOT be used without adequate security protection as the
107 mechanism affords no integrity nor confidentiality protection itself.
108 The PLAIN SASL mechanism MUST NOT be advertised unless a strong
109 encryption layer, such as provided by Transport Layer Security
110 ([TLS]), is active or backwards compatibility dictates otherwise.
113 This document updates RFC 2595, replacing Section 6. Changes since
114 RFC 2595 are detailed in Appendix A.
118 2. PLAIN SASL mechanism
121 The mechanism consists of a single message, a string of [UTF-8]
122 encoded [Unicode] characters, from the client to the server. The
123 client sends the authorization identity (identity to act as), followed
124 by a NUL (U+0000) character, followed by the authentication identity
125 (identity whose password will be used), followed by a NUL (U+0000)
130 Zeilenga Plain SASL Mechanism [Page 2]
131 INTERNET-DRAFT draft-ietf-sasl-plain-05.txt 25 October 2004
135 character, followed by the clear-text password. As with other SASL
136 mechanisms, the client leaves the authorization identity empty when it
137 wishes the server to derive an identity from the credentials and use
138 that as the authorization identity.
141 The formal grammar for the client message using Augmented BNF [ABNF]
145 message = [authzid] UTF8NUL authcid UTF8NUL passwd
146 authcid = 1*SAFE ; MUST accept up to 255 octets
147 authzid = 1*SAFE ; MUST accept up to 255 octets
148 passwd = 1*SAFE ; MUST accept up to 255 octets
149 UTF8NUL = %x00 ; UTF-8 encoded NUL character
152 SAFE = UTF1 / UTF2 / UTF3 / UTF4
153 ;; any UTF-8 encoded Unicode character except NUL
156 UTF1 = %x01-7F ;; except NUL
158 UTF3 = %xE0 %xA0-BF UTF0 / %xE1-EC 2(UTF0) /
159 %xED %x80-9F UTF0 / %xEE-EF 2(UTF0)
160 UTF4 = %xF0 %x90-BF 2(UTF0) / %xF1-F3 3(UTF0) /
165 The authorization identity (authzid), authentication identity
166 (authcid), password (passwd), and NUL character deliminators SHALL be
167 transferred as [UTF-8] encoded strings of [Unicode] characters. As
168 the NUL (U+0000) character is used as a deliminator, the NUL (U+0000)
169 character MUST NOT appear in authzid, authcid, or passwd productions.
172 The form of the authzid production is specific to the
173 application-level protocol's SASL profile [SASL]. The authcid and
174 passwd productions are form-free. Use of non-visible characters or
175 characters which a user may be unable to enter on some keyboards is
179 Servers MUST be capable of accepting authzid, authcid, and passwd
180 productions up to and including 255 octets. It is noted that the
181 UTF-8 encoding of a Unicode character may be as long as 4 octets.
184 Upon receipt of the message, the server will verify the presented
185 authentication identity (authcid) and password (passwd) with the
186 system authentication database, and verify the authentication
187 credentials permit the client to act as the (presented or derived)
188 authorization identity. If both steps succeed, the user is
195 Zeilenga Plain SASL Mechanism [Page 3]
196 INTERNET-DRAFT draft-ietf-sasl-plain-05.txt 25 October 2004
200 The presented authentication identity and password strings are not to
201 be compared directly with stored strings. The server SHALL first
202 prepare authentication identity and password strings using the
203 [SASLPrep] profile of the [StringPrep] algorithm. Per Section 7 of
204 [StringPrep], unassigned code points may appear in prepared presented
205 (query) strings but are prohibited in stored strings. If preparation
206 fails or results in an empty string, verification SHALL fail. If the
207 server stores only the hash of expected string, the string MUST be
208 prepared before generation of the hash.
211 When an empty authorization identity is provided, the server SHALL
212 derive the authorization identity from the prepared representation of
213 the provided authentication identity string. This ensures that the
214 derivation of different representations of the authentication identity
215 produce the same authorization identity.
218 The verification function (using hashed password) can be written (in
222 boolean Verify(string authzid, string authcid, string passwd) {
223 string pAuthcid = SASLprep(authcid, true); # prepare authcid
224 string pPasswd = SASLprep(passwd, true); # prepare passwd
225 if (pAuthcid == NULL || pPasswd == NULL) {
226 return false; # preparation failed
228 if (pAuthcid == "" || pPasswd == "") {
229 return false; # empty prepared string
233 storedHash = FetchPasswordHash(pAuthcid);
234 if (storedHash == NULL || storedHash == "") {
235 return false; # error or unknown authcid
239 if (!Compare(storedHash, Hash(pPasswd))) {
240 return false; # incorrect password
244 if (authzid == NULL) {
245 authzid = DeriveAuthzid(pAuthcid);
246 if (authzid == NULL || authzid == "") {
247 return false; # could not derive authzid
252 if (!Authorize(pAuthcid, authzid)) {
253 return false; # not authorized
259 Zeilenga Plain SASL Mechanism [Page 4]
260 INTERNET-DRAFT draft-ietf-sasl-plain-05.txt 25 October 2004
268 The second parameter of the SASLprep function, when true, indicates
269 that the input string is a "query" string [StringPrep] and, hence,
270 unassigned code points are allowed. When the SASLprep function is
271 called to prepared the password prior to computing the stored hash,
272 the second parameter would be false as unassigned code points are not
273 allowed in "stored strings" [StringPrep].
276 The second parameter provided to the Authorize function is not
277 prepared by this code. The application-level SASL profile should be
278 consulted to determine what, if any, preparation is necessary.
281 The server MAY also use the credentials to initialize any new
282 authentication database, such as one suitable for [CRAM-MD5] or
290 This section provides examples of PLAIN authentication exchanges. The
291 examples are intended to help the readers understand the above text.
292 The examples are not definitive.
295 "C:" and "S:" indicate lines sent by the client and server
296 respectively. "<NUL>" represents a single NUL (U+0000) character.
297 The Application Configuration Access Protocol ([ACAP]) is used in the
301 The first example shows how the PLAIN mechanism might be used for user
305 S: * ACAP (SASL "CRAM-MD5") (STARTTLS)
307 S: a001 OK "Begin TLS negotiation now"
308 <TLS negotiation, further commands are under TLS layer>
309 S: * ACAP (SASL "CRAM-MD5" "PLAIN")
310 C: a002 AUTHENTICATE "PLAIN"
313 C: <NUL>tim<NUL>tanstaaftanstaaf
314 S: a002 OK "Authenticated"
317 The second example shows how the PLAIN mechanism might be used to
318 assume the identity of another user. In this example, the server
319 rejects the request. Also, this example makes use of the protocol
320 optional initial response capability to eliminate a round-trip.
325 Zeilenga Plain SASL Mechanism [Page 5]
326 INTERNET-DRAFT draft-ietf-sasl-plain-05.txt 25 October 2004
330 S: * ACAP (SASL "CRAM-MD5") (STARTTLS)
332 S: a001 OK "Begin TLS negotiation now"
333 <TLS negotiation, further commands are under TLS layer>
334 S: * ACAP (SASL "CRAM-MD5" "PLAIN")
335 C: a002 AUTHENTICATE "PLAIN" {20+}
336 C: Ursel<NUL>Kurt<NUL>xipj3plmq
337 S: a002 NO "Not authorized to assume asserted identity"
341 5. Security Considerations
344 The PLAIN mechanism relies on the TLS encryption layer for security.
345 When used without TLS, it is vulnerable to a common network
346 eavesdropping attack. Therefore PLAIN MUST NOT be advertised or used
347 unless a suitable TLS encryption layer is active or backwards
348 compatibility dictates otherwise.
351 When the PLAIN mechanism is used, the server gains the ability to
352 impersonate the user to all services with the same password regardless
353 of any encryption provided by TLS or other network privacy mechanisms.
354 While many other authentication mechanisms have similar weaknesses,
355 stronger SASL mechanisms address this issue. Clients are encouraged
356 to have an operational mode where all mechanisms which are likely to
357 reveal the user's password to the server are disabled.
360 General SASL security considerations apply to this mechanism.
361 "stringprep" and Unicode [StringPrep] security considerations also
362 apply, as do [UTF-8] security considerations.
366 6. IANA Considerations
369 It is requested that the SASL Mechanism registry [IANA-SASL] entry for
370 the PLAIN mechanism be updated to reflect that this document now
371 provides its technical specification.
375 Subject: Updated Registration of SASL mechanism PLAIN
378 SASL mechanism name: PLAIN
379 Security considerations: See RFC XXXX.
380 Published specification (optional, recommended): RFC XXXX
381 Person & email address to contact for further information:
382 Kurt Zeilenga <kurt@openldap.org>
383 IETF SASL WG <ietf-sasl@imc.org>
384 Intended usage: COMMON
385 Author/Change controller: IESG <iesg@ietf.org>
390 Zeilenga Plain SASL Mechanism [Page 6]
391 INTERNET-DRAFT draft-ietf-sasl-plain-05.txt 25 October 2004
395 Note: Updates existing entry for PLAIN
402 This document is a revision of RFC 2595 by Chris Newman. Portions of
403 the grammar defined in Section 2 were borrowed from [UTF-8] by
407 This document is a product of the IETF SASL WG.
411 8. Normative References
414 [ABNF] Crocker, D. and P. Overell, "Augmented BNF for Syntax
415 Specifications: ABNF", RFC 2234, November 1997.
418 [Keywords] Bradner, S., "Key words for use in RFCs to Indicate
419 Requirement Levels", BCP 14, RFC 2119, March 1997
422 [SASL] Melnikov, A. (Editor), "Simple Authentication and
423 Security Layer (SASL)",
424 draft-ietf-sasl-rfc2222bis-xx.txt, a work in progress.
427 [SASLPrep] Zeilenga, K., "SASLprep: Stringprep profile for user
428 names and passwords", draft-ietf-sasl-saslprep-xx.txt, a
432 [StringPrep] Hoffman P. and M. Blanchet, "Preparation of
433 Internationalized Strings ('stringprep')",
434 draft-hoffman-rfc3454bis-xx.txt, a work in progress.
437 [Unicode] The Unicode Consortium, "The Unicode Standard, Version
438 3.2.0" is defined by "The Unicode Standard, Version 3.0"
439 (Reading, MA, Addison-Wesley, 2000. ISBN 0-201-61633-5),
440 as amended by the "Unicode Standard Annex #27: Unicode
441 3.1" (http://www.unicode.org/reports/tr27/) and by the
442 "Unicode Standard Annex #28: Unicode 3.2"
443 (http://www.unicode.org/reports/tr28/).
446 [UTF-8] Yergeau, F., "UTF-8, a transformation format of ISO
447 10646", RFC 3629 (also STD 63), November 2003.
450 [TLS] Dierks, T. and, E. Rescorla, "The TLS Protocol Version
451 1.1", draft-ietf-tls-rfc2246-bis-xx.txt, a work in
459 Zeilenga Plain SASL Mechanism [Page 7]
460 INTERNET-DRAFT draft-ietf-sasl-plain-05.txt 25 October 2004
464 9. Informative References
467 [ACAP] Newman, C. and J. Myers, "ACAP -- Application
468 Configuration Access Protocol", RFC 2244, November 1997.
469 [CRAM-MD5] Nerenberg, L., "The CRAM-MD5 SASL Mechanism",
470 draft-ietf-sasl-crammd5-xx.txt, a work in progress.
473 [DIGEST-MD5] Leach, P., C. Newman, and A. Melnikov, "Using Digest
474 Authentication as a SASL Mechanism",
475 draft-ietf-sasl-rfc2831bis-xx.txt, a work in progress.
478 [IANA-SASL] IANA, "SIMPLE AUTHENTICATION AND SECURITY LAYER (SASL)
480 <http://www.iana.org/assignments/sasl-mechanisms>.
483 [SMTP-AUTH] Myers, J., "SMTP Service Extension for Authentication",
484 RFC 2554, March 1999.
496 Email: Kurt@OpenLDAP.org
500 Appendix A. Changes since RFC 2595
503 This appendix is non-normative.
506 This document replaces Section 6 of RFC 2595.
509 The specification details how the server is to compare client-provided
510 character strings with stored character strings.
513 The ABNF grammar was updated. In particular, the grammar now allows
514 LINE FEED (U+000A) and CARRIAGE RETURN (U+000D) characters in the
515 authzid, authcid, passwd productions. However, whether these control
516 characters may be used depends on the string preparation rules
517 applicable to the production. For passwd and authcid productions,
518 control characters are prohibited. For authzid, one must consult the
519 application-level SASL profile.
522 Pseudo-code was added.
525 The example section was expanded to illustrate more features of the
530 Zeilenga Plain SASL Mechanism [Page 8]
531 INTERNET-DRAFT draft-ietf-sasl-plain-05.txt 25 October 2004
540 Intellectual Property Rights
543 The IETF takes no position regarding the validity or scope of any
544 Intellectual Property Rights or other rights that might be claimed to
545 pertain to the implementation or use of the technology described in
546 this document or the extent to which any license under such rights
547 might or might not be available; nor does it represent that it has
548 made any independent effort to identify any such rights. Information
549 on the procedures with respect to rights in RFC documents can be found
550 in BCP 78 and BCP 79.
553 Copies of IPR disclosures made to the IETF Secretariat and any
554 assurances of licenses to be made available, or the result of an
555 attempt made to obtain a general license or permission for the use of
556 such proprietary rights by implementers or users of this specification
557 can be obtained from the IETF on-line IPR repository at
558 http://www.ietf.org/ipr.
561 The IETF invites any interested party to bring to its attention any
562 copyrights, patents or patent applications, or other proprietary
563 rights that may cover technology that may be required to implement
564 this standard. Please address the information to the IETF at
573 Copyright (C) The Internet Society (2004). This document is subject
574 to the rights, licenses and restrictions contained in BCP 78, and
575 except as set forth therein, the authors retain all their rights.
578 This document and the information contained herein are provided on an
579 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
580 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
581 ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
582 INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
583 INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
584 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
593 Zeilenga Plain SASL Mechanism [Page 9]