7 INTERNET-DRAFT Editor: Kurt D. Zeilenga
8 Intended Category: Standards Track OpenLDAP Foundation
9 Expires December 2006 16 June 2006
14 The PLAIN SASL Mechanism
15 <draft-ietf-sasl-plain-09.txt>
21 This document is intended to be, after appropriate review and
22 revision, submitted to the RFC Editor as a Standards Track document.
23 Distribution of this memo is unlimited. Technical discussion of this
24 document will take place on the IETF SASL mailing list
25 <ietf-sasl@imc.org>. Please send editorial comments directly to the
26 document editor <Kurt@OpenLDAP.org>.
28 By submitting this Internet-Draft, each author represents that any
29 applicable patent or other IPR claims of which he or she is aware have
30 been or will be disclosed, and any of which he or she becomes aware
31 will be disclosed, in accordance with Section 6 of BCP 79.
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.
37 Internet-Drafts are draft documents valid for a maximum of six months
38 and may be updated, replaced, or obsoleted by other documents at any
39 time. It is inappropriate to use Internet-Drafts as reference material
40 or to cite them other than as "work in progress."
42 The list of current Internet-Drafts can be accessed at
43 http://www.ietf.org/1id-abstracts.html.
45 The list of Internet-Draft Shadow Directories can be accessed at
46 http://www.ietf.org/shadow.html.
49 Copyright (C) The Internet Society (2006). All Rights Reserved.
51 Please see the Full Copyright section near the end of this document
58 Zeilenga The SASL PLAIN Mechanism [Page 1]
60 INTERNET-DRAFT draft-ietf-sasl-plain-09.txt 16 June 2006
65 This document defines a simple clear-text user/password Simple
66 Authentication and Security Layer (SASL) mechanism called the PLAIN
67 mechanism. The PLAIN mechanism is intended to be used, in combination
68 with data confidentiality services provided by a lower layer, in
69 protocols which lack a simple password authentication command.
71 1. Background and Intended Usage
73 Clear-text, multiple-use passwords are simple, interoperate with
74 almost all existing operating system authentication databases, and are
75 useful for a smooth transition to a more secure password-based
76 authentication mechanism. The drawback is that they are unacceptable
77 for use over network connection where data confidentiality is not
78 assured (by encryption or other means).
80 This document defines the PLAIN Simple Authentication and Security
81 Layer ([SASL]) mechanism for use in protocols with no clear-text login
82 command (e.g., [ACAP] or [SMTP-AUTH]). This document updates RFC
83 2595, replacing Section 6. Changes since RFC 2595 are detailed in
86 The name associated with this mechanism is "PLAIN".
88 The PLAIN SASL mechanism does not provide a security layer.
90 The PLAIN mechanism should not be used without adequate data security
91 protection as this mechanism affords no integrity nor confidentiality
92 protections itself. The mechanism is intended to be used with data
93 security protections provided by application layer protocol, generally
94 through its use of Transport Layer Security ([TLS]) services.
96 By default, implementations SHOULD advertise and make use of the PLAIN
97 mechanism only when adequate data security services are in place.
98 Specifications for IETF protocols which indicate that this mechanism
99 is an applicable authentication mechanism MUST mandate that
100 implementations support an strong data security service, such as TLS.
102 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
103 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
104 document are to be interpreted as described in [Keywords].
107 2. PLAIN SASL mechanism
109 The mechanism consists of a single message, a string of [UTF-8]
110 encoded [Unicode] characters, from the client to the server. The
114 Zeilenga The SASL PLAIN Mechanism [Page 2]
116 INTERNET-DRAFT draft-ietf-sasl-plain-09.txt 16 June 2006
119 client presents the authorization identity (identity to act as),
120 followed by a NULL (U+0000) character, followed by the authentication
121 identity (identity whose password will be used), followed by a NULL
122 (U+0000) character, followed by the clear-text password. As with
123 other SASL mechanisms, the client does not provide an authorization
124 identity when it wishes the server to derive an identity from the
125 credentials and use that as the authorization identity.
127 The formal grammar for the client message using Augmented BNF [ABNF]
130 message = [authzid] UTF8NULL authcid UTF8NULL passwd
131 authcid = 1*SAFE ; MUST accept up to 255 octets
132 authzid = 1*SAFE ; MUST accept up to 255 octets
133 passwd = 1*SAFE ; MUST accept up to 255 octets
134 UTF8NULL = %x00 ; UTF-8 encoded NULL character
136 SAFE = UTF1 / UTF2 / UTF3 / UTF4
137 ;; any UTF-8 encoded Unicode character except NULL
139 UTF1 = %x01-7F ;; except NULL
141 UTF3 = %xE0 %xA0-BF UTF0 / %xE1-EC 2(UTF0) /
142 %xED %x80-9F UTF0 / %xEE-EF 2(UTF0)
143 UTF4 = %xF0 %x90-BF 2(UTF0) / %xF1-F3 3(UTF0) /
147 The authorization identity (authzid), authentication identity
148 (authcid), password (passwd), and NULL character deliminators SHALL be
149 transferred as [UTF-8] encoded strings of [Unicode] characters. As
150 the NULL (U+0000) character is used as a deliminator, the NULL
151 (U+0000) character MUST NOT appear in authzid, authcid, or passwd
154 The form of the authzid production is specific to the
155 application-level protocol's SASL profile [SASL]. The authcid and
156 passwd productions are form-free. Use of non-visible characters or
157 characters which a user may be unable to enter on some keyboards is
160 Servers MUST be capable of accepting authzid, authcid, and passwd
161 productions up to and including 255 octets. It is noted that the
162 UTF-8 encoding of a Unicode character may be as long as 4 octets.
164 Upon receipt of the message, the server will verify the presented (in
165 the message) authentication identity (authcid) and password (passwd)
166 with the system authentication database, and verify the authentication
170 Zeilenga The SASL PLAIN Mechanism [Page 3]
172 INTERNET-DRAFT draft-ietf-sasl-plain-09.txt 16 June 2006
175 credentials permit the client to act as the (presented or derived)
176 authorization identity. If both steps succeed, the user is
179 The presented authentication identity and password strings, as well as
180 the database authentication identity and password strings, are to be
181 prepared before being used in the verification process. The
182 [SASLPrep] profile of the [StringPrep] algorithm is the RECOMMENDED
183 preparation algorithm. The SASLprep preparation algorithm is
184 recommended to improve the likelihood that comparisons behave in an
185 expected manner. The SASLprep preparation algorithm is not so as to
186 allow the server to employ other preparation algorithms (including
187 none) when appropriate. For instance, use of different preparation
188 algorithm may be necessary for the server to interoperate with an
191 When preparing the presented strings using [SASLPrep], the presented
192 strings are to be treated as "query" strings [Section 7, Stringprep]
193 and hence unassigned code points are allowed appear in their prepared
194 output. When preparing the database strings using [SASLprep], the
195 database strings are to be treated as "stored" strings [Section 7,
196 Stringprep] and hence unassigned code points are prohibited from
197 appearing in their prepared output.
199 Regardless of the preparation algorithm used, if the output of a non-
200 invertible function (e.g., hash) of the expected string is stored, the
201 string MUST be prepared before input to that function.
203 Regardless of the preparation algorithm used, if preparation fails or
204 results in an empty string, verification SHALL fail.
206 When no authorization identity is provided, the server derives an
207 authorization identity from the prepared representation of the
208 provided authentication identity string. This ensures that the
209 derivation of different representations of the authentication identity
210 produce the same authorization identity.
212 The server MAY use the credentials to initialize any new
213 authentication database, such as one suitable for [CRAM-MD5] or
219 This section provides pseudo-code illustrating the verification
220 process (using hashed passwords and the SASLprep preparation function)
221 discussed above. This section is not definitive.
226 Zeilenga The SASL PLAIN Mechanism [Page 4]
228 INTERNET-DRAFT draft-ietf-sasl-plain-09.txt 16 June 2006
231 boolean Verify(string authzid, string authcid, string passwd) {
232 string pAuthcid = SASLprep(authcid, true); # prepare authcid
233 string pPasswd = SASLprep(passwd, true); # prepare passwd
234 if (pAuthcid == NULL || pPasswd == NULL) {
235 return false; # preparation failed
237 if (pAuthcid == "" || pPasswd == "") {
238 return false; # empty prepared string
241 storedHash = FetchPasswordHash(pAuthcid);
242 if (storedHash == NULL || storedHash == "") {
243 return false; # error or unknown authcid
246 if (!Compare(storedHash, Hash(pPasswd))) {
247 return false; # incorrect password
250 if (authzid == NULL ) {
251 authzid = DeriveAuthzid(pAuthcid);
252 if (authzid == NULL || authzid == "") {
253 return false; # could not derive authzid
257 if (!Authorize(pAuthcid, authzid)) {
258 return false; # not authorized
264 The second parameter of the SASLprep function, when true, indicates
265 that unassigned code points are allowed in the input. When the
266 SASLprep function is called to prepare the password prior to computing
267 the stored hash, the second parameter would be false.
269 The second parameter provided to the Authorize function is not
270 prepared by this code. The application-level SASL profile should be
271 consulted to determine what, if any, preparation is necessary.
273 Note that the DeriveAuthzid and Authorize functions (whether
274 implemented as one function or two, whether designed in a manner in
275 which these functions or whether the mechanism implementation can be
276 reused elsewhere) require knowledge and understanding of mechanism and
277 the application-level protocol specification and/or implementation
278 details to implement.
282 Zeilenga The SASL PLAIN Mechanism [Page 5]
284 INTERNET-DRAFT draft-ietf-sasl-plain-09.txt 16 June 2006
287 Note that the Authorize function outcome is clearly dependent on
288 details of the local authorization model and policy. Both functions
289 may be dependent on other factors as well.
294 This section provides examples of PLAIN authentication exchanges. The
295 examples are intended to help the readers understand the above text.
296 The examples are not definitive.
298 "C:" and "S:" indicate lines sent by the client and server
299 respectively. "<NULL>" represents a single NUL (U+0000) character.
300 The Application Configuration Access Protocol ([ACAP]) is used in the
303 The first example shows how the PLAIN mechanism might be used for user
306 S: * ACAP (SASL "CRAM-MD5") (STARTTLS)
308 S: a001 OK "Begin TLS negotiation now"
309 <TLS negotiation, further commands are under TLS layer>
310 S: * ACAP (SASL "CRAM-MD5" "PLAIN")
311 C: a002 AUTHENTICATE "PLAIN"
314 C: <NULL>tim<NULL>tanstaaftanstaaf
315 S: a002 OK "Authenticated"
317 The second example shows how the PLAIN mechanism might be used to
318 attempt to assume the identity of another user. In this example, the
319 server rejects the request. Also, this example makes use of the
320 protocol optional initial response capability to eliminate a
323 S: * ACAP (SASL "CRAM-MD5") (STARTTLS)
325 S: a001 OK "Begin TLS negotiation now"
326 <TLS negotiation, further commands are under TLS layer>
327 S: * ACAP (SASL "CRAM-MD5" "PLAIN")
328 C: a002 AUTHENTICATE "PLAIN" {20+}
329 C: Ursel<NULL>Kurt<NULL>xipj3plmq
330 S: a002 NO "Not authorized to requested authorization identity"
333 6. Security Considerations
338 Zeilenga The SASL PLAIN Mechanism [Page 6]
340 INTERNET-DRAFT draft-ietf-sasl-plain-09.txt 16 June 2006
343 As the PLAIN mechanism itself provided no integrity nor
344 confidentiality protections, it should not be used without adequate
345 external data security protection, such as TLS services provided by
346 many application layer protocols. By default, implementations SHOULD
347 NOT advertise and SHOULD NOT make use of the PLAIN mechanism unless
348 adequate data security services are in place.
350 When the PLAIN mechanism is used, the server gains the ability to
351 impersonate the user to all services with the same password regardless
352 of any encryption provided by TLS or other confidentiality protection
353 mechanisms. While many other authentication mechanisms have similar
354 weaknesses, stronger SASL mechanisms address this issue. Clients are
355 encouraged to have an operational mode where all mechanisms which are
356 likely to reveal the user's password to the server are disabled.
358 General [SASL] security considerations apply to this mechanism.
360 Unicode, [UTF-8], and [StringPrep] security considerations also apply.
363 7. IANA Considerations
365 It is requested that the SASL Mechanism registry [IANA-SASL] entry for
366 the PLAIN mechanism be updated to reflect that this document now
367 provides its technical specification.
370 Subject: Updated Registration of SASL mechanism PLAIN
372 SASL mechanism name: PLAIN
373 Security considerations: See RFC XXXX.
374 Published specification (optional, recommended): RFC XXXX
375 Person & email address to contact for further information:
376 Kurt Zeilenga <kurt@openldap.org>
377 IETF SASL WG <ietf-sasl@imc.org>
378 Intended usage: COMMON
379 Author/Change controller: IESG <iesg@ietf.org>
380 Note: Updates existing entry for PLAIN
385 This document is a revision of RFC 2595 by Chris Newman. Portions of
386 the grammar defined in Section 2 were borrowed from [UTF-8] by
389 This document is a product of the IETF Simple Authentication and
390 Security Layer (SASL) Working Group.
394 Zeilenga The SASL PLAIN Mechanism [Page 7]
396 INTERNET-DRAFT draft-ietf-sasl-plain-09.txt 16 June 2006
399 9. Normative References
401 [ABNF] Crocker, D. and P. Overell, "Augmented BNF for Syntax
402 Specifications: ABNF", RFC 4234, October 2005.
404 [Keywords] Bradner, S., "Key words for use in RFCs to Indicate
405 Requirement Levels", BCP 14, RFC 2119, March 1997
407 [SASL] Melnikov, A. (Editor), K. Zeilenga (Editor), "Simple
408 Authentication and Security Layer (SASL)", RFC 4422,
411 [SASLPrep] Zeilenga, K., "SASLprep: Stringprep Profile for User
412 Names and Passwords", RFC 4013, February 2005.
414 [StringPrep] Hoffman, P. and M. Blanchet, "Preparation of
415 Internationalized Strings ('stringprep')", RFC 3454,
418 [Unicode] The Unicode Consortium, "The Unicode Standard, Version
419 3.2.0" is defined by "The Unicode Standard, Version 3.0"
420 (Reading, MA, Addison-Wesley, 2000. ISBN 0-201-61633-5),
421 as amended by the "Unicode Standard Annex #27: Unicode
422 3.1" (http://www.unicode.org/reports/tr27/) and by the
423 "Unicode Standard Annex #28: Unicode 3.2"
424 (http://www.unicode.org/reports/tr28/).
426 [UTF-8] Yergeau, F., "UTF-8, a transformation format of ISO
427 10646", RFC 3629 (also STD 63), November 2003.
429 [TLS] Dierks, T. and, E. Rescorla, "The TLS Protocol Version
430 1.1", RFC 4346, April 2006.
433 10. Informative References
435 [ACAP] Newman, C. and J. Myers, "ACAP -- Application
436 Configuration Access Protocol", RFC 2244, November 1997.
437 [CRAM-MD5] Nerenberg, L., "The CRAM-MD5 SASL Mechanism",
438 draft-ietf-sasl-crammd5-xx.txt, a work in progress.
440 [DIGEST-MD5] Leach, P., C. Newman, and A. Melnikov, "Using Digest
441 Authentication as a SASL Mechanism",
442 draft-ietf-sasl-rfc2831bis-xx.txt, a work in progress.
444 [IANA-SASL] IANA, "SIMPLE AUTHENTICATION AND SECURITY LAYER (SASL)
446 <http://www.iana.org/assignments/sasl-mechanisms>.
450 Zeilenga The SASL PLAIN Mechanism [Page 8]
452 INTERNET-DRAFT draft-ietf-sasl-plain-09.txt 16 June 2006
455 [SMTP-AUTH] Myers, J., "SMTP Service Extension for Authentication",
456 RFC 2554, March 1999.
464 Email: Kurt@OpenLDAP.org
467 Appendix A. Changes since RFC 2595
469 This appendix is non-normative.
471 This document replaces Section 6 of RFC 2595.
473 The specification details how the server is to compare client-provided
474 character strings with stored character strings.
476 The ABNF grammar was updated. In particular, the grammar now allows
477 LINE FEED (U+000A) and CARRIAGE RETURN (U+000D) characters in the
478 authzid, authcid, passwd productions. However, whether these control
479 characters may be used depends on the string preparation rules
480 applicable to the production. For passwd and authcid productions,
481 control characters are prohibited. For authzid, one must consult the
482 application-level SASL profile. This change allows PLAIN to carry all
483 possible authorization identity strings allowed in SASL.
485 Pseudo-code was added.
487 The example section was expanded to illustrate more features of the
492 Intellectual Property
494 The IETF takes no position regarding the validity or scope of any
495 Intellectual Property Rights or other rights that might be claimed to
496 pertain to the implementation or use of the technology described in
497 this document or the extent to which any license under such rights
498 might or might not be available; nor does it represent that it has
499 made any independent effort to identify any such rights. Information
500 on the procedures with respect to rights in RFC documents can be found
501 in BCP 78 and BCP 79.
506 Zeilenga The SASL PLAIN Mechanism [Page 9]
508 INTERNET-DRAFT draft-ietf-sasl-plain-09.txt 16 June 2006
511 Copies of IPR disclosures made to the IETF Secretariat and any
512 assurances of licenses to be made available, or the result of an
513 attempt made to obtain a general license or permission for the use of
514 such proprietary rights by implementers or users of this specification
515 can be obtained from the IETF on-line IPR repository at
516 http://www.ietf.org/ipr.
518 The IETF invites any interested party to bring to its attention any
519 copyrights, patents or patent applications, or other proprietary
520 rights that may cover technology that may be required to implement
521 this standard. Please address the information to the IETF at
528 Copyright (C) The Internet Society (2006).
530 This document is subject to the rights, licenses and restrictions
531 contained in BCP 78, and except as set forth therein, the authors
532 retain all their rights.
534 This document and the information contained herein are provided on an
535 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
536 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
537 ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
538 INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
539 INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
540 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
562 Zeilenga The SASL PLAIN Mechanism [Page 10]