Network Working Group                                         J. Vinocur
Internet Draft                                        Cornell University
Document: draft-ietf-nntpext-authinfo-04.txt                   C. Newman
                                                        Sun Microsystems
                                                            K. Murchison
                                                      Oceana Matrix Ltd.
                                                          September 2004


                   NNTP Extension for Authentication


Status of this memo

     By submitting this Internet-Draft, I certify that any applicable
     patent or other IPR claims of which I am aware have been disclosed,
     and any of which I become aware will be disclosed, in accordance
     with RFC 3668.

     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 an NNTP 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 the
     remainder of an NNTP session.





Vinocur, et. al.           Expires March 2005                   [Page 1]


Internet Draft             NNTP Authentication            September 2004


Table of Contents

     1. Introduction .............................................  2
        1.1. Conventions Used in this Document ...................  3
     2. The AUTHINFO Extension ...................................  3
        2.1. Advertising the AUTHINFO Extension ..................  3
        2.2. Authenticating with the AUTHINFO Extension ..........  4
        2.3. AUTHINFO USER/PASS Command ..........................  6
           2.3.1. Usage ..........................................  6
           2.3.2. Description ....................................  6
           2.3.3. Examples .......................................  7
        2.4. AUTHINFO SASL Command ...............................  8
           2.4.1. Usage ..........................................  8
           2.4.2. Description ....................................  9
           2.4.3. Examples ....................................... 12
     3. Augmented BNF Syntax for the AUTHINFO Extension .......... 14
        3.1. Commands ............................................ 14
        3.2. Command Continuation ................................ 14
        3.3. Responses ........................................... 15
        3.4. LIST EXTENSIONS responses ........................... 15
        3.5. General non-terminals ............................... 15
     4. Summary of Response Codes ................................ 15
     5. Authentication Tracking/Logging .......................... 16
     6. Security Considerations .................................. 16
     7. IANA Considerations ...................................... 17
        7.1. IANA Considerations for SASL/GSSAPI services ........ 17
        7.2. IANA Considerations for NNTP extensions ............. 17
     8. References ............................................... 18
        8.1. Normative References ................................ 18
        8.2. Informative References .............................. 19
     9. Authors' Addresses ....................................... 19
     10. Acknowledgments ......................................... 20
     11. Intellectual Property Rights ............................ 20
     12. Copyright ............................................... 21

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 to 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 security layers.




Vinocur, et. al.           Expires March 2005                   [Page 2]


Internet Draft             NNTP Authentication            September 2004


     The ad-hoc AUTHINFO GENERIC command, also documented in [NNTP-
     COMMON] but much less ubiquitous, 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
     developed for other SASL-enabled application protocols including
     SMTP, POP, IMAP, LDAP, and BEEP.

     This specification is to be read in conjunction with the NNTP base
     specification [NNTP]. Except where specifically stated otherwise,
     in the case of a conflict between these two documents [NNTP] takes
     precedence over this one.

     It is also recommended that this specification be read in
     conjunction with the SASL base specification [SASL].

1.1. Conventions Used in this Document

     The notational conventions used in this document are the same as
     those in [NNTP] and any term not defined in this document has the
     same meaning as in that one.

     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
     Authentication" [AUTH].

     In the examples, commands from the client are indicated with [C],
     and responses from the server are indicated with [S].

2. The AUTHINFO Extension

     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.

     This extension provides three new commands: AUTHINFO USER, AUTHINFO
     PASS, and AUTHINFO SASL.  The label for this extension is AUTHINFO.

2.1. Advertising the AUTHINFO Extension

     A server MUST implement at least one of the AUTHINFO USER or
     AUTHINFO SASL commands in order to advertise the AUTHINFO extension



Vinocur, et. al.           Expires March 2005                   [Page 3]


Internet Draft             NNTP Authentication            September 2004


     label in the response to the LIST EXTENSIONS command.  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.3 of this document.  The "USER" argument
     MUST NOT be advertised, and the AUTHINFO USER/PASS commands SHOULD
     NOT be provided, 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.4 of this document.  The "SASL:" argument is
     followed immediately (no intervening whitespace) by a comma-
     separated list of available SASL mechanism names, and the colon
     (":") is always included even if no mechanisms are available.

     The server may list the AUTHINFO capability with no arguments,
     which indicates that it complies with this draft and does not
     permit 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 specification).

     Future extensions may add additional arguments to this capability.
     Unrecognized arguments SHOULD be ignored or brought to the
     attention of the user.

     Example:
        [C] LIST EXTENSIONS
        [S] 202 Extensions supported:
        [S] STARTTLS
        [S] AUTHINFO SASL:CRAM-MD5,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:CRAM-MD5,DIGEST-MD5,GSSAPI,PLAIN,EXTERNAL
        [S] .

2.2. Authenticating with the AUTHINFO Extension

     When an NNTP server responds to a client command with a 480
     response, this indicates the client MUST authenticate and/or
     authorize in order to use that command or access the indicated
     resource.  Use of the AUTHINFO command as described below is one
     such way that a client can authenticate/authorize to the server.  A



Vinocur, et. al.           Expires March 2005                   [Page 4]


Internet Draft             NNTP Authentication            September 2004


     client intending to use AUTHINFO may issue the LIST EXTENSIONS
     command to obtain the available authentication commands and
     mechanisms before attempting authentication.

     A client MAY attempt the first step of authentication at any time
     during a session to acquire additional privileges without having
     received a 480 response.  The client MUST NOT under any
     circumstances continue 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 38x response code indicates that the client MUST NOT
     continue the authentication 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
     indicates a resource is unavailable even though authentication has
     been performed (this is in contrast to the temporary 480 error
     indicating that a resource is unavailable now but may become
     available after authentication).

     After a successful authentication, the client may retry the
     original command (if any) to which the server replied with the 480
     response, or continue with some other command (for example, the
     client may wish to re-fetch the list of newsgroups).

     A server MUST NOT under any circumstances reply to an AUTHINFO
     command with a 480 response.

     After an AUTHINFO command has been successfully completed, no more
     AUTHINFO commands may be issued in the same session and a server
     MUST reject any further AUTHINFO commands with a 502 response.

     In agreement with [SASL], after a security layer is established the
     server MUST continue to advertise the AUTHINFO capability and
     "SASL:" argument with the same mechanism list as before
     authentication.

     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
     listing 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



Vinocur, et. al.           Expires March 2005                   [Page 5]


Internet Draft             NNTP Authentication            September 2004


     described in section 2.4.2.

2.3. AUTHINFO USER/PASS Command

     This section supersedes the definition of the AUTHINFO USER and
     AUTHINFO PASS commands as documented in Section 3.1.1 of [NNTP-
     COMMON].

     These commands MUST NOT be pipelined.

2.3.1. Usage

     Syntax
        AUTHINFO USER username
        AUTHINFO PASS password

     Responses
        281 Authentication accepted
        381 Password required [1]
        481 Authentication failed/rejected
        482 Authentication commands issued out of sequence

     [1] Only valid for AUTHINFO USER.  Note that unlike traditional 3xx
     codes which indicate that the client may continue the current
     command, the legacy 381 code means that the AUTHINFO PASS command
     must be used to complete the authentication exchange.

     Parameters
        username = UTF-8 string identifying the user/client
        password = UTF-8 string representing the user's password

2.3.2. Description

     The AUTHINFO USER and AUTHINFO PASS commands are used to present
     clear text credentials to the server. These credentials consist of
     a username or a username plus a password (the distinction is that a
     password is expected to be kept secret while a username is not;
     this does not directly affect the protocol but may have an impact
     on user interfaces).  The username is supplied through the AUTHINFO
     USER command and the password through the AUTHINFO PASS command.

     If the server requires only a username, it MUST NOT give a 381
     response to AUTHINFO USER and MUST give a 482 response to AUTHINFO
     PASS.

     If the server requires both username and password, the former MUST
     be sent before the latter. The server will need to cache the
     username until the password is received; it MAY require the



Vinocur, et. al.           Expires March 2005                   [Page 6]


Internet Draft             NNTP Authentication            September 2004


     password to be sent in the immediately next command (in other
     words, only caching the username until the next command is sent).
     The server:

        - MUST return a 381 response to AUTHINFO USER;
        - MUST return a 482 response to AUTHINFO PASS if there is no cached
          username;
        - MUST use the argument of the most recent AUTHINFO USER for
          authentication;
        - MUST NOT return a 381 response to AUTHINFO PASS.

     The server MAY determine whether or not a password is needed based
     on the username. Thus the same server can respond with both 381 and
     other response codes to AUTHINFO USER.

     The AUTHINFO PASS command permits the client to use a clear-text
     password to authenticate.  A conformant implementation MUST NOT
     implement this mechanism without also implementing support for TLS
     [NNTP-TLS].  Use of this mechanism without an active strong
     encryption layer is deprecated as it exposes the user's password to
     all parties on the network between the client and the server.  Any
     implementation 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
     datastream is insufficiently secure for the command being
     attempted.

     Usernames and passwords MUST use the UTF-8 [UTF-8] character set
     and a client MUST convert any user input to UTF-8 if necessary.

     Note that a server MAY, but is not required to, allow white space
     characters in usernames and passwords.  A server implementation MAY
     blindly split command arguments at white space and therefore not
     preserve the exact sequence of white space characters in the
     username or password.  Therefore a client SHOULD 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 does not suffer from these
     issues.

2.3.3. Examples

     Example of successful AUTHINFO USER:

        [C] AUTHINFO USER wilma
        [S] 281 Authentication accepted




Vinocur, et. al.           Expires March 2005                   [Page 7]


Internet Draft             NNTP Authentication            September 2004


     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] 481 Authentication failed

     Example of AUTHINFO PASS before AUTHINFO USER:

        [C] AUTHINFO PASS flintstone
        [S] 482 Authentication commands issued out of sequence

2.4. AUTHINFO SASL Command

     This section defines a formal profile of the Simple Authentication
     and Security Layer [SASL].  The use of the AUTHINFO GENERIC command
     as documented in Section 3.1.3 of [NNTP-COMMON] as a way to perform
     SASL authentication is deprecated in favor of the AUTHINFO SASL
     command.  A server SHOULD NOT advertise AUTHINFO GENERIC in the
     list of capabilities returned by LIST EXTENSIONS.

     This command MUST NOT be pipelined.

2.4.1. Usage

     Syntax
        AUTHINFO SASL mechanism [initial-response]

     Responses
        281             Authentication accepted
        283 challenge   Authentication accepted (with success data) [1]
        383 challenge   Continue with SASL exchange [1]
        481             Authentication failed/rejected
        482             SASL protocol error





Vinocur, et. al.           Expires March 2005                   [Page 8]


Internet Draft             NNTP Authentication            September 2004


     [1] These responses MAY exceed 512 octets.  The maximum length of
     these responses is increased to that which can accommodate the
     largest encoded challenge possible for any of the SASL mechanisms
     supported by the implementation.

     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 of [BASE64].
        challenge         = Server challenge.  The challenge MUST be
                            encoded as specified in Section 3 of [BASE64].

2.4.2. Description

     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
     protocol interactions during this session.  If the requested
     authentication mechanism is invalid (e.g. is not supported), the
     server rejects the AUTHINFO SASL command with a 501 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.

     A server challenge is sent as a 383 reply with a single argument
     containing the [BASE64] encoded string supplied by the SASL
     mechanism.  A server challenge that has zero length MUST be sent as
     a single equals sign ("=") and not omitted (in order to comply with
     the [NNTP] requirement that responses always have the same number
     of arguments).

     A client response consists of a line containing a [BASE64] encoded
     string.  A client response that has zero length MUST be sent as a
     single equals sign ("=") and not omitted (for consistency with the
     server challenge format).  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 481 reply.

     Note that these [BASE64] strings can be much longer than normal



Vinocur, et. al.           Expires March 2005                   [Page 9]


Internet Draft             NNTP Authentication            September 2004


     NNTP responses.  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.

     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
     equivalent to a zero length challenge and is encoded as a single
     equals sign ("=").

     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 482 reply.

     If the server cannot [BASE64] decode any client response, it MUST
     reject the AUTHINFO SASL command with a 504 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).

     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
     transmitted as the empty string), the server MUST fail the
     authentication with a 481 reply.



Vinocur, et. al.           Expires March 2005                  [Page 10]


Internet Draft             NNTP Authentication            September 2004


     Should the client successfully complete the exchange, the server
     issues either a 283 or 281 reply.  If the server is unable to
     authenticate the client, it MUST reject the AUTHINFO SASL command
     with a 481 reply.  If an AUTHINFO command fails, the client MAY
     proceed without authentication.  Alternatively, the client MAY try
     another authentication mechanism or present different credentials
     by issuing another AUTHINFO command.

     If the SASL mechanism returns additional data on success (e.g.
     server authentication), the NNTP server issues a 283 reply with a
     single argument containing the [BASE64] encoded string supplied by
     the SASL mechanism.  If no additional data is returned on success,
     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
     extensions, 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.)

     When both TLS [NNTP-TLS] and SASL security layers are in effect,
     the TLS encoding MUST be applied after the SASL encoding.

     To ensure interoperability, client and server implementations of
     this extension MUST implement the [DIGEST-MD5] SASL mechanism.

     If AUTHINFO USER/PASS and AUTHINFO SASL are both implemented, the
     SASL [PLAIN] mechanism SHOULD also be implemented, as the
     functionality of DIGEST-MD5 is insufficient for some environments
     (e.g. the server may need to pass the raw password off to an
     external authentication 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 with regards to white space characters being
     used in usernames and passwords.

     The service name specified by this protocol's profile of SASL is
     "nntp".




Vinocur, et. al.           Expires March 2005                  [Page 11]


Internet Draft             NNTP Authentication            September 2004


2.4.3. Examples

     Example of the [PLAIN] SASL mechanism under a TLS layer, using an
     initial client response:

        [C] LIST EXTENSIONS
        [S] 202 Extensions supported:
        [S] STARTTLS
        [S] AUTHINFO SASL:CRAM-MD5,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:CRAM-MD5,DIGEST-MD5,GSSAPI,PLAIN,EXTERNAL
        [S] .
        [C] AUTHINFO SASL PLAIN AHRlc3QAMTIzNA==
        [S] 281 Authentication accepted

     Example of the EXTERNAL SASL mechanism under a TLS layer, using the
     derived authorization ID, and thus a zero-length initial client
     response (commands prior to AUTHINFO SASL are the same as the
     previous example and have been omitted):

        [C] AUTHINFO SASL EXTERNAL =
        [S] 281 Authentication accepted

     Example of the [DIGEST-MD5] SASL mechanism, which includes a server
     challenge and server success data (whitespace has been inserted for
     clarity; base64-encoded data is sent as a single line with no
     embedded whitespace):

        [C] AUTHINFO SASL DIGEST-MD5
        [S] 383 bm9uY2U9InNheUFPaENFS0dJZFBNSEMwd3RsZUxxT0ljT0kyd1FZSWU0
            enplQXR1aVE9IixyZWFsbT0iZWFnbGUub2NlYW5hLmNvbSIscW9wPSJhdXRo
            LGF1dGgtaW50LGF1dGgtY29uZiIsY2lwaGVyPSJyYzQtNDAscmM0LTU2LHJj
            NCxkZXMsM2RlcyIsbWF4YnVmPTQwOTYsY2hhcnNldD11dGYtOCxhbGdvcml0
            aG09bWQ1LXNlc3M=
        [C] dXNlcm5hbWU9InRlc3QiLHJlYWxtPSJlYWdsZS5vY2VhbmEuY29tIixub25j
            ZT0ic2F5QU9oQ0VLR0lkUE1IQzB3dGxlTHFPSWNPSTJ3UVlJZTR6emVBdHVp
            UT0iLGNub25jZT0iMFkzSlFWMlRnOVNjRGlwK08xU1ZDMHJoVmcvLytkbk9J
            aUd6LzdDZU5KOD0iLG5jPTAwMDAwMDAxLHFvcD1hdXRoLWNvbmYsY2lwaGVy
            PXJjNCxtYXhidWY9MTAyNCxkaWdlc3QtdXJpPSJubnRwL2xvY2FsaG9zdCIs
            cmVzcG9uc2U9ZDQzY2Y2NmNmZmE5MDNmOWViMDM1NmMwOGEzZGIwZjI=
        [S] 283 cnNwYXV0aD1kZTJlMTI3ZTVhODFjZGE1M2Q5N2FjZGEzNWNkZTgzYQ==





Vinocur, et. al.           Expires March 2005                  [Page 12]


Internet Draft             NNTP Authentication            September 2004


     Example of a failed authentication due to bad [GSSAPI] credentials.
     Note that while the mechanism can utilize the initial response, the
     client does not send it because of the limitation on command
     lengths, resulting in a zero-length server challenge (here
     whitespace has been inserted for clarity; base64-encoded data is
     sent as a single line with no embedded whitespace):

        [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] 481 Authentication error

     Example of a client aborting in the midst of an exchange:

        [C] AUTHINFO SASL GSSAPI
        [S] 383 =
        [C] *
        [S] 481 Authentication aborted as requested

     Example of attempting to use a mechanism that is not supported by
     the server:

        [C] AUTHINFO SASL EXAMPLE
        [S] 501 Mechanism not recognized

     Example of attempting to use a mechanism that requires a security
     layer:

        [C] AUTHINFO SASL PLAIN
        [S] 483 Encryption or stronger authentication required

     Example of using an initial response with a mechanism that doesn't
     support it (server must start the exchange):

        [C] AUTHINFO SASL CRAM-MD5 AHRlc3QAMTIzNA==
        [S] 482 SASL protocol error



Vinocur, et. al.           Expires March 2005                  [Page 13]


Internet Draft             NNTP Authentication            September 2004


3. Augmented BNF Syntax for the AUTHINFO Extension

     This section describes the syntax of the AUTHINFO extension.  It
     extends the syntax in [NNTP], and non-terminals not defined in this
     document are defined there.

3.1. Commands

     This syntax extends the non-terminal "command", which represents an
     NNTP command.

     command =/ authinfo-user-command /
                authinfo-pass-command /
                authinfo-sasl-command

     authinfo-user-command = "AUTHINFO" WS "USER" WS username
     authinfo-pass-command = "AUTHINFO" WS "PASS" WS password
     authinfo-sasl-command = "AUTHINFO" WS "SASL" WS mechanism
           [WS initial-response]

     username = 1*user-pass-char
     password = 1*user-pass-char
     user-pass-char = P-CHAR
     initial-response = base64-opt


     Note: A server implementation MAY parse AUTHINFO USER and AUTHINFO
     PASS specially as to allow white space to be used within the
     username or password.  Such implementations accept the additional
     syntax (making these two items inconsistent with "x-argument" in
     section 9.1 of [NNTP]):

     user-pass-char =/ SP / TAB

     In doing so, the grammar can become ambiguous if the username or
     password begins or ends with white space.  To solve this ambiguity,
     such implementations typically treat everything between the first
     white space character following "USER"/"PASS" and CRLF as the
     username/password.

3.2. Command Continuation

     This syntax extends the non-terminal "command-continuation", which
     represents the further material sent by the client in the case of
     multi-stage commands.

     command-continuation =/ authinfo-sasl-continuation
     authinfo-sasl-continuation = ("*" / base64-opt) CRLF



Vinocur, et. al.           Expires March 2005                  [Page 14]


Internet Draft             NNTP Authentication            September 2004


           ; client must send a continuation following each
           ; "383" response from the server

3.3. Responses

     This syntax extends the non-terminal "simple-response-content" for
     the various commands in this specification.

     simple-response-content =/ response-sasl-content
     response-sasl-content = "283" SP base64 / "383" SP base64-opt

3.4. LIST EXTENSIONS responses

     This syntax defines the specific LIST EXTENSIONS responses for the
     AUTHINFO extension.

     extension-descriptor =/ authinfo-extension
     authinfo-extension = %x41.55.54.48.49.4E.46.4F  ; "AUTHINFO"
           *(SPA authinfo-extension-arg)
     authinfo-extension-arg = "USER" /
           "SASL:" [mechanism *("," mechanism)]

3.5. General non-terminals

     mechanism = 1*20mech-char
     mech-char = UPPER / DIGIT / "-" / "_"

     base64-opt = "=" / base64

4. Summary of Response Codes

     This section contains a list of every new response code defined in
     this document, whether it is multi-line, which commands can
     generate it, what arguments it has, and what its meaning is.

     Response code 281
        Generated by: AUTHINFO USER, AUTHINFO PASS, AUTHINFO SASL
        Meaning: authentication accepted

     Response code 283
        Generated by: AUTHINFO SASL
        1 argument: challenge
        Meaning: authentication accepted (with success data)

     Response code 381
        Generated by: AUTHINFO USER
        Meaning: password required via AUTHINFO PASS command.  Note
        that this code is used for backwards compatibility and does



Vinocur, et. al.           Expires March 2005                  [Page 15]


Internet Draft             NNTP Authentication            September 2004


        not conform to the traditional use of 3xx codes.

     Response code 383
        Generated by: AUTHINFO SASL
        1 argument: challenge
        Meaning: continue with SASL exchange

     Response code 481
        Generated by: AUTHINFO USER, AUTHINFO PASS, AUTHINFO SASL
        Meaning: authentication failed/rejected

     Response code 482
        Generated by: AUTHINFO USER, AUTHINFO PASS, AUTHINFO SASL
        Meaning: authentication commands issued out of sequence or
        SASL protocol error

5. Authentication Tracking/Logging

     This section contains implementation suggestions and notes of best
     current practice, and does not specify further network protocol
     requirements.

     Once authenticated, the authorization identity presented in the
     AUTHINFO exchange (username when using USER/PASS) SHOULD be
     included in an audit trail associating the 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
     consider it a violation of privacy.

6. 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 been 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.

     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



Vinocur, et. al.           Expires March 2005                  [Page 16]


Internet Draft             NNTP Authentication            September 2004


     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 weak mechanisms.

7. IANA Considerations

7.1. IANA Considerations for SASL/GSSAPI services

     Please register the SASL/GSSAPI service name "nntp".  This service
     name refers to authenticated use of Usenet news service when
     provided via the [NNTP] protocol.

     o  Published Specification: This document.

     o  Author, Change Controller, and Contact for Further Information:
        Author of this document.

7.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  This extension provides an extensible mechanism for NNTP
        authentication via a variety of methods.

     o  The extension-label is "AUTHINFO".

     o  The extension-label has two possible optional arguments "USER"
        and "SASL:" (as defined in Section 2) indicating which variants
        of the AUTHINFO command are supported.

     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
        subsequent communication to be transmitted via an intermediary
        security layer.



Vinocur, et. al.           Expires March 2005                  [Page 17]


Internet Draft             NNTP Authentication            September 2004


     o  The extension does not affect the maximum length of commands or
        of initial response lines of pre-existing responses.

     o  The extension defines two new responses, 283 and 383, whose
        lengths may exceed 512 octets.  The maximum length of these
        responses is increased to that which can accommodate the largest
        encoded challenge possible for any of the SASL mechanisms
        supported by the implementation.

     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 a SASL security layer has been
        negotiated, the server SHOULD continue to advertise the "SASL:"
        argument with the same list of mechanisms, 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.

     o  Published Specification: This document.

     o  Author, Change Controller, and Contact for Further Information:
        Author of this document.

8. References

8.1. 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.





Vinocur, et. al.           Expires March 2005                  [Page 18]


Internet Draft             NNTP Authentication            September 2004


     [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.

     [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.

8.2. Informative References

     [CRAM-MD5] Nerenberg, L., "The CRAM-MD5 SASL Mechanism", draft-
     ietf-sasl-crammd5-*.txt, Work in Progress.

     [GSSAPI] Melnikov, A., "SASL GSSAPI Mechanisms", draft-ietf-sasl-
     gssapi-*.txt, Work in Progress.

     [NNTP-COMMON] Barber, S., "Common NNTP Extensions", RFC 2980,
     Academ 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.

     [UTF-8] Yergeau, F. "UTF-8, a transformation format of ISO 10646",
     RFC 3629, Alis Technologies, November 2003.

9. Authors' Addresses

     Jeffrey M. Vinocur
     Department of Computer Science
     Upson Hall
     Cornell University



Vinocur, et. al.           Expires March 2005                  [Page 19]


Internet Draft             NNTP Authentication            September 2004


     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


     Kenneth Murchison
     Oceana Matrix Ltd.
     21 Princeton Place
     Orchard Park, NY 14127 USA

     Email: ken@oceana.com

10. 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 Russ Allbery, Clive Feather,
     and others who commented privately on intermediate revisions of
     this document, as well as the members of the IETF NNTP Working
     Group for continual (yet sporadic) insight in discussion.

11. 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
     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 implementers or users of this specification
     can be obtained from the IETF Secretariat.




Vinocur, et. al.           Expires March 2005                  [Page 20]


Internet Draft             NNTP Authentication            September 2004


     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
     Executive Director.

12. Copyright

     Copyright (C) The Internet Society (2004).  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.






























Vinocur, et. al.           Expires March 2005                  [Page 21]