7 INTERNET-DRAFT Editor: Kurt D. Zeilenga
8 Intended Category: Standards Track OpenLDAP Foundation
9 Expires in six months 27 October 2003
13 The Plain SASL Mechanism
14 <draft-ietf-sasl-plain-03.txt>
19 This document is an Internet-Draft and is in full conformance with all
20 provisions of Section 10 of RFC2026.
22 This document is intended to be, after appropriate review and
23 revision, submitted to the RFC Editor as a Standards Track document.
24 Distribution of this memo is unlimited. Technical discussion of this
25 document will take place on the IETF SASL mailing list
26 <ietf-sasl@imc.org>. Please send editorial comments directly to the
27 document editor <Kurt@OpenLDAP.org>.
29 Internet-Drafts are working documents of the Internet Engineering Task
30 Force (IETF), its areas, and its working groups. Note that other
31 groups may also distribute working documents as Internet-Drafts.
32 Internet-Drafts are draft documents valid for a maximum of six months
33 and may be updated, replaced, or obsoleted by other documents at any
34 time. It is inappropriate to use Internet-Drafts as reference
35 material or to cite them other than as ``work in progress.''
37 The list of current Internet-Drafts can be accessed at
38 <http://www.ietf.org/ietf/1id-abstracts.txt>. The list of
39 Internet-Draft Shadow Directories can be accessed at
40 <http://www.ietf.org/shadow.html>.
42 Copyright (C) The Internet Society (2003). All Rights Reserved.
44 Please see the Full Copyright section near the end of this document
50 This document defines a simple clear-text user/password Simple
51 Authentication and Security Layer (SASL) mechanism called the PLAIN
52 mechanism. The PLAIN mechanism is intended to be used, in combination
53 with data confidentiality services provided by a lower layer, in
54 protocols which lack a simple password authentication command.
58 Zeilenga Plain SASL Mechanism [Page 1]
60 INTERNET-DRAFT draft-ietf-sasl-plain-03.txt 27 October 2003
65 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
66 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
67 document are to be interpreted as described in [Keywords].
70 1. Background and Intended Usage
72 Clear-text passwords are simple, interoperate with almost all existing
73 operating system authentication databases, and are useful for a smooth
74 transition to a more secure password-based authentication mechanism.
75 The drawback is that they are unacceptable for use over an unencrypted
78 This document defines the PLAIN Simple Authentication and Security
79 Layer ([SASL]) mechanism for use in protocols with no clear-text login
80 command (e.g., [ACAP] or [SMTP-AUTH]).
82 The name associated with this mechanism is "PLAIN".
84 The PLAIN SASL mechanism does not provide a security layer. This
85 mechanism MUST NOT be used without adequate security protection as the
86 mechanism affords no integrity nor confidentiality protection itself.
87 The PLAIN SASL mechanism MUST NOT be advertised unless a strong
88 encryption layer, such as provided by Transport Layer Security
89 ([TLS]), is active or backwards compatibility dictates otherwise.
91 This document updates RFC 2595, replacing Section 6. Changes since
92 RFC 2595 are detailed in Appendix A.
95 2. PLAIN SASL mechanism
97 The mechanism consists of a single message from the client to the
98 server. The client sends the authorization identity (identity to
99 login as), followed by a NUL (U+0000) character, followed by the
100 authentication identity (identity whose password will be used),
101 followed by a NUL (U+0000) character, followed by the clear-text
102 password. The client leaves the authorization identity empty if it
103 wishes the server to derive the authorization identity from the
104 authentication identity.
106 The formal grammar for the client message using Augmented BNF [ABNF]
109 message = [authzid] NUL authcid NUL passwd
110 authcid = 1*SAFE ; MUST accept up to 255 octets
114 Zeilenga Plain SASL Mechanism [Page 2]
116 INTERNET-DRAFT draft-ietf-sasl-plain-03.txt 27 October 2003
119 authzid = 1*SAFE ; MUST accept up to 255 octets
120 passwd = 1*SAFE ; MUST accept up to 255 octets
123 SAFE = UTF1 / UTF2 / UTF3 / UTF4
124 ;; any UTF-8 encoded Unicode character except NUL
126 UTF1 = %x01-7F ;; except NULL
128 UTF3 = %xE0 %xA0-BF UTF0 / %xE1-EC 2(UTF0) /
129 %xED %x80-9F UTF0 / %xEE-EF 2(UTF0)
130 UTF4 = %xF0 %x90-BF 2(UTF0) / %xF1-F3 3(UTF0) /
134 The authorization identity (authzid), authentication identity
135 (authcid) and password (passwd) SHALL be transferred as [UTF-8]
136 encoded strings of [Unicode] characters. As NUL (U+0000) is used as a
137 deliminator, the NUL (U+0000) MUST NOT appear in authzid, authcid, or
140 The form of the authzid production is specific to the
141 application-level protocol's SASL profile [SASL]. The authcid and
142 passwd productions are form-free. Use of non-visible characters or
143 characters which a user may be unable to enter on some keyboards is
146 Servers MUST be capable of accepting authzid, authcid, and passwd
147 productions up to and including 255 octets. It is noted that the
148 UTF-8 encoding of a Unicode character may be as long as 4 octets.
150 Upon receipt of the message, the server will verify the presented
151 authentication identity (authcid) and password (passwd) with the
152 system authentication database and verify the authentication
153 credentials permit the client to login as the (presented or derived)
154 authorization identity. If both steps succeed, the user is
157 The presented authentication identity and password strings are not to
158 be compared directly with stored strings. The server SHALL first
159 prepare authentication identity and password strings using the
160 [SASLPrep] profile of the [StringPrep] algorithm. If preparation
161 fails or results in an empty string, verification SHALL fail. If the
162 server stores only the hash of expected string, that string MUST be
163 prepared before generation of the hash.
165 When the no authorization identity is provided, the server SHALL
166 derive the authorization identity from the prepared representation of
170 Zeilenga Plain SASL Mechanism [Page 3]
172 INTERNET-DRAFT draft-ietf-sasl-plain-03.txt 27 October 2003
175 the provided authentication identity string. This ensures that the
176 derivation of different representations of the authentication identity
177 produce the same authorization identity.
179 The verification function (using hashed password) can be written (in
182 boolean Verify(string authzid, string authcid, string passwd) {
183 string pAuthcid = SASLprep(authcid); # prepare authcid
184 string pPasswd = SASLprep(passwd); # prepare passwd
185 if (pAuthcid == NULL || pPasswd == NULL) {
186 return false; # preparation failed
188 if (pAuthcid == "" || pPasswd == "") {
189 return false; # empty prepared string
192 storedHash = FetchPasswordHash(pAuthcid);
193 if (storedHash == NULL || storedHash == "") {
194 return false; # error or unknown authcid
197 if (!Compare(storedHash, Hash(pPassword))) {
198 return false; # incorrect password
201 if (authzid == NULL) {
202 authzid = DeriveAuthzid(pAuthcid);
203 if (authzid == NULL || authzid == "") {
204 return false; # could not derive authzid
208 if (!Authorize(pAuthcid, authzid)) {
209 return false; # not authorized
215 Also note that the second parameter provided to the Authorize function
216 is not prepared by this code. The application-level SASL profile
217 should be consulted to determine what, if any, preparation is
220 The server MAY also use the credentials to initialize any new
221 authentication database, such as one suitable for [CRAM-MD5] or
226 Zeilenga Plain SASL Mechanism [Page 4]
228 INTERNET-DRAFT draft-ietf-sasl-plain-03.txt 27 October 2003
233 Here is an example of how this might be used to initialize a CRAM-MD5
234 authentication database using the Application Configuration Access
235 Protocol ([ACAP]). "C:" and "S:" indicate lines sent by the client
236 and server respectively and <NUL> represents a single NUL (U+0000)
239 S: * ACAP (SASL "CRAM-MD5") (STARTTLS)
240 C: a001 AUTHENTICATE "CRAM-MD5"
241 S: + "<1896.697170952@postoffice.reston.mci.net>"
242 C: "tim b913a602c7eda7a495b4e6e7334d3890"
243 S: a001 NO (TRANSITION-NEEDED)
244 "Please change your password, or use TLS to login"
246 S: a002 OK "Begin TLS negotiation now"
247 <TLS negotiation, further commands are under TLS layer>
248 S: * ACAP (SASL "CRAM-MD5" "PLAIN" "EXTERNAL")
249 C: a003 AUTHENTICATE "PLAIN" {21+}
250 C: <NUL>tim<NUL>tanstaaftanstaaf
251 S: a003 OK CRAM-MD5 password initialized
255 5. Security Considerations
257 The PLAIN mechanism relies on the TLS encryption layer for security.
258 When used without TLS, it is vulnerable to a common network
259 eavesdropping attack. Therefore PLAIN MUST NOT be advertised or used
260 unless a suitable TLS encryption layer is active or backwards
261 compatibility dictates otherwise.
263 When the PLAIN mechanism is used, the server gains the ability to
264 impersonate the user to all services with the same password regardless
265 of any encryption provided by TLS or other network privacy mechanisms.
266 While many other authentication mechanisms have similar weaknesses,
267 stronger SASL mechanisms address this issue. Clients are encouraged
268 to have an operational mode where all mechanisms which are likely to
269 reveal the user's password to the server are disabled.
271 General SASL security considerations apply to this mechanism.
272 "stringprep" and Unicode [StringPrep] security considerations also
273 apply, as do [UTF-8] security considerations.
276 6. IANA Considerations
278 It is requested that the SASL Mechanism registry [IANA-SASL] entry for
282 Zeilenga Plain SASL Mechanism [Page 5]
284 INTERNET-DRAFT draft-ietf-sasl-plain-03.txt 27 October 2003
287 the PLAIN mechanism be updated to reflect that this document now
288 provides its technical specification.
291 Subject: Updated Registration of SASL mechanism PLAIN
293 SASL mechanism name: PLAIN
294 Security considerations: See RFC XXXX.
295 Published specification (optional, recommended): RFC XXXX
296 Person & email address to contact for further information:
297 Kurt Zeilenga <kurt@openldap.org>
298 IETF SASL WG <ietf-sasl@imc.org>
299 Intended usage: COMMON
300 Author/Change controller: IESG <iesg@ietf.org>
301 Note: Updates existing entry for PLAIN
306 This document is a revision of RFC 2595 by Chris Newman. Portions of
307 the grammar defined in Section 2 were borrowed from [UTF-8] by
310 This document is a product of the IETF SASL WG.
313 8. Normative References
315 [ABNF] Crocker, D. and P. Overell, "Augmented BNF for Syntax
316 Specifications: ABNF", RFC 2234, November 1997.
318 [Keywords] Bradner, S., "Key words for use in RFCs to Indicate
319 Requirement Levels", BCP 14, RFC 2119, March 1997
321 [SASL] Melnikov, A. (Editor), "Simple Authentication and
322 Security Layer (SASL)",
323 draft-ietf-sasl-rfc2222bis-xx.txt, a work in progress.
325 [StringPrep] Hoffman P. and M. Blanchet, "Preparation of
326 Internationalized Strings ('stringprep')",
327 draft-hoffman-rfc3454bis-xx.txt, a work in progress.
329 [Unicode] The Unicode Consortium, "The Unicode Standard, Version
330 3.2.0" is defined by "The Unicode Standard, Version 3.0"
331 (Reading, MA, Addison-Wesley, 2000. ISBN 0-201-61633-5),
332 as amended by the "Unicode Standard Annex #27: Unicode
333 3.1" (http://www.unicode.org/reports/tr27/) and by the
334 "Unicode Standard Annex #28: Unicode 3.2"
338 Zeilenga Plain SASL Mechanism [Page 6]
340 INTERNET-DRAFT draft-ietf-sasl-plain-03.txt 27 October 2003
343 (http://www.unicode.org/reports/tr28/).
345 [UTF-8] Yergeau, F., "UTF-8, a transformation format of ISO
346 10646", draft-yergeau-rfc2279bis-xx.txt, a work in
349 [TLS] Dierks, T. and, E. Rescorla, "The TLS Protocol Version
350 1.1", draft-ietf-tls-rfc2246-bis-xx.txt, a work in
354 9. Informative References
356 [ACAP] Newman, C. and J. Myers, "ACAP -- Application
357 Configuration Access Protocol", RFC 2244, November 1997.
358 [CRAM-MD5] Nerenberg, L., "The CRAM-MD5 SASL Mechanism",
359 draft-ietf-sasl-crammd5-xx.txt, a work in progress.
361 [DIGEST-MD5] Leach, P., C. Newman, and A. Melnikov, "Using Digest
362 Authentication as a SASL Mechanism",
363 draft-ietf-sasl-rfc2831bis-xx.txt, a work in progress.
365 [IANA-SASL] IANA, "SIMPLE AUTHENTICATION AND SECURITY LAYER (SASL)
366 MECHANISMS", http://www.iana.org/assignments/sasl-
369 [SMTP-AUTH] Myers, J., "SMTP Service Extension for Authentication",
370 RFC 2554, March 1999.
379 Email: kurt@OpenLDAP.org
382 Appendix A. Changes since RFC 2595
384 This appendix is non-normative.
386 This document replaces Section 6 of RFC 2595.
388 The specification details how the server is to compare client-provided
389 character strings with stored character strings.
394 Zeilenga Plain SASL Mechanism [Page 7]
396 INTERNET-DRAFT draft-ietf-sasl-plain-03.txt 27 October 2003
399 The ABNF grammar was updated. In particular, the grammar now allows
400 LINE FEED (U+000A) and CARRIAGE RETURN (U+000D) characters in the
401 authzid, authcid, passwd productions. However, whether these control
402 characters may be used depends on the string preparation rules
403 applicable to the production. For passwd and authcid productions,
404 control characters are prohibited. For authzid, one must consult the
405 application-level SASL profile.
409 Intellectual Property Rights
411 The IETF takes no position regarding the validity or scope of any
412 intellectual property or other rights that might be claimed to pertain
413 to the implementation or use of the technology described in this
414 document or the extent to which any license under such rights might or
415 might not be available; neither does it represent that it has made any
416 effort to identify any such rights. Information on the IETF's
417 procedures with respect to rights in standards-track and
418 standards-related documentation can be found in BCP-11. Copies of
419 claims of rights made available for publication and any assurances of
420 licenses to be made available, or the result of an attempt made to
421 obtain a general license or permission for the use of such proprietary
422 rights by implementors or users of this specification can be obtained
423 from the IETF Secretariat.
425 The IETF invites any interested party to bring to its attention any
426 copyrights, patents or patent applications, or other proprietary
427 rights which may cover technology that may be required to practice
428 this standard. Please address the information to the IETF Executive
435 Copyright (C) The Internet Society (2003). All Rights Reserved.
437 This document and translations of it may be copied and furnished to
438 others, and derivative works that comment on or otherwise explain it
439 or assist in its implmentation may be prepared, copied, published and
440 distributed, in whole or in part, without restriction of any kind,
441 provided that the above copyright notice and this paragraph are
442 included on all such copies and derivative works. However, this
443 document itself may not be modified in any way, such as by removing
444 the copyright notice or references to the Internet Society or other
445 Internet organizations, except as needed for the purpose of
446 developing Internet standards in which case the procedures for
450 Zeilenga Plain SASL Mechanism [Page 8]
452 INTERNET-DRAFT draft-ietf-sasl-plain-03.txt 27 October 2003
455 copyrights defined in the Internet Standards process must be followed,
456 or as required to translate it into languages other than English.
506 Zeilenga Plain SASL Mechanism [Page 9]