Network Working Group J. Vinocur Internet Draft Cornell University Document: draft-ietf-nntpext-authinfo-00.txt C. Newman Sun Microsystems K. Murchison Oceana Matrix Ltd. April 2004 NNTP Extension for Authentication Status of this memo This document is an Internet-Draft and is in full conformance with all provisions of Section 10 of RFC 2026. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in 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. Abstract This document defines a profile of the Simple Authentication and Security Layer [SASL] for the Network News Transport Protocol [NNTP] protocol and updates/deprecates information contained in Section 3.1 of [NNTP-COMMON]. This extension allows a NNTP client to indicate an authentication mechanism to the server, perform an authentication protocol exchange, and optionally negotiate a secu- rity layer for subsequent protocol interactions during the remain- der of an NNTP session. Vinocur, et. al. Expires October 2004 [Page 1] Internet Draft NNTP Authentication April 2004 Table of Contents 1. Introduction ............................................. 2 1.1. Conventions Used in this Document ................... 2 2. The AUTHINFO Extension ................................... 3 2.1. AUTHINFO USER/PASS .................................. 5 2.1.2. Description .................................... 5 2.1.3. Examples ....................................... 7 2.2. AUTHINFO SASL ....................................... 7 2.2.1. Usage .......................................... 7 2.2.2. Description .................................... 8 2.2.3. Examples ....................................... 11 2.3. AUTHINFO Formal Syntax .............................. 13 3. Authentication Tracking/Logging .......................... 14 4. Security Considerations .................................. 14 5. IANA Considerations ...................................... 15 5.1. IANA Considerations for SASL/GSSAPI services ........ 15 5.2. IANA Considerations for NNTP extensions ............. 15 6. Normative References ..................................... 16 7. Informative References ................................... 17 8. Authors' Addresses ....................................... 17 9. Acknowledgments .......................................... 18 10. Intellectual Property Rights ............................ 18 11. Copyright ............................................... 18 1. Introduction Although NNTP [NNTP] has traditionally provided public access to newsgroups, authentication is often useful, for example to control resource consumption, to allow abusers of the POST command to be identified, and restrict access to "local" newsgroups. The ad-hoc AUTHINFO USER and AUTHINFO PASS commands, documented in [NNTP-COMMON], provide a very weak authentication mechanism in widespread use by the installed base. Due to their insecurity and ubiquity they are formalized in this specification, but only for use in combination with appropriate protection layers. The ad-hoc AUTHINFO GENERIC command, also documented in [NNTP-COM- MON], provided an NNTP-specific equivalent of the generic SASL [SASL] facility. This document deprecates AUTHINFO GENERIC in favor of an AUTHINFO SASL replacement so that NNTP can benefit from authentication mechanisms development for other SASL-enabled appli- cation protocols including SMTP, POP, IMAP, LDAP, and BEEP. 1.1. Conventions Used in this Document Vinocur, et. al. Expires October 2004 [Page 2] Internet Draft NNTP Authentication April 2004 The key words "REQUIRED", "MUST", "MUST NOT", "SHOULD", "SHOULD NOT", "MAY", and "OPTIONAL" in this document are to be interpreted as described in "Key words for use in RFCs to Indicate Requirement Levels" [KEYWORDS]. Terms related to authentication are defined in "On Internet Authen- tication" [AUTH]. This document assumes you are familiar with NNTP [NNTP] and SASL [SASL]. In the examples, commands from the client are indicated with [C], and responses from the server are indicated with [S]. 2. The AUTHINFO Extension This extension provides three new commands: AUTHINFO USER, AUTHINFO PASS, and AUTHINFO SASL. The label for this extension is AUTHINFO. The AUTHINFO extension label contains an argument list detailing which authentication commands are available. The "USER" argument indicates that AUTHINFO USER/PASS is supported as defined by Section 2.1 of this document. The "USER" argument MUST NOT be advertised unless a strong encryption layer (e.g. TLS [NNTP-TLS]) is in use or backward compatibility dictates otherwise. The "SASL" argument indicates that AUTHINFO SASL is supported as defined by Section 2.2 of this document. If the server advertises the "SASL" argument, then it MUST also advertise the "SASL" capa- bility in response to the "LIST EXTENSIONS" command. The SASL capability is followed by a space-separated list of SASL mechanism names. The server may list the AUTHINFO capability with no arguments, which indicates that it complies with this draft and does not per- mit any authentication commands in its current state. In this case, the client MUST NOT attempt to utilize any AUTHINFO commands, even if it contains logic to do so (e.g. for backward compatibility with servers that are not compliant with this draft). Future extensions may add additional arguments to this capability. Example: [C] LIST EXTENSIONS [S] 202 Extensions supported: [S] STARTTLS [S] AUTHINFO SASL [S] SASL DIGEST-MD5 GSSAPI Vinocur, et. al. Expires October 2004 [Page 3] Internet Draft NNTP Authentication April 2004 [S] . [C] STARTTLS [S] 382 Continue with TLS negotiation [TLS negotiation proceeds, further commands protected by TLS layer] [C] LIST EXTENSIONS [S] 202 Extensions supported: [S] AUTHINFO USER SASL [S] SASL DIGEST-MD5 GSSAPI PLAIN EXTERNAL [S] . The AUTHINFO extension is used to authenticate a user. Note that authorization is a matter of site policy, not network protocol, and is therefore not discussed in this document. The server determines authorization in whatever manner is defined by its implementation as configured by the site administrator. An NNTP server MAY respond to any client command other than HELP, LIST EXTENSIONS, AUTHINFO, or QUIT with a 480 response. This indi- cates the client MUST authenticate in order to use that command or access the indicated resource. A client SHOULD issue the LIST EXTENSIONS command to obtain the available authentication com- mands/mechanisms before attempting authentication. A client MAY attempt the first step of authentication at any time during a session to acquire additional privileges without receiving a 480 response (this is a change to the previous specification in [NNTP-COMMON]). The client MUST NOT under any circumstances con- tinue with any steps of authentication beyond the first, unless the response code from the server indicates that the authentication exchange is welcomed. In particular, anything other than a 3xx response code indicates that the client MUST stop the authentica- tion exchange. Servers are not required to accept unsolicited authentication information from the client, therefore clients MUST accommodate servers that reject such authentication information. Additionally, servers may accept authentication information and yet still deny access to some or all resources; the permanent 502 response indi- cates a resource is unavailable even though authentication has been performed (this is in contrast to the temporary 480 error indicat- ing that a resource is unavailable now but may become available after authentication). After a successful authentication, the client may retry the origi- nal command (if any) to which the server responded with the 480 response, or continue with some other command (for example, the client may wish to re-fetch the list of newsgroups). Vinocur, et. al. Expires October 2004 [Page 4] Internet Draft NNTP Authentication April 2004 If a client attempts to reauthenticate, the server may permit the attempt, or may return 502 response indicating that the new authen- tication data is rejected by the server. Note that a successful AUTHINFO command may cause the output of the LIST EXTENSIONS command to change. Any successful authentication MAY result in the server listing different arguments (perhaps list- ing zero arguments) for AUTHINFO, but MUST NOT result in the AUTHINFO capability being removed entirely from LIST EXTENSIONS (as this might falsely indicate to clients that they were dealing with a non-compliant server). Additionally, after a successful AUTHINFO SASL, the SASL capability MUST continue to be advertised as described in section 2.2.2. 2.1. AUTHINFO USER/PASS This section supersedes the definition of the AUTHINFO USER and AUTHINFO PASS commands as documented in Section 3.1.1 of [NNTP-COM- MON]. This command MUST NOT be pipelined. 2.1.1. Usage Syntax AUTHINFO USER username AUTHINFO PASS password Responses 281 Authentication accepted 381 More authentication information required 482 Authentication commands issued out of sequence 501 Command not supported or command syntax error 502 No permission 503 Program error, function not performed Parameters username = UTF-8 string identifying the user/client password = UTF-8 string representing the user's password 2.1.2. Description The AUTHINFO USER command is used to identify a specific entity to the server using a simple username. Once sent, the server will cache the username and may send a 381 response requesting the pass- word associated with that username. Alternatively, the server may immediately return a 281 response indicating that no password is required. Should the server request a password using the 381 Vinocur, et. al. Expires October 2004 [Page 5] Internet Draft NNTP Authentication April 2004 response, the client will send AUTHINFO PASS followed by a password and the server will follow an appropriate site-specific authentica- tion service to see if the username/password combination is valid. The server will return a 281 response if the combination is valid, and a 502 response if the combination is not valid. Following a 502 response, the server MAY close the connection imme- diately (or after a short delay); it also MAY accept further com- mands from the client (with appropriate measures to limit brute- force password guessing attacks). The server may issue the 502 response immediately after AUTHINFO USER, for example to indicate that the username specified is invalid (this behavior is not required, as it may not be possible with some authentication ser- vices, and also because it exposes information about which user- names are valid). The AUTHINFO PASS command permits the client to use a clear-text password to authenticate. A compliant implementation MUST NOT implement this mechanism without also implementing support for TLS [NNTP-TLS] or the DIGEST-MD5 SASL [DIGEST-MD5] authentication mech- anism. Use of this mechanism without an active strong encryption layer is deprecated as it exposes the user's password to all par- ties on the network between the client and the server. Any imple- mentation of this mechanism SHOULD be configurable to disable it unless a strong encryption layer such as that provided by [NNTP- TLS] is active, and this configuration SHOULD be the default. The server will use the 483 response code to indicate that the datas- tream is insufficiently secure for the command being attempted. The 482 response may be returned when the AUTHINFO USER/PASS com- mands are not entered in the correct sequence (e.g. two consecutive AUTHINFO USER, or AUTHINFO PASS preceding AUTHINFO USER). A client SHOULD NOT issue unrelated commands (e.g. HELP or commands related to reading articles) in the middle of AUTHINFO USER/PASS commands, however a server MAY handle such commands if it wishes. Usernames and passwords use the UTF-8 [UTF-8] character set. Servers SHOULD validate that correct UTF-8 syntax is used. (An option to disable this facility is appropriate to support legacy authentication databases). Clients which permit non-US-ASCII input MUST convert any localized character set to UTF-8 by default. Note that usernames and passwords containing whitespace are quite likely not to work as desired, due to the command argument syntax [NNTP]. (A client may wish to scan the username and password for whitespace, and if detected, warn the user of the likelihood of problems.) The SASL PLAIN [PLAIN] mechanism is recommended as an alternative, as it is more robust with regard to character set. Vinocur, et. al. Expires October 2004 [Page 6] Internet Draft NNTP Authentication April 2004 2.1.3. Examples Example of successful AUTHINFO USER: [C] AUTHINFO USER wilma [S] 281 Authentication accepted Example of successful AUTHINFO USER/PASS: [C] AUTHINFO USER fred [S] 381 Enter passphrase [C] AUTHINFO PASS flintstone [S] 281 Authentication accepted Example of AUTHINFO USER/PASS requiring a security layer: [C] AUTHINFO USER fred@stonecanyon.example [S] 483 Encryption or stronger authentication required Example of failed AUTHINFO USER/PASS: [C] AUTHINFO USER barney [S] 381 Enter passphrase [C] AUTHINFO PASS flintstone [S] 502 Permission denied 2.2. AUTHINFO SASL 2.2.1. Usage This command MUST NOT be pipelined. Syntax AUTHINFO SASL mechanism [initial-response] Responses 281 Authentication accepted 283 base64-final-server-challenge-data 383 base64-server-challenge-data 483 Encryption or stronger authentication required 501 Command not supported or command syntax error 502 No permission 503 Program error, function not performed Parameters mechanism = String identifying a [SASL] authentication mechanism initial-response = Optional initial client response. If present, the response MUST be encoded as specified in Section 3 Vinocur, et. al. Expires October 2004 [Page 7] Internet Draft NNTP Authentication April 2004 of [BASE64]. 2.2.2. Description This section deprecates the definition of the AUTHINFO GENERIC com- mand as documented in Section 3.1.3 of [NNTP-COMMON]. The AUTHINFO SASL 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 AUTHINFO SASL 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 pro- tocol interactions during this session. If the requested authenti- cation mechanism is invalid (e.g. is not supported), the server rejects the AUTHINFO SASL command with a 503 reply. If the requested authentication mechanism requires an encryption layer, the server rejects the AUTHINFO SASL command with a 483 reply. The SASL authentication exchange consists of a series of server challenges and client responses that are specific to the chosen [SASL] mechanism. This exchange is similar to the [NNTP] POST com- mand, in which the client issues the POST command; if the server wishes to continue, it sends a "challenge" response code (with optional message-id "data") instructing the client to send the article; the client "responds" by sending the article; and then the server returns another response code indicating success or failure. In the case of the SASL authentication exchange, there may be zero or more iterations of the server "challenge" and client "response". A server challenge is sent as a 383 reply with the text part con- taining the [BASE64] encoded string supplied by the SASL mechanism. This challenge MUST NOT contain any text other than the BASE64 encoded challenge. A client response consists of a line containing a [BASE64] encoded string. 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 AUTHINFO SASL command by sending a 501 reply. The optional initial response argument to the AUTHINFO SASL 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 NNTP, a server challenge that contains no data is defined as a 383 reply with no text part. Note that there is still Vinocur, et. al. Expires October 2004 [Page 8] Internet Draft NNTP Authentication April 2004 a space following the reply code, so the complete response line is "383 ". Note that the AUTHINFO SASL command is still subject to the line length limitations defined in [NNTP]. If use of the initial response argument would cause the AUTHINFO SASL command to exceed this length, the client MUST NOT use the initial response parameter (and instead proceed as defined in section 5.1 of [SASL]). If the client is transmitting an initial response of zero length, it MUST instead 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 AUTHINFO SASL command with a SASL mechanism that does not support an initial client send, the server MUST reject the AUTHINFO SASL command with a 501 reply. If the server cannot [BASE64] decode any client response, it MUST reject the AUTHINFO SASL command with a 501 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 explic- itly 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 can be much longer than normal NNTP commands. Clients and servers MUST be able to handle the max- imum encoded size of challenges and responses generated by their supported authentication mechanisms. This requirement is indepen- dent of any line length limitations the client or server may have in other parts of its protocol implementation. The authorization identity generated by this [SASL] exchange is a simple username, and both client and server MUST use the [SASLprep] profile of the [StringPrep] algorithm to prepare these names for transmission or comparison. If preparation of the authorization identity fails or results in an empty string (unless it was trans- mitted as the empty string), the server MUST fail the authentica- tion. If the server is unable to authenticate the client, it SHOULD reject the AUTHINFO SASL command with a 502 reply. Should the client successfully complete the exchange, the server issues either a 283 or 281 reply. Vinocur, et. al. Expires October 2004 [Page 9] Internet Draft NNTP Authentication April 2004 If the the SASL mechanism returns additional data on success (e.g. server authentication), the NNTP server issues a 283 reply with the text part containing the [BASE64] encoded string supplied by the SASL mechanism. This reply MUST NOT contain any text other than the BASE64 encoded data. If no additional data is returned on suc- cess, the server issues a 281 reply. 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 the CRLF of its success reply. When a security layer takes effect, the server MUST discard any knowledge obtained from the client that was not obtained from the SASL negotiation itself. Likewise, the client MUST discard any knowledge obtained from the server, such as the list of NNTP exten- sions, that was not obtained from the SASL negotiation itself (Note that a client MAY compare the advertised SASL mechanisms before and after authentication in order to detect an active down-negotiation attack). The client SHOULD therefore send an LIST EXTENSIONS command as the first command after a successful SASL negotiation which results in the enabling of a security layer. After a security layer is established, the server MUST still adver- tise the SASL capability (with the same arguments as previously), MUST still advertise the AUTHINFO capability (perhaps with zero arguments), SHOULD NOT advertise SASL as an argument to the AUTHINFO capability, and SHOULD NOT advertise the STARTTLS [NNTP- TLS] capability. 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 "news". If an AUTHINFO command fails, the client MAY proceed without authentication, Alternatively, the client MAY try another authenti- cation mechanism or present different credentials by issuing another AUTHINFO command. To ensure interoperability, client and server implementations of this extension MUST implement the [DIGEST-MD5] SASL mechanism. Vinocur, et. al. Expires October 2004 [Page 10] Internet Draft NNTP Authentication April 2004 If AUTHINFO USER/PASS and AUTHINFO SASL are both implemented, the SASL [PLAIN] mechanism SHOULD also be implemented, as the function- ality of DIGEST-MD5 is insufficient for some environments (e.g. the server may need to pass the raw password off to an external authen- tication service). The SASL PLAIN mechanism is preferred over AUTHINFO USER, even if there is not a strong encryption layer active, because it eliminates limitations that AUTHINFO USER/PASS has on the character set used for usernames and passwords. 2.2.3. Examples The following example shows the client using the [PLAIN] SASL mech- anism under a TLS layer, and making use of the initial client response. Example: [C] LIST EXTENSIONS [S] 202 Extensions supported: [S] STARTTLS [S] AUTHINFO SASL [S] SASL DIGEST-MD5 GSSAPI [S] . [C] STARTTLS [S] 382 Continue with TLS negotiation [TLS negotiation proceeds, further commands protected by TLS layer] [C] LIST EXTENSIONS [S] 202 Extensions supported: [S] AUTHINFO USER SASL [S] SASL DIGEST-MD5 GSSAPI PLAIN EXTERNAL [S] . [C] AUTHINFO SASL PLAIN AHRlc3QAMTIzNA== [S] 281 Authentication accepted The following example shows the client using the EXTERNAL SASL mechanism under TLS using the derived authorization ID (and thus a zero-length initial client send). (Commands prior to AUTHINFO SASL are the same as the previous example and have be omitted). Example [C] AUTHINFO SASL EXTERNAL = [S] 281 Authentication accepted The following example shows the client using the [DIGEST-MD5] SASL mechanism which does not include an initial client response (except in the case of fast-reauth), but does include a server challenge and server success data. (Whitespace has been inserted for clar- ity; base64-encoded data is sent as a single line with no embedded whitespace.) Vinocur, et. al. Expires October 2004 [Page 11] Internet Draft NNTP Authentication April 2004 Example: [C] AUTHINFO SASL DIGEST-MD5 [S] 383 bm9uY2U9IlBKUE9GczJKa05VYWhraDNjRmVUN2dZZjFKY0VJakVCSHRK NzFycmNDMTg9IixyZWFsbT0iZWFnbGUub2NlYW5hLmNvbSIscW9wPSJhdXRo IixtYXhidWY9NDA5NixjaGFyc2V0PXV0Zi04LGFsZ29yaXRobT1tZDUtc2Vz cw== [C] dXNlcm5hbWU9InRlc3QiLHJlYWxtPSJlYWdsZS5vY2VhbmEuY29tIixub25j ZT0iUEpQT0ZzMkprTlVhaGtoM2NGZVQ3Z1lmMUpjRUlqRUJIdEo3MXJyY0Mx OD0iLGNub25jZT0iUmVkV2VqM3JNdFY5U09XSE5BNUVtZFNmVWRFajNCMlpL YTNIeFlHbzJCWT0iLG5jPTAwMDAwMDAxLHFvcD1hdXRoLG1heGJ1Zj0xMDI0 LGRpZ2VzdC11cmk9Im5ld3MvbG9jYWxob3N0IixyZXNwb25zZT0zOTg2NWIy NTk0Nzk4ZjY4ZmY5ZWEwNDg1NGE2NGQ1ZQ== [S] 283 cnNwYXV0aD0xYzc0NjdmMTY0OTQ3NmM4ZDJjNzM5ZTY4MjgwMzE2OA== In the following example, the client is rejected due to bad [GSS- API] credentials. Note that while the mechanism can utilize the initial response, the client does not send it because of the limi- tation on command lengths. (Whitespace has been inserted for clar- ity; base64-encoded data is sent as a single line with no embedded whitespace.) Example: [C] AUTHINFO SASL GSSAPI [S] 383 [C] YIICOAYJKoZIhvcSAQICAQBuggInMIICI6ADAgEFoQMCAQ6iBwMFACAAAACj ggE/YYIBOzCCATegAwIBBaEYGxZURVNULk5FVC5JU0MuVVBFTk4uRURVoiQw IqADAgEDoRswGRsEbmV3cxsRbmV0bmV3cy51cGVubi5lZHWjge8wgeygAwIB EKEDAgECooHfBIHcSQfLKC8vm2i17EXmomwk6hHvjBY/BnKnvvDTrbno3198 vlX2RSUt+CjuAKhcDcj4DW0gvZEqH7t5v9yWedzztlpaThebBat6hQNr9NJP ozh1/+74HUwhGWb50KtjuftO/ftQ8q0nTuYKgIq6PM4tp2ddo1IfpjfdNR9E 95GFi3y1uBT7lQOwtQbRJUjPSO3ijdue9V7cNNVmYsBsqNsaHhvlBJEXf4WJ djH8yG+Dw/gX8fUTtC5fDpB5zLt01mkSXh6Wc4UhqQtwZBI2t/+TpX1okbg6 Hr1ZZupeH6SByjCBx6ADAgEQooG/BIG8GnCmcXWtqhXh48dGTLHQgJ04K5Fj RMMq2qPSbiha9lq0osqR2KAnQA6LioWYxU+6yPKpBDSC5WOT441fUfkM8iAL kW3uNc+luFCGcnDsacrmoVU7Y6Akcp9m7Fm7orRc+TWSWPpBg3OR2oG3ATW0 0NAz8TT06VOLVxIMUTINKdYVI/Ja7f3sy+/N4LGkJqScCQOwlo5tfDWn/UQF iTWo5Zw435rH8pjy2smQCnqC14v3NMAWTu4j+dzHUNw= [S] 502 Authentication error The following example shows the client aborting in the midst of an exchange. Example: [C] AUTHINFO SASL GSSAPI [S] 383 [C] * [S] 501 Sequence successfully aborted Vinocur, et. al. Expires October 2004 [Page 12] Internet Draft NNTP Authentication April 2004 The following example shows the client attempting an exchange using a mechanism that is not supported by the server. Example: [C] AUTHINFO SASL EXAMPLE [S] 501 Mechanism not recognized The following example shows the client attempting an exchange using a mechanism that is not permitted by the server on an unencrypted connection. Example: [C] AUTHINFO SASL PLAIN [S] 483 Encryption or stronger authentication required 2.3. AUTHINFO Formal Syntax This amends the formal syntax for NNTP [NNTP] to add these addi- tional commands. The syntax is defined using ABNF [ABNF]. authinfo-capability = "AUTHINFO" *(SP authinfo-capability-arg) CRLF authinfo-capability-arg = "USER" / "SASL" sasl-capability = "SASL" 1*(SP sasl-mech) CRLF command /= authinfo-user-command / authinfo-pass-command / authinfo-sasl-command ; command is defined in [NNTP] authinfo-user-command = "AUTHINFO" 1*WSP "USER" 1*WSP username *WSP CRLF ; XXX problem here, username is UTF8-SAFE which ; I think includes whitespace, doesn't it? authinfo-pass-command = "AUTHINFO" 1*WSP "PASS" 1*WSP password *WSP CRLF authinfo-sasl-command = "AUTHINFO" 1*WSP "SASL" 1*WSP sasl-mech [1*WSP (base64 / "=") *WSP] *(CRLF [client-sasl-resp]) CRLF ; client waits for server response after each CRLF client-sasl-resp = "*" / base64 server-sasl-chal = ("383" / "283") SP [base64] CRLF sasl-mech = 1*20mech-char mech-char = %x41-5A / DIGIT / "-" / "_" ; mech names restricted to uppercase letters, ; digits, "-" and "_" username = 1*UTF8-SAFE password = 1*UTF8-SAFE UTF8-SAFE = %x01-09 / %x0B-0C / %x0E-7F / UTF8-non-ascii ; UTF8-non-ascii defined in [NNTP] Vinocur, et. al. Expires October 2004 [Page 13] Internet Draft NNTP Authentication April 2004 base64 = *(4base64-char) [base64-terminal] base64-char = ALPHA / DIGIT / "+" / "/" ; case sensitive base64-terminal = (2base64-char "==") / (3base64-char "=") 3. Authentication Tracking/Logging This section contains implementation suggestions and notes of best current practice, and does not specify further network protocol requirements. When authentication succeeds, the server will create an "identity" (the syntax resembles that of an email address) for the client using a technique such as the following (note that when using SASL, "username" corresponds to the authorization identity), for example: (1) Lookup the supplied username in an implementation-specific database or directory to determine the primary email address for that user. (2) Use the username directly as the email address if it is fully qualified (i.e., includes "@hostname"), otherwise append a con- figured "default domain" based on the IP address the client connected to. (3) Use the username followed by "@" and then the result of a reverse DNS lookup on the client's IP address. If the reverse lookup fails, the domain literal syntax defined in SMTP [SMTP] is appropriate. Once authenticated, the server SHOULD be configurable to generate an audit trail associating the authentication identity with any articles supplied during a POST operation, and this configuration SHOULD be the default. This may be accomplished, for example, by inserting headers in the posted articles, or by a server logging mechanism. The server MAY provide a facility for disabling the procedure described above, as some users or administrators may con- sider it a violation of privacy. 4. Security Considerations Security issues are discussed throughout this memo. Before the [SASL] negotiation has begun, any protocol interactions may have been performed in the clear and may have be modified by an active attacker. For this reason, clients and servers MUST discard any knowledge obtained prior to the start of the SASL negotiation upon the establishment of a security layer. Vinocur, et. al. Expires October 2004 [Page 14] Internet Draft NNTP Authentication April 2004 Servers MAY implement a policy whereby the connection is dropped after a number of failed authentication attempts. If they do so, they SHOULD NOT drop the connection until at least 3 attempts at authentication have failed. Implementations MUST support a configuration where authentication mechanisms that are vulnerable to passive eavesdropping attacks (such as AUTHINFO USER/PASS and SASL [PLAIN]) are not advertised or used without the presence of an external security layer such as TLS [NNTP-TLS]. When multiple authentication mechanisms are permitted by both client and server, an active attacker can cause a down-negotiation to the weakest mechanism. For this reason, both clients and servers SHOULD be configurable to forbid use of weaker mechanisms. 5. IANA Considerations 5.1. IANA Considerations for SASL/GSSAPI services Please register the SASL/GSSAPI service name "news". This service name refers to authenticated use of Usenet news service, usually provided via the [NNTP] protocol. 5.2. IANA Considerations for NNTP extensions Below is a formal definition of the AUTHINFO extension as required by Section 8 of [NNTP] for the IANA registry. o The AUTHINFO extension provides an extensible mechanism for NNTP authentication via a variety of methods. o The extension-label is "AUTHINFO". This extension defines two capabilities that may be advertised via LIST EXTENSIONS, "AUTHINFO" and "SASL". o The new capabilities have a variable number of arguments, as defined in Section 2. o The extension defines three new commands, AUTHINFO USER, AUTHINFO PASS, and AUTHINFO SASL, whose behavior, arguments, and responses are defined in Section 2. o The extension does not associate any new responses with pre- existing NNTP commands. o The extension may affect the overall behavior of both server and client, in that the AUTHINFO SASL command requires that Vinocur, et. al. Expires October 2004 [Page 15] Internet Draft NNTP Authentication April 2004 subsequent communication to be transmitted via a intermediary security layer. o The extension does not affect the maximum length of commands and initial response lines. XXX: is this what we agreed on? o The extension does not alter pipelining, but AUTHINFO commands cannot be pipelined. o Use of this extension may alter the output from LIST EXTENSIONS. Once any AUTHINFO command has been used successfully, the server may alter the list of arguments for the AUTHINFO capability (although the capability itself must still be listed, even with zero arguments). However, if the server originally advertised the SASL capability, it should continue to do so (with the same argument list), because the client may wish to compare the pre- and post-authentication list of SASL mechanisms in order to detect active down-negotiation attacks. o The extension does not cause any pre-existing command to produce a 401, 480, or 483 response. o The AUTHINFO commands can be used before or after the MODE READER command, with the same semantics. 6. Normative References [ABNF] Crocker, D., Overell, P., "Augmented BNF for Syntax Specifications: ABNF", RFC 2234, November 1997. [AUTH] Haller, N., Atkinson, R., "On Internet Authentication", RFC 1704, Bell Communications Research, October 1994. [BASE64] Josefsson, S., "The Base16, Base32, and Base64 Data Encodings", RFC 3548, July 2003. [DIGEST-MD5] Leach, P., Newman, C., "Using Digest Authentication as a SASL Mechanism", RFC 2831, May 2000. [KEYWORDS] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", RFC 2119, Harvard University, March 1997. [NNTP] Feather, C., "Network News Transport Protocol", draft-ietf-nntpext-base-*.txt, Work in Progress. Vinocur, et. al. Expires October 2004 [Page 16] Internet Draft NNTP Authentication April 2004 [NNTP-TLS] Vinocur, J., "Using TLS with NNTP", draft-ietf-nntpext-tls-nntp-*.txt, Work in Progress. [SASL] Melnikov, A., "Simple Authentication and Security Layer (SASL)", draft-ietf-sasl-rfc2222bis-*.txt, Work in Progress. [SASLprep] Zeilega, K., "SASLprep: Stringprep profile for user names and passwords", draft-ietf-sasl-saslprep-*.txt, Work in Progress. [StringPrep] Hoffman, P. and Blanchet, M., "Preparation of Internationalized Strings ("stringprep")", draft-hoffman-rfc3454bis-*.txt, Work in Progress. [UTF-8] Yergeau, F. "UTF-8, a transformation format of ISO 10646", RFC 2279, Alis Technologies, January 1998. 7. Informative References [GSSAPI] Melnikov, A., "SASL GSSAPI Mechanisms", draft-ietf-sasl- gssapi-*.txt, Work in Progress. [NNTP-COMMON] Barber, S., "Common NNTP Extensions", RFC 2980, Aca- dem Consulting Services, October 2000. [PLAIN] Zeilenga, K., "The Plain SASL Mechanism", draft-ietf-sasl- plain-*.txt, Work in Progress. [SMTP] Klensin, J., "Simple Mail Transport Protocol", RFC 2821, AT&T Laboratories, April 2001. 8. Authors' Addresses Jeffrey M. Vinocur Department of Computer Science Upson Hall Cornell University Ithaca, NY 14853 USA Email: vinocur@cs.cornell.edu Chris Newman Sun Microsystems 1050 Lakes Drive, Suite 250 West Covina, CA 91790 USA Email: cnewman@iplanet.com Vinocur, et. al. Expires October 2004 [Page 17] Internet Draft NNTP Authentication April 2004 Kenneth Murchison Oceana Matrix Ltd. 21 Princeton Place Orchard Park, NY 14127 USA Email: ken@oceana.com 9. Acknowledgments A significant amount of the authentication text was originally from the NNTP revision or common authentication specs written by Stan Barber. A significant amount of the SASL text was lifted from the revisions to RFC 1734 and RFC 2554 by Rob Siemborski. Special acknowledgment also goes to the people who commented pri- vately on intermediate revisions of this document, as well as the members of the IETF NNTP Working Group for continual (yet sporadic) insight in discussion. 10. Intellectual Property Rights The IETF takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to per- tain 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 pro- prietary 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 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 Execu- tive Director. 11. Copyright Copyright (C) The Internet Society (2004). All Rights Reserved. This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, Vinocur, et. al. Expires October 2004 [Page 18] Internet Draft NNTP Authentication April 2004 published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the proce- dures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English. The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns. This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGI- NEERING TASK FORCE DISCLAIMS 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 WAR- RANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Vinocur, et. al. Expires October 2004 [Page 19]