NNTP Extensions Working Group J. Vinocur Internet Draft Cornell University Expires: July 2005 K. Murchison Oceana Matrix Ltd. C. Newman Sun Microsystems January 2005 Using TLS with NNTP draft-ietf-nntpext-tls-nntp-04 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.html. The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html. Copyright Notice Copyright (C) The Internet Society (2005). Abstract This memo defines an extension to the Network News Transport Protocol [NNTP] to provide connection-based security (via Transport Layer Security [TLS]). The primary goal is to provide encryption for single-link confidentiality purposes, but data integrity, (optional) certificate-based peer entity authentication, and Vinocur, et. al. Expires July 2005 [Page 1] Internet Draft TLS for NNTP January 2005 (optional) data compression are also possible. Table of Contents 0. Changes from Previous Version ............................ 2 1. Introduction ............................................. 3 1.1. Conventions Used in this Document ................... 3 2. The STARTTLS Extension ................................... 3 2.1. Advertising the STARTTLS Extension .................. 4 2.2. STARTTLS Command .................................... 4 2.2.1. Usage .......................................... 4 2.2.2. Description .................................... 4 2.2.2.1. Processing After the STARTTLS Command ..... 6 2.2.2.2. Result of the STARTTLS Command ............ 7 2.2.3. Examples ....................................... 7 3. Augmented BNF Syntax for the STARTTLS Extension .......... 9 3.1. Commands ............................................ 9 3.2. Capability entries .................................. 9 4. Summary of Response Codes ................................ 9 5. Security Considerations .................................. 9 6. IANA Considerations ...................................... 11 7. References ............................................... 12 7.1. Normative References ................................ 12 7.2. Informative References .............................. 13 8. Authors' Addresses ....................................... 13 9. Acknowledgements ......................................... 13 10. Intellectual Property Rights ............................ 14 11. Copyright ............................................... 14 0. Changes from Previous Version New: o Noted that MODE READER must not be used nor advertised after TLS. Changed: o CAPABILITIES replaces LIST EXTENSIONS. o Neither 480 nor 483 are valid responses to STARTTLS. o Removed requirement that the client SHOULD send a CAPABILITIES immediately after a successful TLS. o Use common language between this draft and AUTHINFO regarding unsolicited use of the extension and resetting of server state and caching of info obtained prior to a security layer. o Capabilities are now case-insensitive. o Changed reference to IANA requirements in [NNTP] from Section 8 to Section 3.3.4. Clarified: o When TLS negotiation begins for both client and server. Vinocur, et. al. Expires July 2005 [Page 2] Internet Draft TLS for NNTP January 2005 o If the server doesn't like the results of TLS, it only sends 483 response to restricted NNTP commands (e.g. QUIT, HELP, CAPABILITIES are excluded). o The MODE READER state change does not get discarded after TLS is negotiated. Other: o Editorial nits. Outstanding issues: o Make sure we correctly reference the text in [NNTP] regarding MODE READER use after TLS. 1. Introduction Historically, unencrypted NNTP [NNTP] connections were satisfactory for most purposes. However, sending passwords unencrypted over the network is no longer appropriate, and sometimes strong encryption is desired for the entire connection. The STARTTLS extension provides a way to use the popular TLS [TLS] service with the existing NNTP protocol. The current (unstandardized) use of TLS for NNTP is most commonly on a dedicated TCP port; this practice is discouraged for the reasons documented in section 7 of "Using TLS with IMAP, POP3 and ACAP" [TLS-IMAPPOP]. Therefore, this specification formalizes and extends the STARTTLS command already in occasional use by the installed base. 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]. In the examples, commands from the client are indicated with [C], and responses from the server are indicated with [S]. 2. The STARTTLS Extension This extension provides a new STARTTLS command and has the capability label STARTTLS. Vinocur, et. al. Expires July 2005 [Page 3] Internet Draft TLS for NNTP January 2005 2.1. Advertising the STARTTLS Extension A server supporting the STARTTLS command as defined in this document will advertise the "STARTTLS" capability label in response to the CAPABILITIES command. However, this capability is not advertised after successful authentication [NNTP-AUTH], nor is it advertised once a TLS layer is active (see section 2.2.2.2). This capability MAY be advertised both before and after any use of MODE READER, with the same semantics. As the STARTTLS command is related to security, cached results of CAPABILITIES from a previous session MUST NOT be relied on, as per section 11.6 of [NNTP]. Example: [C] CAPABILITIES [S] 101 Capability list: [S] VERSION 2 [S] READER [S] IHAVE [S] STARTTLS [S] LIST ACTIVE NEWSGROUPS [S] . 2.2. STARTTLS Command 2.2.1. Usage This command MUST NOT be pipelined. Syntax STARTTLS Responses 382 Continue with TLS negotiation 502 Command unavailable [1] 580 Can not initiate TLS negotiation [1] If a TLS layer is already active, or authentication has occurred, STARTTLS is not a valid command (see section 2.2.2.2). NOTE: Notwithstanding section 3.2.1 of [NNTP], the server MUST NOT return either 480 or 483 in response to STARTTLS. 2.2.2. Description Vinocur, et. al. Expires July 2005 [Page 4] Internet Draft TLS for NNTP January 2005 A client issues the STARTTLS command to request negotiation of TLS. The STARTTLS command is usually used to initiate session security, although it can be used for client certificate authentication and/or data compression. An NNTP server returns the 483 response to indicate that a secure or encrypted connection is required for the command sent by the client. Use of the STARTTLS command as described below is one way to establish a connection with these properties. The client MAY therefore use the STARTTLS command after receiving a 483 response. If a server advertises the STARTTLS capability, a client MAY attempt to use the STARTTLS command at any time during a session to negotiate TLS without having received a 483 response. Servers SHOULD accept such unsolicited TLS negotiation requests. If the server is unable to initiate the TLS negotiation for any reason (e.g. a server configuration or resource problem), the server MUST reject the STARTTLS command with a 580 response. Otherwise, the server issues a 382 response and TLS negotiation begins. A server MUST NOT under any circumstances reply to a STARTTLS command with either a 480 or 483 response. If the client receives a failure response to STARTTLS, the client must decide whether or not to continue the NNTP session. Such a decision is based on local policy. For instance, if TLS was being used for client authentication, the client might try to continue the session, in case the server allows it to do so even with no authentication. However, if TLS was being negotiated for encryption, a client that gets a failure response needs to decide whether to continue without TLS encryption, to wait and try again later, or to give up and notify the user of the error. After receiving a 382 response to a STARTTLS command, the client MUST start the TLS negotiation before giving any other NNTP commands. The TLS negotiation begins for both the client and server with the first octet following the CRLF of the 382 response. If, after having issued the STARTTLS command, the client finds out that some failure prevents it from actually starting a TLS handshake, then it SHOULD immediately close the connection. Servers MUST be able to understand backwards-compatible TLS Client Hello messages (provided that client_version is TLS 1.0 or later), and clients MAY use backwards-compatible Client Hello messages. Neither clients or servers are required to actually support Client Hello messages for anything other than TLS 1.0. However, the TLS extension for Server Name Indication [TLS-EXT] SHOULD be implemented by all clients; it also SHOULD be implemented by any Vinocur, et. al. Expires July 2005 [Page 5] Internet Draft TLS for NNTP January 2005 server implementing STARTTLS that is known by multiple names (otherwise it is not possible for a server with several hostnames to present the correct certificate to the client). Although current use of TLS most often involves the dedication of port 563 for NNTP over TLS, the continued use of TLS on a separate port is discouraged for the reasons documented in section 7 of "Using TLS with IMAP, POP3 and ACAP" [TLS-IMAPPOP]. 2.2.2.1. Processing After the STARTTLS Command After the TLS handshake has been completed, both parties MUST immediately decide whether or not to continue based on the authentication and privacy achieved (if any). The NNTP client and server may decide to move ahead even if the TLS negotiation ended with without authentication and/or without privacy because NNTP services are often performed without authentication or privacy, but some NNTP clients or servers may want to continue only if a particular level of authentication and/or privacy was achieved. If the NNTP client decides that the level of authentication or privacy is not high enough for it to continue, it SHOULD issue a QUIT command immediately after the TLS negotiation is complete. If the NNTP server decides that the level of authentication or privacy is not high enough for it to continue, it SHOULD either reject subsequent restricted NNTP commands from the client with a 483 response code (possibly with a text string such as "Command refused due to lack of security"), or reject a command with a 400 response code (possibly with a text string such as "Connection closing due to lack of security") and close the connection. The decision of whether or not to believe the authenticity of the other party in a TLS negotiation is a local matter. However, some general rules for the decisions are: o The client MAY check that the identity presented in the server's certificate matches the intended server hostname or domain. This check is not required (and may fail in the absence of the TLS server_name extension [TLS-EXT], as described above), but if it is implemented and the match fails, the client SHOULD either request explicit user confirmation, or terminate the connection but allow the user to disable the check in the future. o Generally an NNTP server would want to accept any verifiable certificate from a client, however authentication can be done using the client certificate (perhaps in combination with the SASL EXTERNAL mechanism [NNTP-AUTH], although an implementation supporting STARTTLS is not required to support SASL in general or that mechanism in particular). The server MAY use Vinocur, et. al. Expires July 2005 [Page 6] Internet Draft TLS for NNTP January 2005 information about the client certificate for identification of connections or posted articles (either in its logs or directly in posted articles). 2.2.2.2. Result of the STARTTLS Command Upon successful completion of the TLS handshake, the NNTP protocol is reset to the state immediately after the initial greeting response (see 5.1 of [NNTP]) has been sent, with the exception that if a MODE READER command has been issued, the effects of it (if any) are not reversed. In this case, as no greeting is sent, the next step is for the client to send a command. The server MUST discard any knowledge obtained from the client, such as the current newsgroup and article number, that was not obtained from the TLS negotiation itself. Likewise, the client SHOULD discard and MUST NOT rely on any knowledge obtained from the server, such as the capability list, which was not obtained from the TLS negotiation itself. Both the client and the server MUST know if there is a TLS session active. A client MUST NOT attempt to start a TLS session if a TLS session is already active. A server MUST NOT return the STARTTLS capability label in response to a CAPABILITIES command received after a TLS handshake has completed, and a server MUST respond with a 502 response code if a STARTTLS command is received while a TLS session is already active. Additionally, per section 3.4.2 of [NNTP], the client MUST NOT issue a MODE READER command while a TLS session is active and a server MUST NOT advertise the MODE-READER capability. The capability list returned in response to a CAPABILITIES command received after the TLS handshake MAY be different than the list returned before the TLS handshake. For example, an NNTP server supporting SASL [NNTP-AUTH] might not want to advertise support for a particular mechanism unless a client has sent an appropriate client certificate during a TLS handshake. 2.2.3. Examples Example of a client being prompted to use encryption and negotiating it successfully (showing the removal of STARTTLS from the capability list once a TLS layer is active), followed by a successful selection of the group and an (inappropriate) attempt by the client to initiate another TLS negotiation: [C] CAPABILITIES [S] 101 Capability list: [S] VERSION 2 Vinocur, et. al. Expires July 2005 [Page 7] Internet Draft TLS for NNTP January 2005 [S] READER [S] STARTTLS [S] LIST ACTIVE NEWSGROUPS [S] OVER [S] . [C] GROUP local.confidential [S] 483 Encryption or stronger authentication required [C] STARTTLS [S] 382 Continue with TLS negotiation [TLS negotiation occurs here] [Following successful negotiation, traffic is via the TLS layer] [C] CAPABILITIES [S] 101 Capability list: [S] VERSION 2 [S] READER [S] LIST ACTIVE NEWSGROUPS [S] OVER [S] . [C] GROUP local.confidential [S] 211 1234 3000234 3002322 local.confidential [C] STARTTLS [S] 502 STARTTLS not allowed with active TLS layer Example of a request to begin TLS negotiation declined by the server: [C] STARTTLS [S] 580 Can not initiate TLS negotiation Example of a failed attempt to negotiate TLS, followed by two attempts at selecting groups only available under a security layer (in the first case the server allows the session to continue, in the second it closes the connection). Note that unrestricted commands such as CAPABILITIES are unaffected by the failure: [C] STARTTLS [S] 382 Continue with TLS negotiation [TLS negotiation is attempted here] [Following failed negotiation, traffic resumes without TLS] [C] CAPABILITIES [S] 101 Capability list: [S] VERSION 2 [S] READER [S] STARTTLS [S] LIST ACTIVE NEWSGROUPS [S] OVER [S] . [C] GROUP local.confidential Vinocur, et. al. Expires July 2005 [Page 8] Internet Draft TLS for NNTP January 2005 [S] 483 Encryption or stronger authentication required [C] GROUP local.private [S] 400 Closing connection due to lack of security 3. Augmented BNF Syntax for the STARTTLS Extension This section describes the syntax of the STARTTLS 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 =/ starttls-command starttls-command = "STARTTLS" 3.2. Capability entries This syntax extends the non-terminal "capability-entry", which represents a capability that may be advertised by the server. capability-entry =/ starttls-capability starttls-capability = "STARTTLS" 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 382 Generated by: STARTTLS Meaning: continue with TLS negotiation Response code 580 Generated by: STARTTLS Meaning: can not initiate TLS negotiation 5. Security Considerations In general, the security considerations of the TLS protocol [TLS] and any implemented extensions [TLS-EXT] are applicable here; only the most important are highlighted specifically below. Also, this extension is not intended to cure the security considerations described in section 11 of [NNTP]; those considerations remain Vinocur, et. al. Expires July 2005 [Page 9] Internet Draft TLS for NNTP January 2005 relevant to any NNTP implementation. Use of STARTTLS cannot protect protocol exchanges conducted prior to authentication. For this reason, the CAPABILITIES command SHOULD be re-issued after successful negotiation of a security layer, and other protocol state SHOULD be re-negotiated as well. It should be noted that NNTP is not an end-to-end mechanism. Thus, if an NNTP client/server pair decide to add TLS privacy, they are securing the transport only for that link. Similarly, because delivery of a single piece of news may go between more than two NNTP servers, adding TLS privacy to one pair of servers does not mean that the entire NNTP chain has been made private. Furthermore, just because an NNTP server can authenticate an NNTP client, it does not mean that the articles from the NNTP client were authenticated by the NNTP client when the client received them. Both the NNTP client and server must check the result of the TLS negotiation to see whether an acceptable degree of authentication and privacy was achieved. Ignoring this step completely invalidates using TLS for security. The decision about whether acceptable authentication or privacy was achieved is made locally, is implementation-dependent, and is beyond the scope of this document. The NNTP client and server should note carefully the result of the TLS negotiation. If the negotiation results in no privacy, or if it results in privacy using algorithms or key lengths that are deemed not strong enough, or if the authentication is not good enough for either party, the client may choose to end the NNTP session with an immediate QUIT command, or the server may choose not to accept any more NNTP commands. The client and server should also be aware that the TLS protocol permits privacy and security capabilities to be renegotiated mid- connection (see section 7.4.1 of [TLS]). For example, one of the parties may desire minimal encryption after any authentication steps have been performed. This underscores the fact that security is not present simply because TLS has been negotiated; the nature of the established security layer must be considered. A man-in-the-middle attack can be launched by deleting the STARTTLS capability label in the CAPABILITIES response from the server. This would cause the client not to try to start a TLS session. Another man-in-the-middle attack is to allow the server to announce its STARTTLS capability, but to alter the client's request to start TLS and the server's response. An NNTP client can partially Vinocur, et. al. Expires July 2005 [Page 10] Internet Draft TLS for NNTP January 2005 protect against these attacks by recording the fact that a particular NNTP server offers TLS during one session and generating an alarm if it does not appear in the CAPABILITIES response for a later session (of course, the STARTTLS capability would not be listed after a security layer is in place). If the TLS negotiation fails or if the client receives a 483 response, the client has to decide what to do next. The client has to choose among three main options: to go ahead with the rest of the NNTP session, to retry TLS later in the session, or to give up and postpone newsreading activity. If a failure or error occurs, the client can assume that the server may be able to negotiate TLS in the future, and should try to negotiate TLS in a later session. However, if the client and server were only using TLS for authentication and no previous 480 response was received, the client may want to proceed with the NNTP session, in case some of the operations the client wanted to perform are accepted by the server even if the client is unauthenticated. Before the TLS handshake has begun, any protocol interactions are performed in the clear and may be modified by an active attacker. For this reason, clients and servers MUST discard any sensitive knowledge obtained prior to the start of the TLS handshake upon completion of the TLS handshake. 6. IANA Considerations This section gives a formal definition of the STARTTLS extension as required by Section 3.3.4 of [NNTP] for the IANA registry. o The STARTTLS extension provides connection-based security via the Transport Layer Security (TLS). o The capability label for this extension is "STARTTLS". o The capability label has no arguments. o This extension defines one new command, STARTTLS, whose behaviour, arguments, and responses are defined in Section 2.2. o This extension does not associate any new responses with pre- existing NNTP commands. o This extension does affect the overall behaviour of both server and client, in that after successful use of the STARTTLS command, all communication is transmitted with the TLS layer as an intermediary. Vinocur, et. al. Expires July 2005 [Page 11] Internet Draft TLS for NNTP January 2005 o This extension does not affect the maximum length of commands or initial response lines. o This extension does not alter pipelining, but the STARTTLS command cannot be pipelined. o Use of this extension does alter the capabilities list; once the STARTTLS command has been used successfully, the STARTTLS capability can no longer be advertised by CAPABILITIES. Additionally, the MODE-READER capability MUST NOT be advertised after a successful TLS negotiation (as discussed in Section 3.4.2 of [NNTP]). o This extension does not cause any pre-existing command to produce a 401, 480, or 483 response. o This extension is unaffected by any use of the MODE READER command, however the MODE READER command MUST NOT be used in the same session following a successful TLS negotiation (as discussed in Section 3.4.2 of [NNTP]). o Published Specification: This document. o Author, Change Controller, and Contact for Further Information: Author of this document. 7. References 7.1. Normative References [ABNF] Crocker, D., Overell, P., "Augmented BNF for Syntax Specifications: ABNF", RFC 2234, November 1997. [KEYWORDS] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", RFC 2119, March 1997. [NNTP] Feather, C., "Network News Transport Protocol", draft-ietf-nntpext-base-*.txt, Work in Progress. [TLS] Dierks, T., Allen, C., "The TLS Protocol Version 1.0", RFC 2246, January 1999. [TLS-EXT] Blake-Wilson, S., Nystrom, M., Hopwood, D., Mikkelsen, J., Wright, T., "Transport Layer Security (TLS) Extensions", RFC 3546, June 2003. Vinocur, et. al. Expires July 2005 [Page 12] Internet Draft TLS for NNTP January 2005 7.2. Informative References [NNTP-AUTH] Vinocur, J., Murchison, K., Newman, C., "NNTP Extension for Authentication", draft-ietf-nntpext-auth-*.txt, Work in Progress. [TLS-IMAPPOP] Newman, C., "Using TLS with IMAP, POP3 and ACAP", RFC 2595, June 1999. 8. Authors' Addresses Jeffrey M. Vinocur Department of Computer Science Upson Hall Cornell University Ithaca, NY 14853 EMail: vinocur@cs.cornell.edu Kenneth Murchison Oceana Matrix Ltd. 21 Princeton Place Orchard Park, NY 14127 USA Email: ken@oceana.com Chris Newman Sun Microsystems 1050 Lakes Drive, Suite 250 West Covina, CA 91790 EMail: cnewman@iplanet.com 9. Acknowledgements A significant amount of the STARTTLS text was lifted from RFC 3207 by Paul Hoffman. Special acknowledgement goes also to the people who commented privately on intermediate revisions of this document, as well as the members of the IETF NNTP Working Group for continual insight in discussion. Vinocur, et. al. Expires July 2005 [Page 13] Internet Draft TLS for NNTP January 2005 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 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. 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. 11. Copyright 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. Vinocur, et. al. Expires July 2005 [Page 14]