view Side-By-Side changes
Network Working Group Robert Siemborski INTERNET-DRAFTCarnegie Mellon UniversityGoogle, Inc. Intended Category: Proposed StandardApril, 2004February, 2005 Obsoletes: RFC 1734 Updates: RFC 2449 POP3 SASL Authentication Mechanism<draft-siemborski-rfc1734bis-03.txt><draft-siemborski-rfc1734bis-04.txt> Status of this MemoThis document is an Internet-DraftBy submitting this Internet-Draft, I certify that any applicable patent or other IPR claims of which I am aware have been disclosed, andisany of which I become aware will be disclosed, infull conformanceaccordance withall provisions of Section 10 of RFC2026. Internet-DraftsRFC 3668. Internet Drafts are working documents of the Internet Engineering Task Force (IETF), itsareas,Areas, and itsworking groups.Working Groups. Note that other groups may also distribute working documents asInternet-Drafts. Internet-DraftsInternet Drafts. Internet Drafts are draft documents valid for a maximum of sixmonths andmonths. Internet Drafts may be updated, replaced, or obsoleted by other documents at any time. It isinappropriatenot appropriate to use Internet Drafts as reference material or to cite them other than as"work``work inprogress."progress''. The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html. A revised version of this draft document will be submitted to the RFC editor as a Standards Track RFC for the Internet Community. Discussion and suggestions for improvement are requested. Distribution of thismemodraft is unlimited. When published as an RFC this document will obsolete RFC 1734 and update RFC 2449. Siemborski Expires August, 2005 [Page 1] POP3 SASL Authentication Mechanism February, 2005 Abstract This document defines a profile of the Simple Authentication and Security Layer (SASL) for the Post Office Protocol (POP3). This extension allows a POP3 client to indicate an authentication mechanism to the server, perform an authentication protocol exchange, and optionally negotiate a security layer for subsequent protocol interactions during this session.In orderThis document seeks to consolidateall oftheauthentication relatedinformationforrelated to POP3 AUTH into a singledocument,document. To this end, this document obsoletes RFC1734 and RFC 3206,1734, replacingthemit as a ProposedStandard. It alsoStandard and updates information contained in Section 6.3and Section 8of RFC 2449. Siemborski ExpiresOctober, 2004August, 2005 [Page1]2] POP3 SASL Authentication MechanismApril, 2004February, 2005 Table of Contents 1. How to Read This DocumentThe key words "MUST", "MUST NOT", "REQUIRED", "SHOULD", "SHOULD NOT", "RECOMMENDED", and "MAY" in this document are to be interpreted as defined in "Key words for use in RFCs to Indicate Requirement Levels" [KEYWORDS] In examples, "C:" and "S:" indicate lines sent by the client and server respectively.. . . . . . . . . . . . . . . . . . . . 4 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . 4 3. The[POP3] AUTH command [POP3-AUTH] in has suffered several problems in its specification. The first is that it was very similar to a [SASL] framework, but pre-dated the initial SASL specification. It was therefore missing some key components, such as a way to list the available authentication mechanisms. Later, [POP3-EXT] attempted to remedy this situation by adding the CAPA command and allowing an initial client response to the AUTH command, however problems in the clarity of the specification of how the initial client response was to be handled remained. Additionally, there is yet another document, [POP3-CODES], that provides additional response codes that are useful during authentication. Together, this means creating a full POP3 AUTH implementaiton requires an understanding of material in atleast six different documents. This document attempts to combine all of the POP3 SASL authentication related details into a single document, in addition to clarifying and updating the older specifications where appropriate. 3. The SASL Capability This section supercedes the definition of theSASL Capabilityin section 6.3 of [POP3-EXT]. CAPA tag: SASL Arguments: Supported SASL Mechanisms Standard Commands Affected None Siemborski Expires October, 2004 [Page 3] POP3 SASL Authentication Mechanism April, 2004 Announced states / possible differences: both / no Commands valid in states: AUTHORIZATION Specification Reference: This Document, [SASL] Discussion The SASL capability permits the use of the AUTH command (as defined in section. . . . . . . . . . . . . . . . . . . . . . . 4of this document) to begin a [SASL] negotiation.4. Thearguments to the SASL capability is a space- separated list of SASL mechanisms which are supported. If a server either does not support the CAPA command or does not advertise the SASL capability, clients SHOULD NOT attempt theAUTHcommand. If a client does attempt the AUTH command in such a situation, it MUST NOT supply the client initial response parameter (for backwards compatibility with [POP3-AUTH]). Note that the list of available mechanisms MAY change after a successful STLS command [POP3-TLS]. Additionally, implementations MAY choose to omit the SASL capability after a successful AUTH command has been completed. Example S: +OK pop.example.com BlurdyBlurp POP3 server ready C: CAPA S: +OK List of capabilities follows S: SASL KERBEROS_V4 GSSAPI ANONYMOUS S: STLS S: IMPLEMENTATION BlurdyBlurp POP3 server S: . 4. The AUTH Command AUTH mechanism [initial-response] Arguments: mechanism: A string identifying a [SASL] authentication mechanism. initial-response: An optional initial client response. If present, this response MUST be encoded as specified in Section 3 of [BASE64]. Siemborski Expires October, 2004 [Page 4] POP3 SASL Authentication Mechanism April, 2004 Restrictions: After an AUTH command has been successfully completed, no more AUTH commands may be issued in the same session. After a successful AUTH command completes, a server MUST reject any further AUTH commands with a -ERR reply. The AUTH command may only be given during the AUTHORIZATION state. Discussion: The AUTH command initiates a [SASL] authentication exchange between the client and the server. The client identifies the SASL mechanism to use with the first parameter of the AUTH command. If the server supports the requested authentication mechanism, it performs the SASL exchange to authenticate the user. Optionally, it also negotiates a security layer for subsequent protocol interactions during this session. If the requested authentication mechanism is not supported, the server rejects the AUTH command with a -ERR reply. The authentication protocol exchange consists of a series of server challenges and client responses that are specific to the chosen [SASL] mechanism. A server challenge is sent as a line consisting of a "+" character followed by a single space and a string encoded as specified in Section 3 of [BASE64]. This challenge MUST NOT contain any text other than the BASE64 encoded challenge. A client response consists of a line containing a string encoded as defined in Section 3 of [BASE64]. If the client wishes to cancel the authentication exchange, it issues a line with a single "*". If the server receives such a response, it MUST reject the AUTH command by sending a -ERR reply. The optional initial response argument to the AUTH command is used to save a round trip when using authentication mechanisms that support an initial client response. If the initial response argument is omitted and the chosen mechanism requires an initial client response, the server MUST proceed as defined in section 5.1 of [SASL]. In POP3, a server challenge with no data is defined as line with only a "+" followed by a single space. It MUST NOT contain any other data. For the purposes of the initial client response, the line length limitation defined in [POP3-EXT] still applies. If a client initial send would cause the AUTH command to exceed this length, the client MUST NOT use the initial response Siemborski Expires October, 2004 [Page 5] POP3 SASL Authentication Mechanism April, 2004 parameter (and instead proceed as defined in section 5.1 of [SASL]). If the client needs to send a zero-length initial response, the client MUST transmit the response as a single equals sign ("="). This indicates that the response is present, but contains no data. If the client uses an initial-response argument to the AUTH command with a SASL mechanism that does not support an initial client send, the server MUST reject the AUTH command with a -ERR reply. If the server cannot [BASE64] decode any client response, it MUST reject the AUTH command with a -ERR reply. If the client cannot BASE64 decode any of the server's challenges, it MUST cancel the authentication using the "*" response. In particular, servers and clients MUST reject (and not ignore) any character not explicitly allowed by the BASE64 alphabet, and MUST reject any sequence of BASE64 characters that contains the pad character ('=') anywhere other than the end of the string (e.g. "=AAA" and "AAA=BBB" are not allowed). Note that these [BASE64] strings (excepting the initial client response) may be of arbitrarily length. Clients and servers MUST be able to handle the maximum encoded size of challenges and responses generated by their supported authentication mechanisms. This requirement is independent of any line length limitations the client or server may have in other parts of its protocol implementation. If the server is unable to authenticate the client, it MUST reject the AUTH command with a -ERR reply. Should the client successfully complete the exchange, the server issues a +OK reply. Additionally, upon success, the POP3 session enters the TRANSACTION state. The authorization identity generated by this [SASL] exchange is a simple username, and MUST use the [SASLprep] profile of the [StringPrep] algorithm to prepare these names for matching. If preparation of the authorization identity fails or results in an empty string (unless it was transmitted as the empty string), the server MUST fail the authentication. If a security layer is negotiated during the SASL exchange, it takes effect for the client on the octet immediately following the CRLF that concludes the last response generated by the client. For the server, it takes effect immediately following Siemborski Expires October, 2004 [Page 6] POP3 SASL Authentication Mechanism April, 2004 the CRLF of its success reply. When a security layer takes effect, the server MUST discard any knowledge previously obtained from the client, which was not obtained from the SASL negotiation itself. Likewise, the client MUST discard any knowledge obtained from the server, such as the list of available POP3 service extensions. After a security layer is established, the server SHOULD NOT advertise either the SASL or the STLS extension. When both [TLS] and SASL security layers are in effect, the TLS encoding MUST be applied after the SASL encoding, regardless of the order in which the layers were negotiated. The service name specified by this protocol's profile of SASL is "pop". If an AUTH command fails, the client may try another authentication mechanism or present different credentials by issuing another AUTH command (or by using one of the other [POP3] authentication mechanisms). Likewise, the server MUST behave as if the client had not issued the AUTH command. To ensure interoperability, client and server implementations of this extension MUST implement the [DIGEST-MD5] SASL mechanism. 4.1. Formal Syntax The following syntax specification uses the Augmented Backus-Naur Form notation as specified in [ABNF]. Except as noted otherwise, all alphabetic characters are case- insensitive. The use of upper or lower case characters to define token strings is for editorial clarity only. Implementations MUST accept these strings in a case-insensitive fashion. UPALPHA = %x41-5A ;; Uppercase: A-Z LOALPHA = %x61-7A ;; Lowercase: a-z ALPHA = UPALPHA / LOALPHA ;; case insensitive DIGIT = %x30-39 ;; Digits 0-9 AUTH_CHAR = ALPHA / DIGIT / "-" / "_" Siemborski Expires October, 2004 [Page 7] POP3 SASL Authentication Mechanism April, 2004 auth_type = 1*20AUTH_CHAR auth_command = "AUTH" SPACE auth_type [SPACE (base64 / "=")] *(CRLF [base64]) CRLF base64 = base64_terminal / ( 1*(4base64_CHAR) [base64_terminal] ) base64_char = UPALPHA / LOALPHA / DIGIT / "+" / "/" ;; Case-sensitive base64_terminal = (2base64_char "==") / (3base64_char "=") continue_req = "+" SPACE [base64] CRLF CR = %x0C ;; ASCII CR, carriage return CRLF = CR LF LF = %x0A ;; ASCII LF, line feed SPACE = %x20 ;; ASCII SP, spaceCommand . . . . . . . . . . . . . . . . . . . . . . . . 5 4.1. Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . . . 8 4.2. ExamplesHere is an example of a client attempting AUTH PLAIN under TLS and making use of the initial client response: S: +OK pop.example.com BlurdyBlurp POP3 server ready C: CAPA S: +OK List of capabilities follows S: SASL KERBEROS_V4 GSSAPI ANONYMOUS S: STLS S: IMPLEMENTATION BlurdyBlurp POP3 server S:.C: STLS S: +OK Begin TLS negotiation now ... TLS negotiation proceeds, further commands protected by TLS layer ... C: CAPA S: +OK List of capabilities follows S: SASL PLAIN KERBEROS_V4 GSSAPI ANONYMOUS S: IMPLEMENTATION BlurdyBlurp POP3 server S:.C: AUTH PLAIN dGVzdAB0ZXN0AHRlc3Q= S: +OK Maildrop locked and ready Here is another client that is attempting AUTH PLAIN under a TLS Siemborski Expires October, 2004 [Page 8] POP3 SASL Authentication Mechanism April, 2004 layer, this time without the initial response. Parts of the negotiation before the TLS layer was established have been omitted: ... TLS negotiation proceeds, further commands protected by TLS layer ... C: CAPA S: +OK List of capabilities follows S: SASL PLAIN KERBEROS_V4 GSSAPI ANONYMOUS S: IMPLEMENTATION BlurdyBlurp POP3 server S:.C: AUTH PLAIN (note that there is a space following the '+' on the following line) S: + C: dGVzdAB0ZXN0AHRlc3Q= S: +OK Maildrop locked and ready Here is an example using a mechanism which does not support an initial client send, and includes server challenges: S: +OK pop.example.com BlurdyBlurp POP3 server ready C: CAPA S: +OK List of capabilities follows S: SASL KERBEROS_V4 GSSAPI ANONYMOUS S: STLS S: IMPLEMENTATION BlurdyBlurp POP3 server S:.C: AUTH KERBEROS_V4 S: + ezLUFA== (the following lines are broken for editorial clarity only) C: BAYFQU5EUkVXLkNNVS5FRFUAOCCXeMiVyFe9K6Nwne7+sPLgIoF9YQ5ePfxUsMlJAf C7aoNySU8nrqS9m8JAddsUeuyc5HFXXovaKLrZNo2bTLH0Lyolwy0W9ryJDojbKmHy zSMqFsGD4EL0 S: + Z74fTwDw7KQ= C: vSAF7ha6qotK2UHUgKlsEA== S: +OK Maildrop locked and ready ... at this point a security layer has been established and additional commands and responses proceed within it ... 5. Extended POP3 Response Codes This section defines four POP3 response codes which can be used to determine the reason for a failed login (provided that the server advertises the RESP-CODES capability [POP3-EXT]). These definitions supercede those in [POP3-EXT] and [POP3-CODES]. It is RECOMMENDED that server applications use these codes when possible to allow clients a straightforward, interoperable way to determine the cause of an authentication failure (as opposed to. . . . . . . . . . . . . . . . . . . . . . . 9 5. Protocol Actions . . . . . . . . . . . . . . . . . . . . . . . . 11 6. Intellectual Property Rights . . . . . . . . . . . . . . . . . . 11 7. Copyright . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 9. Changes From RFC 1734, RFC 2449. . . . . . . . . . . . . . . . . 14 10. Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 14 11. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . 14 Siemborski ExpiresOctober, 2004August, 2005 [Page9]3] POP3 SASL Authentication MechanismApril, 2004 parsing error text). 5.1. The LOGIN-DELAY Response Code This occurs on an -ERR responseFebruary, 2005 1. How toan AUTH, USER (see note), PASS or APOP commandRead This Document The key words "MUST", "MUST NOT", "REQUIRED", "SHOULD", "SHOULD NOT", "RECOMMENDED", andindicates that the user has logged"MAY" inrecently and will not be allowed to login again until the login delay period has expired. Please see the Security Considerations section ofthis documentfor an important note about returning this code in response to the USER command. 5.2. The IN-USE Response Code This occurs on an -ERR responseare toan AUTH, APOP, or PASS command. It indicates the authentication was successful, but the user's maildrop is currentlybe interpreted as defined in "Key words for use(probablyin RFCs to Indicate Requirement Levels" [KEYWORDS] In examples, "C:" and "S:" indicate lines sent byanother POP3 client). 5.3.the client and server respectively. 2. Introduction The [POP3] AUTHResponse Codecommand [POP3-AUTH] has suffered several problems in its specification. TheAUTH response code informs the client that therefirst is that it was very similar to aproblem with[SASL] framework, but pre-dated theuser's credentials. This might be an incorrect password, an unknown user name, an expired account, an attempt to authenticate in violation of policy (such as from an invalid location or during an unauthorized time), orinitial SASL specification. It was therefore missing someother problem. The AUTH response code is valid with an -ERR responsekey components, such as a way toany authentication command including AUTH, USER (see the note in the Security Considerations section of this document), PASS, or APOP. Servers which includelist theAUTH response code with anyavailable authenticationfailure SHOULD supportmechanisms. Later, [POP3-EXT] attempted to remedy this situation by adding the CAPA command[POP3-EXT]andSHOULD includeallowing an initial client response to theAUTH-RESP-CODE capability (definedAUTH command, however problems in thenext section) inclarity of theCAPA response. AUTH-RESP-CODE assuresspecification of how the initial client response was to be handled remained. Additionally, there is yet another document, [POP3-CODES], that provides additional response codes thatonly errors with the AUTH codearecaused by credential problems. 5.3.1.useful during authentication. Together, this means creating a full POP3 AUTH implementaiton requires an understanding of material in at least five (and probably six) different documents. This document attempts to combine the information in [POP3-AUTH] and [POP3-EXT] to simplify this situation. Additionally, it aims to clarify and update the older specifications where appropriate. 3. TheAUTH-RESP-CODESASL Capability This section supercedes the definition of the SASL Capability in section 6.3 of [POP3-EXT]. CAPA tag:AUTH-RESP-CODESASL Arguments:noneSupported SASL Mechanisms Added commands:noneAUTH Standard Commands Affected Siemborski ExpiresOctober, 2004August, 2005 [Page10]4] POP3 SASL Authentication MechanismApril, 2004 Standard commands affected: noneFebruary, 2005 None Announced states / possible differences: both / no Commands valid in states:n/aAUTHORIZATION Specificationreference: this document Discussion:Reference: This Document, [SASL] Discussion TheAUTH-RESP-CODESASL capabilityindicates that the server includes the AUTH response code with any authentication error caused by a problem with the user's credentials. 5.4. The SYS Response Code The SYS response code announces that a failure is due to a system error, as opposed topermits theuser's credentials or an external condition. It is hierarchical, with two possible second-level codes: TEMP and PERM. (Case is not significant at any leveluse of thehierarchy.) SYS/TEMP indicates a problem which is likely to be temporaryAUTH command (as defined innature, and therefore there is no needsection 4 of this document) toalarm the user, unless the failure persists. Examples might includebegin acentral resource which is currently locked or otherwise temporarily unavailable, insufficient free disk or memory, etc. SYS/PERM[SASL] negotiation. The argument to the SASL capability isused for problemsa space- separated list of SASL mechanisms which areunlikely to be resolved without intervention. It is appropriate to alert the user and suggest that the organization'ssupported. If a server either does not support the CAPA command orassistance personnel be contacted. Examples include corrupted mailboxes, system configuration errors, etc. The SYS response code is valid with an -ERR response to anydoes not advertise the SASL capability, clients SHOULD NOT attempt the AUTH command.6. Security Considerations Security issues are discussed throughout this memo. BeforeIf a client does attempt the[SASL] negotiation has begun, any protocol interactions are performedAUTH command in such a situation, it MUST NOT supply theclear and may be modifiedclient initial response parameter (for backwards compatibility with [POP3-AUTH]). Note that the list of available mechanisms MAY change after a successful STLS command [POP3-TLS]. However, as required byan active attacker. For this reason, clients and servers[POP3-EXT] implementations MUSTdiscard any knowledge obtained priorcontinue tothe start ofinclude the SASLnegotiation upon the establishmentcapability even after a successful AUTH command has been completed (even though no further AUTH commands may be issued). Example S: +OK pop.example.com BlurdyBlurp POP3 server ready C: CAPA S: +OK List of capabilities follows S: SASL KERBEROS_V4 GSSAPI ANONYMOUS S: STLS S: IMPLEMENTATION BlurdyBlurp POP3 server S: . 4. The AUTH Command AUTH mechanism [initial-response] Arguments: mechanism: A string identifying asecurity layer.[SASL] authentication mechanism. Siemborski ExpiresOctober, 2004August, 2005 [Page11]5] POP3 SASL Authentication MechanismApril, 2004 Servers MAY implementFebruary, 2005 initial-response: An optional initial client response. If present, this response MUST be encoded as specified in Section 3 of [BASE64]. Restrictions: After an AUTH command has been successfully completed, no more AUTH commands may be issued in the same session. After apolicy wherebysuccessful AUTH command completes, a server MUST reject any further AUTH commands with an -ERR reply. The AUTH command may only be given during theconnection is dropped afterAUTHORIZATION state. Discussion: The AUTH command initiates anumber of failed[SASL] authenticationattempts. If they do so, they SHOULD NOT dropexchange between theconnection until atleast 3 attempts to authenticate have failed. Implementations MUST support a configuration where [SASL] mechanisms that are vulnerableclient and the server. The client identifies the SASL mechanism topassive eavesdropping attacks (such as [PLAIN]) are not advertised or used withoutuse with thepresencefirst parameter ofan external security layer such as [TLS]. ReturningtheLOGIN-DELAY orAUTHresponse codes tocommand. If theUSER command avoidsserver supports thework of authenticatingrequested authentication mechanism, it performs theuser but is likely to reveal informationSASL exchange to authenticate theclient about the existence of the account in question. Unlessuser. Optionally, it also negotiates a security layer for subsequent protocol interactions during this session. If theserverrequested authentication mechanism isoperating in an environment where user names arenotsecret (for example, many popular email clients advertisesupported, thePOP server and user name in an outgoing mail header), or whereserveraccess is restricted, orrejects the AUTH command with an -ERR reply. The authentication protocol exchange consists of a series of servercan verifychallenges and client responses thatthe connection is to the same user, the the server SHOULD NOT issue this response codeare specific to theUSER command. Thechosen [SASL] mechanism. A serverstill saves the costchallenge is sent as a line consisting ofopening the maildrop, whicha "+" character followed by a single space and a string encoded as specified insome environments is the most expensive step. 7. IANA Considerations This document requests that the IANA update the entry for the "pop" SASL protocol name to point at this document.Section 3 of [BASE64]. Thisdocument requests that the IANA update the entry forline MUST NOT contain any text other than theSASL POP3 capability to beBASE64 encoded challenge. A client response consists of a line containing a string encoded as defined in Section 3 ofthis document. This document requests that[BASE64]. If theIANA updateclient wishes to cancel theentry forauthentication exchange, it issues a line with a single "*". If theLOGIN- DELAY, IN-USE, AUTH, SYS/TEMP, and SYS/PERM POP3server receives such a response, it MUST reject the AUTH command by sending an -ERR reply. The optional initial responsecodesargument tothis document. This document requeststhe AUTH command is used to save a round trip when using authentication mechanisms that support an initial client response. If theIANA updateinitial response argument is omitted and theentry forchosen mechanism requires an initial client response, theAUTH- RESP-CODE capability to beserver MUST proceed as defined inSection 5.3.1 of this document. 8. Protocol Actions [RFC Editor: Remove thissectionbefore publication] This document obsoletes RFC 1734 and replaces it as a Proposed Standard. By moving RFC 1734 to Historic, RFC 1731 can also be moved to Historic (as RFC 1734 was the last document to have5.1 of [SASL]. In POP3, anormative reference). This document obsoletes RFC 3206 and replaces itserver challenge with no data is defined as line with only aProposed"+" followed by a single space. It MUST NOT contain any other data. Siemborski ExpiresOctober, 2004August, 2005 [Page12]6] POP3 SASL Authentication MechanismApril, 2004 Standard. It also updates information contained in Section 6.3 and Section 8 of RFC 2449. 9. Intellectual Property Rights The IETF takes no position regardingFebruary, 2005 For thevalidity or scopepurposes ofany intellectual property or other rights that might be claimed to pertainthe initial client response, the line length limitation defined in [POP3-EXT] still applies. If a client initial send would cause the AUTH command to exceed this length, theimplementation orclient MUST NOT useofthetechnology describedinitial response parameter (and instead proceed as defined inthis document orsection 5.1 of [SASL]). If theextentclient needs towhich any license under such rights might or might not be available; neither does it representsend a zero-length initial response, the client MUST transmit the response as a single equals sign ("="). This indicates thatit has made any effortthe response is present, but contains no data. If the client uses an initial-response argument toidentify any such rights. Information ontheIETF's proceduresAUTH command withrespect to rights in standards-track and standards-related documentation can be found in BCP-11. Copies of claims of rights made available for publication and any assurances of licenses to be made available, ora SASL mechanism that does not support an initial client send, theresult ofserver MUST reject the AUTH command with anattempt made to obtain-ERR reply. If the server cannot [BASE64] decode ageneral license or permission forclient response, it MUST reject theuse of such proprietary rights by implementors or users of this specification can be obtained fromAUTH command with an -ERR reply. If theIETF Secretariat. The IETF invitesclient cannot BASE64 decode a server challenge, it MUST cancel the authentication using the "*" response. In particular, servers and clients MUST reject (and not ignore) anyinterested party to bring to its attentioncharacter not explicitly allowed by the BASE64 alphabet, and MUST reject anycopyrights, patents or patent applications, or other proprietary rights which may cover technology that may be required to practice this standard. Please addresssequence of BASE64 characters that contains theinformation topad character ('=') anywhere other than theIETF Executive Director. 10. Copyright Copyright (C) The Internet Society (2003). All Rights Reserved. This document and translationsend ofit may be copied and furnished to others,the string (e.g. "=AAA" andderivative works"AAA=BBB" are not allowed). Note thatcomment on or otherwise explain it or assist in its implementationthese [BASE64] strings (excepting the initial client response) may beprepared, copied, publishedof arbitrarily length. Clients anddistributed, in whole or in part, without restrictionservers MUST be able to handle the maximum encoded size of challenges and responses generated by their supported authentication mechanisms. This requirement is independent of anykind, provided thatline length limitations theabove copyright notice and this paragraph are included on all such copies and derivative works. However, this document itselfclient or server maynot be modifiedhave inany way, such as by removingother parts of its protocol implementation. If thecopyright notice or referencesserver is unable to authenticate theInternet Society or other Internet organizations, except as needed forclient, it MUST reject the AUTH command with an -ERR reply. Should the client successfully complete the exchange, the server issues a +OK reply. Additionally, upon success, the POP3 session enters the TRANSACTION state. The authorization identity generated by the [SASL] exchange is a simple username, and MUST use thepurpose[SASLprep] profile ofdeveloping Internet standards in which casetheprocedures[StringPrep] algorithm to prepare these names forcopyrights defined inmatching. If preparation of theInternet Standards process must be followed,authorization identity fails oras required to translateresults in an empty string (unless itinto languages other than English. This document andwas transmitted as theinformation contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDINGempty string), the server MUST fail the authentication. Siemborski ExpiresOctober, 2004August, 2005 [Page13]7] POP3 SASL Authentication MechanismApril, 2004 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Siemborski Expires October, 2004 [Page 14] POP3February, 2005 If a security layer is negotiated during the SASLAuthentication Mechanism April, 2004 11. References Theexchange, it takes effect for the client on the octet immediately followingdocuments contain normative definitions or specificationsthe CRLF thatare necessary for correct understandingconcludes the last response generated by the client. For the server, it takes effect immediately following the CRLF ofthis protocol: [BASE64] Josefsson, S., "The Base16, Base32, and Base64 Data Encodings", RFC 3548, July 2003. [DIGEST-MD5] Leach, P., Melnikov, A., and Newman C., "Using Digest Authentication asits success reply. When a security layer takes effect, the server MUST discard any knowledge previously obtained from the client, which was not obtained from the SASLMechanism", draft-ietf-sasl- rfc2831bis-*.txt, a work in progress. [KEYWORDS] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997 [POP3] Myers, J. and Rose, M., "Post Office Protocol - Version 3", STD 53, RFC 1939, May 1996. [POP3-EXT] Gellens, R., Newman, C., and Lundblade, L., "POP3 Extension Mechanism", RFC 2449, November 1998. [POP3-TLS] Newman, C., "Using TLS with IMAP, POP3, and ACAP", RFC 2595, June 1999. [SASL] Melnikov, A., "Simple Authentication and Security Layer (SASL)", draft-ietf-sasl-rfc2222bis-*.txt, a work in progress. [SASLprep] Zeilega, K., "SASLprep: Stringprep profile for user namesnegotiation itself. Likewise, the client MUST discard any knowledge obtained from the server, such as the list of available POP3 service extensions. When both [TLS] andpasswords", draft-ietf-sasl-saslprep-*.txt, a workSASL security layers are inprogress [StringPrep] Hoffman, P. and Blanchet, M., "Preparationeffect, the TLS encoding MUST be applied after the SASL encoding, regardless ofInternationalized Strings ("stringprep")", draft-hoffman- rfc3454bis-*.txt, a workthe order inprogresswhich the layers were negotiated. Thefollowing references are for informational purposes only: [PLAIN] Zeilenga, K., "The Plain SASL Mechanism", draft-ietf-sasl- plain-*.txt, a work in progress. [POP3-AUTH] Myers, J., "POP3 AUTHentication Command", RFC 1734, January 1994. [POP3-CODES] Siemborski Expires October, 2004 [Page 15] POP3service name specified by this protocol's profile of SASLAuthentication Mechanism April, 2004 Gellens, R., "The SYS andis "pop". If an AUTHPOP Response Codes", RFC 3206, February 2002. [TLS] Dierks, T. and C. Allen, "The TLS Protocol Version 1.0", RFC 2246, January 1999. 12. Changes From RFC 1734, RFC 2449, and RFC 3206 1. The SASL-based semantics defined in RFC 2449 are now normative forcommand fails, the client may try another authentication mechanism or present different credentials by issuing another AUTHextension. 2. Clarifications and examplescommand (or by using one of theproper behavior of initialother [POP3] authentication mechanisms). Likewise, the server MUST behave as if the client had not issued the AUTH command. To ensure interoperability, clientresponse handling. 3. Minimum requirement of support for DIGEST-MD5. 4. Clarify ordering of TLSandSASL security layers. 5. Update references to newer versionsserver implementations ofvarious specifications. 6. Clarify thatthis extension MUST implement themechanism list can change. 7. Add[DIGEST-MD5] SASL mechanism. 4.1. Formal Syntax The following syntax specification uses the Augmented Backus-Naur Form notation as specified in [ABNF]. Except as noted otherwise, all alphabetic characters are case- insensitive. The use ofthe SASLprep profileupper or lower case characters to define token strings is forpreparing authorization identities. 8. General othereditorialclarifications. 9. Consolidation of all applicable information intoclarity only. Implementations MUST accept these strings in asingle document. 13. Author's Address: Robert Siemborski Carnegie Mellon, Andrew Systems Group Cyert Hall 207 5000 Forbes Avenue Pittsburgh, PA 15213 +1 412 268 7456 rjs3+@andrew.cmu.edu 14. Acknowledgments: The author would like to acknowledge the contributions of John Myers, Randall Gellens, Chris Newman, Laurence Lundblade, and other contributors to RFC 1734, RFC 2554, and RFC 3206, on which this document draws heavily.case-insensitive fashion. UPALPHA = %x41-5A ;; Uppercase: A-Z LOALPHA = %x61-7A ;; Lowercase: a-z ALPHA = UPALPHA / LOALPHA ;; case insensitive DIGIT = %x30-39 ;; Digits 0-9 Siemborski ExpiresOctober, 2004August, 2005 [Page16]8] POP3 SASL Authentication MechanismApril, 2004 The author would also like to thank Ken Murchison, Alexey Melnikov, and Mark Crispin forFebruary, 2005 AUTH_CHAR = ALPHA / DIGIT / "-" / "_" auth_type = 1*20AUTH_CHAR auth_command = "AUTH" SPACE auth_type [SPACE (base64 / "=")] *(CRLF [base64]) CRLF auth_resp = ("*" / base64) CRLF base64 = base64_terminal / ( 1*(4base64_CHAR) [base64_terminal] ) base64_char = UPALPHA / LOALPHA / DIGIT / "+" / "/" ;; Case-sensitive base64_terminal = (2base64_char "==") / (3base64_char "=") continue_req = "+" SPACE [base64] CRLF CR = %x0C ;; ASCII CR, carriage return CRLF = CR LF LF = %x0A ;; ASCII LF, line feed SPACE = %x20 ;; ASCII SP, space Additionally, thetime they devoted to reviewing early draftsABNF specified in [POP3-EXT] is updated as follows: response = greeting / single-line / capa-resp / multi-line / continue_req 4.2. Examples Here is an example of a client attempting AUTH PLAIN under TLS and making use ofthis document.the initial client response: Siemborski ExpiresOctober, 2004August, 2005 [Page17]9] POP3 SASL Authentication MechanismApril, 2004 Table of Contents 1. How to Read This Document . . . . . . . . . . . . . . . . . . . . 3 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . 3 3. The SASL Capability . . . . . . . . . . . . . . . . . . . . . . . 3 4. The AUTH Command . . . . . . . . . . . . . . . . . . . . . . . . 4 4.1. Formal Syntax . . . . . . . . . . . . . . . . . . . . . . . . . 7 4.2. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 5. ExtendedFebruary, 2005 S: +OK pop.example.com BlurdyBlurp POP3Response Codes . . . . . . . . . . . . . . . . . . 9 5.1. The LOGIN-DELAY Response Code . . . . . . . . . . . . . . . . . 10 5.2. The IN-USE Response Code . . . . . . . . . . . . . . . . .server ready C: CAPA S: +OK List of capabilities follows S: SASL KERBEROS_V4 GSSAPI ANONYMOUS S: STLS S: IMPLEMENTATION BlurdyBlurp POP3 server S: . C: STLS S: +OK Begin TLS negotiation now ... TLS negotiation proceeds, further commands protected by TLS layer ... C: CAPA S: +OK List of capabilities follows S: SASL PLAIN KERBEROS_V4 GSSAPI ANONYMOUS S: IMPLEMENTATION BlurdyBlurp POP3 server S: .10 5.3. TheC: AUTHResponse Code . . . . . . . . . . . . . . . . . . . . 10 5.3.1. The AUTH-RESP-CODE Capability . . . . . . . . . . . . . . . . 10 5.4. The SYS Response Code . . . . . . . . . . . . . . . . . . .PLAIN dGVzdAB0ZXN0AHRlc3Q= S: +OK Maildrop locked and ready Here is another client that is attempting AUTH PLAIN under a TLS layer, this time without the initial response. Parts of the negotiation before the TLS layer was established have been omitted: ... TLS negotiation proceeds, further commands protected by TLS layer ... C: CAPA S: +OK List of capabilities follows S: SASL PLAIN KERBEROS_V4 GSSAPI ANONYMOUS S: IMPLEMENTATION BlurdyBlurp POP3 server S: . C: AUTH PLAIN (note that there is a space following the '+' on the following line) S: + C: dGVzdAB0ZXN0AHRlc3Q= S: +OK Maildrop locked and ready Here is an example using a mechanism which does not support an initial client send, and includes server challenges: Siemborski Expires August, 2005 [Page 10] POP3 SASL Authentication Mechanism February, 2005 S: +OK pop.example.com BlurdyBlurp POP3 server ready C: CAPA S: +OK List of capabilities follows S: SASL KERBEROS_V4 GSSAPI ANONYMOUS S: STLS S: IMPLEMENTATION BlurdyBlurp POP3 server S: .11C: AUTH KERBEROS_V4 S: + ezLUFA== (the following lines are broken for editorial clarity only) C: BAYFQU5EUkVXLkNNVS5FRFUAOCCXeMiVyFe9K6Nwne7+sPLgIoF9YQ5ePfxUsMlJAf C7aoNySU8nrqS9m8JAddsUeuyc5HFXXovaKLrZNo2bTLH0Lyolwy0W9ryJDojbKmHy zSMqFsGD4EL0 S: + Z74fTwDw7KQ= C: vSAF7ha6qotK2UHUgKlsEA== S: +OK Maildrop locked and ready ... at this point a security layer has been established and additional commands and responses proceed within it ... 5. Protocol Actions [RFC Editor: Remove this section before publication] This document obsoletes RFC 1734 and replaces it as a Proposed Standard. By moving RFC 1734 to Historic, RFC 1731 can also be moved to Historic (as RFC 1734 was the last document to have a normative reference). It also updates information contained in Section 6.3 of RFC 2449. 6.Security Considerations . . . . . . . . . . . . . . . . . . . . . 11Intellectual Property Rights The IETF takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on the IETF's procedures with respect to rights in standards-track and standards-related documentation can be found in BCP-11. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementors or users of this specification can be obtained from the IETF Secretariat. The IETF invites any interested party to bring to its attention any Siemborski Expires August, 2005 [Page 11] POP3 SASL Authentication Mechanism February, 2005 copyrights, patents or patent applications, or other proprietary rights which may cover technology that may be required to practice this standard. Please address the information to the IETF Executive Director. 7.IANA Considerations . . . . . . . . . . . . . . . . . . . . . . . 12 8. Protocol Actions . . . . . . . . . . . . . . . . . . . . . . . . 12 9. Intellectual Property Rights . . . . . . . . . . . . . . . . . . 13 10.Copyright. . . . . . . . . . . . . . . . . . . . . . . . . . . 13 11.Copyright (C) The Internet Society (2005). This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights." "This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Siemborski Expires August, 2005 [Page 12] POP3 SASL Authentication Mechanism February, 2005 8. References. . . . . . . . . . . . . . . . . . . . . . . . . . . 14 12.The following documents contain normative definitions or specifications that are necessary for correct understanding of this protocol: [BASE64] Josefsson, S., "The Base16, Base32, and Base64 Data Encodings", RFC 3548, July 2003. [DIGEST-MD5] Leach, P., Melnikov, A., and Newman C., "Using Digest Authentication as a SASL Mechanism", draft-ietf-sasl- rfc2831bis-*.txt, a work in progress. [KEYWORDS] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997 [POP3] Myers, J. and Rose, M., "Post Office Protocol - Version 3", STD 53, RFC 1939, May 1996. [POP3-EXT] Gellens, R., Newman, C., and Lundblade, L., "POP3 Extension Mechanism", RFC 2449, November 1998. [POP3-TLS] Newman, C., "Using TLS with IMAP, POP3, and ACAP", RFC 2595, June 1999. [SASL] Melnikov, A., "Simple Authentication and Security Layer (SASL)", draft-ietf-sasl-rfc2222bis-*.txt, a work in progress. [SASLprep] Zeilega, K., "SASLprep: Stringprep profile for user names and passwords", draft-ietf-sasl-saslprep-*.txt, a work in progress [StringPrep] Hoffman, P. and Blanchet, M., "Preparation of Internationalized Strings ("stringprep")", draft-hoffman- rfc3454bis-*.txt, a work in progress The following references are for informational purposes only: [PLAIN] Zeilenga, K., "The Plain SASL Mechanism", draft-ietf-sasl- plain-*.txt, a work in progress. [POP3-AUTH] Myers, J., "POP3 AUTHentication Command", RFC 1734, January 1994. [POP3-CODES] Siemborski Expires August, 2005 [Page 13] POP3 SASL Authentication Mechanism February, 2005 Gellens, R., "The SYS and AUTH POP Response Codes", RFC 3206, February 2002. [TLS] Dierks, T. and C. Allen, "The TLS Protocol Version 1.0", RFC 2246, January 1999. 9. Changes From RFC 1734, RFC2449, and2449. 1. The SASL-based semantics defined in RFC3206 . . . . . . . . . 16 13.2449 are now normative for the AUTH extension. 2. Clarifications and examples of the proper behavior of initial client response handling. 3. Minimum requirement of support for DIGEST-MD5. 4. Clarify ordering of TLS and SASL security layers. 5. Update references to newer versions of various specifications. 6. Clarify that the mechanism list can change. 7. Add the use of the SASLprep profile for preparing authorization identities. 8. General other editorial clarifications. 9. Consolidation of much applicable information into a single document. 10. Author'sAddress . . . . . . . . . . . . . . . . . . . . . . . . 16 14. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . 16Address: Robert Siemborski Google, Inc. 1600 Ampitheatre Parkway Mountain View, CA 94043 +1 650 623 6925 robsiemb@google.com 11. Acknowledgments: The author would like to acknowledge the contributions of John Myers, Randall Gellens, Chris Newman, Laurence Lundblade, and other contributors to RFC 1734 and RFC 2554, on which this document draws heavily. The author would also like to thank Ken Murchison, Randall Gellens, Siemborski ExpiresOctober, 2004August, 2005 [Page1]14] POP3 SASL Authentication Mechanism February, 2005 Alexey Melnikov, and Mark Crispin for the time they devoted to reviewing early drafts of this document. Siemborski Expires August, 2005 [Page 15] ----