Bump versions.
[gsasl.git] / doc / specification / draft-siemborski-rfc1734bis-00.txt
blob6794ee5dfffece57e687f9b1a388bc9d88c20541
7 Network Working Group                                  Robert Siemborski
8 INTERNET-DRAFT                                Carnegie Mellon University
9 Intended Category: Proposed Standard                       October, 2003
12                    POP3 SASL Authentication Mechanism
14                   <draft-siemborski-rfc1734bis-00.txt>
17 Status of this Memo
18     This document is an Internet-Draft and is in full conformance with
19     all provisions of Section 10 of RFC2026.
21     Internet-Drafts are working documents of the Internet Task Force
22     (IETF), its areas, and its working groups.  Note that other groups
23     may also distribute working documents as Internet-Drafts.
25     Internet-Drafts are draft documents valid for a maximum of six
26     months and may be updated, replaced, or obsoleted by other documents
27     at any time.  It is inappropriate to use Internet Drafts as
28     reference material or to cite them other than as "work in progress."
30     The list of current Internet-Drafts can be accessed at
31     http://www.ietf.org/ietf/1id-abstracts.txt
33     The list of Internet-Draft Shadow Directories can be accessed at
34     http://www.ietf.org/shadow.html.
36     Distribution of this memo is unlimited.
38 Abstract
40     This document defines a profile of the Simple Authentication and
41     Security Layer (SASL) for the Post Office Protocol (POP3).  This
42     extension allows a POP3 client to indicate an authentication
43     mechanism to the server, perform an authentication protocol
44     exchange, and optionally negotiate a security layer for subsequent
45     protocol interactions during this session.
47     This document obsoletes RFC 1734 and replaces it as a Proposed
48     Standard.  It also updates information contained in Section 6.3 of
49     RFC 2449.
51 1.  How to Read This Document
53     The key words "MUST, "MUST NOT", "REQUIRED", "SHOULD", "SHOULD NOT",
54     "RECOMMENDED", and "MAY" in this document are to be interpreted as
58 Siemborski                 Expires April, 2004                  [Page 1]
64 POP3 SASL Authentication Mechanism                         October, 2003
67 Table of Contents
70 1. How to Read This Document . . . . . . . . . . . . . . . . . . . .   1
71 2. Introduction  . . . . . . . . . . . . . . . . . . . . . . . . . .   3
72 3. The SASL Capability . . . . . . . . . . . . . . . . . . . . . . .   3
73 4. The AUTH Command  . . . . . . . . . . . . . . . . . . . . . . . .   4
74 4.1. Examples  . . . . . . . . . . . . . . . . . . . . . . . . . . .   2
75 5. Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . . . .   8
76 6. Security Considerations . . . . . . . . . . . . . . . . . . . . .   9
77 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . . .   9
78 8. Intellectual Property Rights  . . . . . . . . . . . . . . . . . .   9
79 9. Copyright . . . . . . . . . . . . . . . . . . . . . . . . . . . .  10
80 10. References . . . . . . . . . . . . . . . . . . . . . . . . . . .  10
81 11. Changes From RFC 1734 and RFC 2449 . . . . . . . . . . . . . . .  11
82 12. Author's Address . . . . . . . . . . . . . . . . . . . . . . . .  12
83 13. Acknowledgments  . . . . . . . . . . . . . . . . . . . . . . . .  12
118 Siemborski                 Expires April, 2004                  [Page 2]
124 POP3 SASL Authentication Mechanism                         October, 2003
127     defined in "Key words for use in RFCs to Indicate Requirement
128     Levels" [KEYWORDS]
130     In examples, "C:" and "S:" indicate lines sent by the client and
131     server respectively.
133 2.  Introduction
135     The AUTH command [POP3-AUTH] in [POP3] has suffered several
136     deficiencies in its specification.  The first is that it was very
137     similar to a [SASL] framework, but pre-dated the initial SASL
138     specification.  It was therefore missing some key components, such
139     as a way to list the available authentication mechanisms.  Later,
140     [POP3-EXT] attempted to remedy this situation by adding the CAPA
141     command, and allowing an initial client response to the AUTH
142     command, however problems in the specification of how the initial
143     client response was to be handled remained.  This document attempts
144     to combine all of the POP3 SASL authentication related details into
145     a single document.
147 3.  The SASL Capability
149     This section supercedes the definition of the SASL Capability in
150     section 6.3 of [POP3-EXT].
152     CAPA tag:
153         SASL
155     Arguments:
156         Supported SASL Mechanisms
158     Standard Commands Affected
159         None
161     Announced states / possible differences:
162         both / no
164     Commands valid in states:
165         AUTHENTICATION
167     Specification Reference:
168         This Document, [SASL]
170     Discussion
171         The SASL capability permits the use of the AUTH command (as
172         defined in section 4 of this document) to begin a [SASL]
173         negotiation.  The arguments to the SASL capability is a space-
174         separated list of SASL mechanisms which are supported.
178 Siemborski                 Expires April, 2004                  [Page 3]
184 POP3 SASL Authentication Mechanism                         October, 2003
187         If a server either does not support the CAPA command or does not
188         advertise the SASL capability, clients SHOULD NOT attempt the
189         AUTH command.  If a client does attempt the AUTH command in such
190         a situation, it MUST NOT supply the client initial response
191         parameter (for backwards compatibility with [POP3-AUTH]).
193         Note that the list of available mechanisms MAY change after a
194         successful STLS command [POP3-TLS].  Additionally,
195         implementations MAY choose to omit the SASL capability after a
196         successful AUTH command has been completed.
198     Example
200         S: +OK pop.example.com BlurdyBlurp POP3 server ready
201         C: CAPA
202         S: +OK List of capabilities follows
203         S: SASL KERBEROS_V4 GSSAPI ANONYMOUS
204         S: STLS
205         S: IMPLEMENTATION BlurdyBlurp POP3 server
206         S: .
209 4.  The AUTH Command
211     AUTH mechanism [initial-response]
213       Arguments:
214           mechanism: A string identifying a [SASL] authentication
215           mechanism.
217           initial-response: An optional initial client response.  If
218           present, this response MUST be [BASE64] encoded.
220       Restrictions:
221           After an AUTH command has been successfully completed, no more
222           AUTH commands may be issued in the same session.  After a
223           successful AUTH command completes, a server MUST reject any
224           further AUTH commands with a -ERR reply.
226           The AUTH command may only be given during the AUTHORIZATION
227           state.
229       Discussion:
230           The AUTH command initiates a [SASL] authentication exchange
231           between the client and the server.  The client identifies the
232           SASL mechanism to use with the first parameter of the AUTH
233           command.  If the server supports the requested authentication
234           mechanism, it performs the SASL exchange to authenticate the
238 Siemborski                 Expires April, 2004                  [Page 4]
244 POP3 SASL Authentication Mechanism                         October, 2003
247           user.  Optionally, it also negotiates a security layer for
248           subsequent protocol interactions during this session.  If the
249           requested authentication mechanism is not supported, the
250           server rejects the AUTH command with a -ERR reply.
252           The authentication protocol exchange consists of a series of
253           server challenges and client responses that are specific to
254           the chosen [SASL] mechanism.
256           A server challenge is sent as a line consisting of a "+"
257           character followed by a single space and a [BASE64] encoded
258           string supplied by the SASL mechanism.  This challenge MUST
259           NOT contain any text other than the BASE64 encoded challenge.
261           A client response consists of a line containing a [BASE64]
262           encoded string.  If the client wishes to cancel the
263           authentication exchange, it issues a line with a single "*".
264           If the server receives such a response, it MUST reject the
265           AUTH command by sending a -ERR reply.
267           The optional initial response argument to the AUTH command is
268           used to save a round trip when using authentication mechanisms
269           that support an initial client response.  If the initial
270           response argument is omitted and the chosen mechanism requires
271           an initial client response, the server MUST proceed as defined
272           in section 5.1 of [SASL].  In POP3, a server challenge with no
273           data is defined as line with only a "+" followed by a single
274           space.  It MUST NOT contain any other data.
276           For the purposes of the initial client response, the line
277           length limitation defined in [POP3-EXT] still applies.  If a
278           client initial send would cause the AUTH command to exceed
279           this length, the client MUST NOT use the initial response
280           parameter (and instead proceed as defined in section 5.1 of
281           [SASL]).
283           If the client needs to send a zero-length initial response,
284           the client MUST transmit the response as a single equals sign
285           ("=").  This indicates that the response is present, but
286           contains no data.
288           If the client uses an initial-response argument to the AUTH
289           command with a SASL mechanism that does not support an initial
290           client send, the server MUST reject the AUTH command with a
291           -ERR reply.
293           If the server cannot [BASE64] decode any client response, it
294           MUST reject the AUTH command with a -ERR reply.  If the client
298 Siemborski                 Expires April, 2004                  [Page 5]
304 POP3 SASL Authentication Mechanism                         October, 2003
307           cannot BASE64 decode any of the server's challenges, it MUST
308           cancel the authentication using the "*" response.  In
309           particular, servers and clients MUST reject (and not ignore)
310           any character not explicitly allowed by the BASE64 alphabet,
311           and MUST reject any sequence of BASE64 characters that
312           contains the pad character ('=') anywhere other than the end
313           of the string (e.g. "=AAA" and "AAA=BBB" are not allowed).
315           Note that these [BASE64] strings (excepting the initial client
316           response) may be of arbitrarily length.  Clients and servers
317           MUST be able to handle the maximum encoded size of challenges
318           and responses generated by their supported authentication
319           mechanisms.  This requirement is independent of any line
320           length limitations the client or server may have in other
321           parts of its protocol implementation.
323           If the server is unable to authenticate the client, it MUST
324           reject the AUTH command with a -ERR reply.  Should the client
325           successfully complete the exchange, the server issues a +OK
326           reply.  Additionally, upon success, the POP3 session enters
327           the TRANSACTION state.
329           If a security layer is negotiated during the SASL exchange, it
330           takes effect for the client on the octet immediately following
331           the CRLF that concludes the last response generated by the
332           client.  For the server, it takes effect immediately following
333           the CRLF of its success reply.
335           When a security layer takes effect, the server MUST discard
336           any knowledge previously obtained from the client, which was
337           not obtained from the SASL negotiation itself.  Likewise, the
338           client MUST discard any knowledge obtained from the server,
339           such as the list of available POP3 service extensions.  After
340           a security layer is established, the server SHOULD NOT
341           advertise either the SASL or the STLS extension.
343           When both [TLS] and SASL security layers are in effect, the
344           TLS encoding MUST be applied after the SASL encoding,
345           regardless of the order in which the layers were negotiated.
347           The service name specified by this protocol's profile of SASL
348           is "pop".
350           If an AUTH command fails, the client may try another
351           authentication mechanism or present different credentials by
352           issuing another AUTH command (or by using one of the other
353           [POP3] authentication mechanisms).  Likewise, the server MUST
354           behave as if the client had not issued the AUTH command.
358 Siemborski                 Expires April, 2004                  [Page 6]
364 POP3 SASL Authentication Mechanism                         October, 2003
367           To ensure interoperability, client and server implementations
368           of this extension MUST implement the STLS extension, and the
369           PLAIN SASL mechanism [POP3-TLS].  Implementations MUST support
370           a configuration where [SASL] mechanisms that are vulnerable to
371           passive eavesdropping attacks are not advertised or used
372           without the presence of an external security layer such as
373           [TLS].
375 4.1.    Examples
377     Here is an example of a client attempting AUTH PLAIN under TLS and
378     making use of the initial client response:
380      S: +OK pop.example.com BlurdyBlurp POP3 server ready
381      C: CAPA
382      S: +OK List of capabilities follows
383      S: SASL KERBEROS_V4 GSSAPI ANONYMOUS
384      S: STLS
385      S: IMPLEMENTATION BlurdyBlurp POP3 server
386      S: .
387      C: STLS
388      S: +OK Begin TLS negotiation now
389        ... TLS negotiation proceeds, further commands protected by TLS layer ...
390      C: CAPA
391      S: +OK List of capabilities follows
392      S: SASL PLAIN KERBEROS_V4 GSSAPI ANONYMOUS
393      S: IMPLEMENTATION BlurdyBlurp POP3 server
394      S: .
395      C: AUTH PLAIN dGVzdAB0ZXN0AHRlc3Q=
396      S: +OK Maildrop locked and ready
398     Here is another client that is attempting AUTH PLAIN under a TLS
399     layer, this time without the initial response.  Parts of the
400     negotiation before the TLS layer was established have been omitted:
402        ... TLS negotiation proceeds, further commands protected by TLS layer ...
403      C: CAPA
404      S: +OK List of capabilities follows
405      S: SASL PLAIN KERBEROS_V4 GSSAPI ANONYMOUS
406      S: IMPLEMENTATION BlurdyBlurp POP3 server
407      S: .
408      C: AUTH PLAIN
409        (note that there is a space following the '+' on the following line)
410      S: +
411      C: dGVzdAB0ZXN0AHRlc3Q=
412      S: +OK Maildrop locked and ready
414     Here is an example using a mechanism which does not support an
418 Siemborski                 Expires April, 2004                  [Page 7]
424 POP3 SASL Authentication Mechanism                         October, 2003
427     initial client send, and includes server challenges:
429      S: +OK pop.example.com BlurdyBlurp POP3 server ready
430      C: CAPA
431      S: +OK List of capabilities follows
432      S: SASL KERBEROS_V4 GSSAPI ANONYMOUS
433      S: STLS
434      S: IMPLEMENTATION BlurdyBlurp POP3 server
435      S: .
436      C: AUTH KERBEROS_V4
437      S: + ezLUFA==
438         (the following lines are broken for editorial clarity only)
439      C: BAYFQU5EUkVXLkNNVS5FRFUAOCCXeMiVyFe9K6Nwne7+sPLgIoF9YQ5ePfxUsMlJAf
440         C7aoNySU8nrqS9m8JAddsUeuyc5HFXXovaKLrZNo2bTLH0Lyolwy0W9ryJDojbKmHy
441         zSMqFsGD4EL0
442      S: + Z74fTwDw7KQ=
443      C: vSAF7ha6qotK2UHUgKlsEA==
444      S: +OK Maildrop locked and ready
445         ... at this point a security layer has been established and additional
446             commands and responses proceed within it ...
449 5.  Formal Syntax
451     The following syntax specification uses the Augmented Backus-Naur
452     Form notation as specified in [ABNF].
454     Except as noted otherwise, all alphabetic characters are case-
455     insensitive.  The use of upper or lower case characters to define
456     token strings is for editorial clarity only.  Implementations MUST
457     accept these strings in a case-insensitive fashion.
460         UPALPHA         = %x41-5A            ;; Uppercase: A-Z
462         LOALPHA         = %x61-7A            ;; Lowercase: a-z
464         ALPHA           = UPALPHA / LOALPHA  ;; case insensitive
466         DIGIT           = %x30-39            ;; Digits 0-9
468         AUTH_CHAR       = ALPHA / DIGIT / "-" / "_"
470         auth_type       = 1*20AUTH_CHAR
472         auth_command    = "AUTH" SPACE auth_type [SPACE (base64 / "=")]
473                           *(CRLF [base64]) CRLF
478 Siemborski                 Expires April, 2004                  [Page 8]
484 POP3 SASL Authentication Mechanism                         October, 2003
487         base64          = base64_terminal /
488                           ( 1*(4base64_CHAR) [base64_terminal] )
490         base64_char     = UPALPHA / LOALPHA / DIGIT / "+" / "/"
491                           ;; Case-sensitive
493         base64_terminal = (2base64_char "==") / (3base64_char "=")
495         continue_req    = "+" SPACE [base64] CRLF
497         CR              = %x0C           ;; ASCII CR, carriage return
499         CRLF            = CR LF
501         LF              = %x0A           ;; ASCII LF, line feed
503         SPACE           = %x20           ;; ASCII SP, space
506 6.  Security Considerations
508     Security issues are discussed throughout this memo.
510     Before the [SASL] negotiation has begun, any protocol interactions
511     are performed in the clear and may be modified by an active
512     attacker.  For this reason, clients and servers MUST discard any
513     knowledge obtained prior to the start of the SASL negotiation upon
514     the establishment of a security layer.
516 7.  IANA Considerations
518     This document requests that the IANA update the entry for the "pop"
519     SASL protocol name to point at this document.
521     This document requests that the IANA update the entry for the SASL
522     POP3 capability to be as defined in Section 3 of this document.
524 8.  Intellectual Property Rights
526     The IETF takes no position regarding the validity or scope of any
527     intellectual property or other rights that might be claimed to
528     pertain to the implementation or use of the technology described in
529     this document or the extent to which any license under such rights
530     might or might not be available; neither does it represent that it
531     has made any effort to identify any such rights.  Information on the
532     IETF's procedures with respect to rights in standards-track and
533     standards-related documentation can be found in BCP-11.  Copies of
534     claims of rights made available for publication and any assurances
538 Siemborski                 Expires April, 2004                  [Page 9]
544 POP3 SASL Authentication Mechanism                         October, 2003
547     of licenses to be made available, or the result of an attempt made
548     to obtain a general license or permission for the use of such
549     proprietary rights by implementors or users of this specification
550     can be obtained from the IETF Secretariat.
552     The IETF invites any interested party to bring to its attention any
553     copyrights, patents or patent applications, or other proprietary
554     rights which may cover technology that may be required to practice
555     this standard.  Please address the information to the IETF Executive
556     Director.
558 9.  Copyright
560     Copyright (C) The Internet Society (2003). All Rights Reserved.
562     This document and translations of it may be copied and furnished to
563     others, and derivative works that comment on or otherwise explain it
564     or assist in its implementation may be prepared, copied, published
565     and distributed, in whole or in part, without restriction of any
566     kind, provided that the above copyright notice and this paragraph
567     are included on all such copies and derivative works.  However, this
568     document itself may not be modified in any way, such as by removing
569     the copyright notice or references to the Internet Society or other
570     Internet organizations, except as needed for the  purpose of
571     developing Internet standards in which case the procedures for
572     copyrights defined in the Internet Standards process must be
573     followed, or as required to translate it into languages other than
574     English.
576     This document and the information contained herein is provided on an
577     "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
578     TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
579     BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
580     HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
581     MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
598 Siemborski                 Expires April, 2004                 [Page 10]
604 POP3 SASL Authentication Mechanism                         October, 2003
607 10.  References
609      The following documents contain normative definitions or
610 specifications that are necessary for correct understanding of this
611 protocol:
613 [BASE64]    Josefsson, S., "The Base16, Base32, and Base64 Data
614             Encodings", RFC 3548, July 2003.
616 [KEYWORDS]  Bradner, S., "Key words for use in RFCs to Indicate
617             Requirement Levels", BCP 14, RFC 2119, March 1997
619 [POP3]      Myers, J. & Rose, M., "Post Office Protocol - Version 3",
620             STD 53, RFC 1939, May 1996.
622 [POP3-EXT]  Gellens, R., Newman, C. & Lundblade, L., "POP3 Extension
623             Mechanism", RFC 2449, November 1998.
625 [POP3-TLS]  Newman, C. "Using TLS with IMAP, POP3, and ACAP", RFC 2595,
626             June 1999.
628 [SASL]      Myers, J., "Simple Authentication and Security Layer
629             (SASL)", RFC 2222, October 1997.
631 The following references are for informational purposes only:
633 [POP3-AUTH] Myers, J., "POP3 AUTHentication Command", RFC 1734, January
634             1994.
636 [TLS]       Dierks, T. and C. Allen, "The TLS Protocol Version 1.0", RFC
637             2246, January 1999.
639 11.  Changes From RFC 1734 and RFC 2449
641             1.   The SASL-based semantics defined in RFC 2449 are now
642                  normative for the AUTH extension.
644             2.   Clarifications and examples of the proper behavior of
645                  initial client response handling.
647             3.   Minimum requirement of support for TLS+PLAIN.
649             4.   Clarify ordering of TLS and SASL security layers.
651             5.   Update references to newer versions of various
652                  specifications.
658 Siemborski                 Expires April, 2004                 [Page 11]
664 POP3 SASL Authentication Mechanism                         October, 2003
667             6.   Clarify that the mechanism list can change.
669             7.   General other editorial clarifications.
671 12.  Author's    Address:
673     Robert Siemborski
674     Carnegie Mellon, Andrew Systems Group
675     Cyert Hall 207
676     5000 Forbes Avenue
677     Pittsburgh, PA  15213
678     +1 412 268 7456
679     rjs3+@andrew.cmu.edu
681 13.  Acknowledgments:
683     The author would like to acknowledge the contributions of John Myers
684     and other contributors to RFC 1734, on which this document draws
685     heavily.
687     The author would also like to thank Ken Murchison and Mark Crispin
688     for the time they devoted to reviewing early drafts of this
689     document.
718 Siemborski                 Expires April, 2004                 [Page 12]