RFC 4642
Using Transport Layer Security (TLS) with Network News Transfer Protocol (NNTP)
RFC 4642: Using TLS with NNTP π
Okay bestie, this is RFC 4642 π It's called "Using Transport Layer Security (TLS) with Network News Transfer Protocol (NNTP)," and it's a Standards Track doc from the Network Working Group, dated October 2006. The authors are K. Murchison (Carnegie Mellon University), J. Vinocur (Cornell University), and C. Newman (Sun Microsystems) π§ The title block doesn't list any Obsoletes or Updates entries, so this one stands on its own π
Status of This Memo π
Lowkey the official-paperwork part, but it matters β¨ This doc specifies an Internet standards track protocol for the Internet community and asks for discussion and suggestions for improvements π For the standardization state and status, check the current edition of "Internet Official Protocol Standards" (STD 1) π Distribution of this memo is unlimited π
Copyright Notice Β©
Copyright (C) The Internet Society (2006) π¦
Abstract β¨
This memo adds an extension to the Network News Transfer Protocol (NNTP) that lets an NNTP client and server use Transport Layer Security (TLS) π The main goal is encryption for single-link confidentiality π but data integrity, (optional) certificate-based peer entity authentication, and (optional) data compression are also on the table π
Table of Contents π
1. Introduction ....................................................2
1.1. Conventions Used in This Document ..........................3
2. The STARTTLS Extension ..........................................3
2.1. Advertising the STARTTLS Extension .........................3
2.2. STARTTLS Command ...........................................4
2.2.1. Usage ...............................................4
2.2.2. Description .........................................4
2.2.3. Examples ............................................6
3. Augmented BNF Syntax for the STARTTLS Extension .................8
3.1. Commands ...................................................8
3.2. Capability entries .........................................8
4. Summary of Response Codes .......................................8
5. Security Considerations .........................................8
6. IANA Considerations ............................................11
7. References .....................................................12
7.1. Normative References ......................................12
7.2. Informative References ....................................12
8. Acknowledgements ...............................................12
1. Introduction β¨
Back in the day, plain unencrypted NNTP [NNTP] connections were totally fine for most stuff π°οΈ But sending passwords unencrypted over the network is no longer appropriate π ββοΈ and sometimes you want integrity and/or confidentiality protection for the whole connection π
The TLS protocol (formerly known as SSL) is how you secure an application protocol against tampering and eavesdropping π‘οΈ Advanced SASL authentication mechanisms [NNTP-AUTH] can give you a lightweight version of this service, but TLS is complementary to both simple authentication-only SASL mechanisms and the clear-text password login commands that are already out there π
In some existing implementations, TCP port 563 has been set aside for NNTP over TLS π Those implementations start the TLS negotiation right when you connect and then carry on with the usual opening steps of an NNTP session. Using TLS on a separate port like this is discouraged, for the reasons in Section 7 of "Using TLS with IMAP, POP3 and ACAP" [TLS-IMAPPOP] π
This specification formalizes the STARTTLS command, which is already in occasional use by the installed base πΈ STARTTLS fixes a bunch of the problems with using a separate port for a "secure" protocol variant, so it's the preferred way of using TLS with NNTP π
1.1. Conventions Used in This Document
The notational conventions here are the same as in [NNTP], and any term not defined in this document has the same meaning it has there π
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 marked with [C], and responses from the server are marked with [S] π§
2. The STARTTLS Extension π¦
This extension adds a brand-new STARTTLS command, and its capability label is STARTTLS π
2.1. Advertising the STARTTLS Extension
A server that supports the STARTTLS command as defined here advertises the "STARTTLS" capability label in response to the CAPABILITIES command ([NNTP] Section 5.2) β¨ But this capability MUST NOT be advertised once a TLS layer is active (see Section 2.2.2) or after successful authentication [NNTP-AUTH] π It MAY be advertised both before and after any use of the MODE READER command ([NNTP] Section 5.3), with the same semantics π
Since STARTTLS is all about security, cached results of CAPABILITIES from a previous session MUST NOT be relied on, as per Section 12.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 if authentication has occurred, STARTTLS is not a valid command (see Section 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
okay so the client sends STARTTLS when it wants to ask for TLS negotiation π It's usually used to start session security, but it can also be used for client and/or server certificate authentication and/or data compression. so many options, bestie π
An NNTP server sends back a 483 response to say that a secure or encrypted connection is needed for the command the client just sent. Using STARTTLS the way described below is one way to get a connection like that π¦ The client MAY therefore use STARTTLS after getting a 483 response.
If a server advertises the STARTTLS capability, a client MAY try to use STARTTLS at any point in a session to negotiate TLS, even without having gotten a 483 response. Servers SHOULD accept these unsolicited TLS negotiation requests πΈ
If the server can't start TLS negotiation for some reason (like a server configuration or resource problem), it MUST reject the STARTTLS command with a 580 response. Then it SHOULD do one of two things. It can reject later restricted NNTP commands from the client with a 483 response code (maybe with a text string like "Command refused due to lack of security"). Or it can reject a later restricted command with a 400 response code (maybe with a text string like "Connection closing due to lack of security") and close the connection. 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 gets a failure response to STARTTLS, the client must decide whether or not to keep going with the NNTP session. That decision is based on local policy β¨ For example, if TLS was being used for client authentication, the client might try to continue the session in case the server lets it do that even with no authentication. But if TLS was being negotiated for encryption, a client that gets a failure response needs to decide whether to continue without TLS encryption, wait and try again later, or give up and tell the user about the error π
Once a client gets 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 the server with the first octet after the CRLF of the 382 response. If, after issuing the STARTTLS command, the client finds out that some failure stops 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 (as long as client_version is TLS 1.0 or later), and clients MAY use backwards-compatible Client Hello messages. Neither clients nor servers are required to actually support Client Hello messages for anything other than TLS 1.0. The TLS extension for Server Name Indication ("server_name") [TLS-EXT] SHOULD be implemented by all clients. It also SHOULD be implemented by any server implementing STARTTLS that is known by multiple names. (Otherwise, a server with several hostnames can't present the correct certificate to the client, and that's a whole mess π« )
If the TLS negotiation fails, both the client and the server SHOULD immediately close the connection. Continuing the NNTP session is theoretically possible, but in practice a TLS negotiation failure often leaves the session in an indeterminate state. So interoperability can not be guaranteed π₯²
After a successful TLS handshake, the NNTP protocol is reset to the state it was in right after the initial greeting response (see 5.1 of [NNTP]) was sent. The one exception is that if a MODE READER command was issued, its effects (if any) are not reversed. Since no greeting is sent at this point, the next step is for the client to send a command. The server MUST discard any knowledge it got from the client, like the current newsgroup and article number, that did not come from the TLS negotiation itself. The client SHOULD discard any knowledge it got from the server, like the capability list, that did not come from the TLS negotiation itself, and it MUST NOT rely on that knowledge π§
The server stays in the non-authenticated state, even if client credentials are supplied during the TLS negotiation. The AUTHINFO SASL command [NNTP-AUTH] with the EXTERNAL mechanism [SASL] MAY be used to authenticate once TLS client credentials have been successfully exchanged. But servers that support the STARTTLS command are not required to support AUTHINFO in general, or the EXTERNAL mechanism in particular. The server MAY use information from the client certificate to identify connections or posted articles (either in its logs or directly in posted articles) π
Both the client and the server MUST know whether a TLS session is active. A client MUST NOT attempt to start a TLS session if one 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. A server MUST respond with a 502 response code if a STARTTLS command is received while a TLS session is already active. Also, 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 a successful TLS handshake MAY be different from the list returned before the handshake. For example, an NNTP server that supports SASL [NNTP-AUTH] might not want to advertise support for a particular mechanism unless a client has sent an appropriate client certificate during the TLS handshake π¦
2.2.3. Examples
Here's an example of a client being prompted to use encryption and negotiating it successfully. You can see STARTTLS get removed from the capability list once a TLS layer is active π Then the client successfully selects a group and makes an (inappropriate) attempt to start another TLS negotiation π
[C] CAPABILITIES
[S] 101 Capability list:
[S] VERSION 2
[S] READER
[S] STARTTLS
[S] LIST ACTIVE NEWSGROUPS OVERVIEW.FMT
[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 protected by TLS]
[C] CAPABILITIES
[S] 101 Capability list:
[S] VERSION 2
[S] READER
[S] LIST ACTIVE NEWSGROUPS OVERVIEW.FMT
[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
Here's a request to begin TLS negotiation that the server turns down π ββοΈ
[C] STARTTLS
[S] 580 Can not initiate TLS negotiation
Next is a failed attempt to negotiate TLS, followed by two tries at selecting groups that are only available under a security layer. In the first case, the server lets the session continue. In the second, it closes the connection. Note that unrestricted commands such as CAPABILITIES aren't affected 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 OVERVIEW.FMT
[S] OVER
[S] .
[C] GROUP local.confidential
[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 formal syntax of the STARTTLS extension using ABNF [ABNF]. It extends the syntax in Section 9 of [NNTP], and non-terminals that aren't defined in this document are defined there. You should import the [NNTP] ABNF first before trying to validate these rules π
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 a server may advertise.
capability-entry =/ starttls-capability
starttls-capability = "STARTTLS"
4. Summary of Response Codes β¨
This section lists each new response code defined in this document. For each one, it says which commands can generate it, what arguments it has, and what it means π
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 π
Okay bestie, security is woven through this whole memo πΈοΈ so it's not just a one-section thing π
In general, the security considerations of the TLS protocol [TLS] and any implemented extensions [TLS-EXT] totally apply here π We only spotlight the most important ones below. Also, this extension is not meant to fix the security considerations in Section 12 of [NNTP] π Those still matter for any NNTP implementation.
NNTP client and server implementations MUST implement the TLS_RSA_WITH_RC4_128_MD5 [TLS] cipher suite, and they SHOULD implement the TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA [TLS] cipher suite β¨ This is important because it guarantees that any two compliant implementations can be configured to interoperate π«Ά All other cipher suites are OPTIONAL π
Before the TLS handshake has begun, every protocol interaction happens in the clear π and an active attacker can modify it. So clients and servers MUST discard any sensitive knowledge obtained before the TLS handshake started, once the security layer is established π₯ Also, the CAPABILITIES command SHOULD be re-issued once the security layer is up, and other protocol state SHOULD be re-negotiated too π
Note that NNTP is not an end-to-end mechanism π¦ So if an NNTP client/server pair decide to add TLS confidentiality, they're only securing the transport for that one link. Similarly, a single Netnews article can travel through more than two NNTP servers, so adding TLS to one pair does not mean the entire NNTP chain is private π And just because an NNTP server can authenticate an NNTP client doesn't mean the client authenticated the articles it received before forwarding them to the server π
During the TLS negotiation, the client MUST check its understanding of the server hostname against the server's identity as presented in the server Certificate message, to prevent man-in-the-middle attacks π¨ Matching works according to these rules:
- The client MUST use the server hostname it used to open the connection (or the hostname specified in the TLS
"server_name"extension [TLS-EXT]) as the value to compare against the server name as expressed in the server certificate. The client MUST NOT use any form of the server hostname derived from an insecure remote source (e.g., insecure DNS lookup). CNAME canonicalization is not done π ββοΈ - If a subjectAltName extension of type dNSName is present in the certificate, it SHOULD be used as the source of the server's identity π
- Matching is case-insensitive π
- A
*wildcard character MAY be used as the left-most name component in the certificate. For example,*.example.comwould matcha.example.com,foo.example.com, etc., but would not matchexample.comπ§ - If the certificate contains multiple names (e.g., more than one dNSName field), then a match with any one of the fields is considered acceptable πΈ
If the match fails, the client SHOULD either ask for explicit user confirmation or terminate the connection with a QUIT command and indicate the server's identity is suspect π©
Additionally, clients MUST verify the binding between the identity of the servers they connect to and the public keys those servers present π Clients SHOULD implement the algorithm in Section 6 of [PKI-CERT] for general certificate validation, but they MAY supplement that algorithm with other validation methods that reach equivalent levels of verification (such as comparing the server certificate against a local store of already-verified certificates and identity bindings) π
A man-in-the-middle attack can be launched by deleting the STARTTLS capability label from the server's CAPABILITIES response π± That stops the client from even trying to start a TLS session. Another man-in-the-middle attack lets the server announce its STARTTLS capability, but alter the client's request to start TLS and the server's response π An NNTP client can partially protect itself from these attacks by recording the fact that a particular NNTP server offers TLS during one session, and raising an alarm if it doesn't appear in the CAPABILITIES response in a later session π¨ (Of course, the STARTTLS capability would not be listed after a security layer is in place π)
If the client receives a 483 or 580 response, it has to decide what to do next π€ It has to choose among three main options: go ahead with the rest of the NNTP session, (re)try TLS later in the session, or give up and postpone newsreading/transport activity. If an error occurs, the client can assume the server may be able to negotiate TLS in the future, and it 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 π«§ That's because some of the operations the client wanted might still be accepted by the server even though the client is unauthenticated β¨
6. IANA Considerations π
This section gives a formal definition of the STARTTLS extension, as required by Section 3.3.3 of [NNTP] for the IANA registry π§Ύ
- The STARTTLS extension provides connection-based security via the Transport Layer Security (TLS) π
- The capability label for this extension is "STARTTLS" π·οΈ
- The capability label has no arguments π ββοΈ
- This extension defines one new command, STARTTLS, whose behavior, arguments, and responses are defined in Section 2.2 π
- This extension does not associate any new responses with pre-existing NNTP commands π·
- This extension does affect the overall behavior of both server and client: after successful use of the STARTTLS command, all communication is transmitted with the TLS protocol as an intermediary π
- This extension does not affect the maximum length of commands or initial response lines π
- This extension does not alter pipelining, but the STARTTLS command cannot be pipelined π«
- 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 π«
- This extension does not cause any pre-existing command to produce a 401, 480, or 483 response π
- 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 π
- Published Specification: This document π
- Contact for Further Information: Authors of this document π
- Change Controller: IESG <iesg@ietf.org> π
7. References π
7.1. Normative References
[ABNF]Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", RFC 4234, October 2005. π§©[KEYWORDS]Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. π[NNTP]Feather, C., "Network News Transfer Protocol (NNTP)", RFC 3977, October 2006. π°[PKI-CERT]Housley, R., Polk, W., Ford, W., and D. Solo, "Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile", RFC 3280, April 2002. πͺͺ[TLS]Dierks, T. and E. Rescorla, "The Transport Layer Security (TLS) Protocol Version 1.1", RFC 4346, April 2006. π[TLS-EXT]Blake-Wilson, S., Nystrom, M., Hopwood, D., Mikkelsen, J., and T. Wright, "Transport Layer Security (TLS) Extensions", RFC 4366, April 2006. π§©
7.2. Informative References
[NNTP-AUTH]Vinocur, J., Murchison, K., and C. Newman, "Network News Transfer Protocol (NNTP) Extension for Authentication", RFC 4643, October 2006. πββοΈ[SASL]Melninov, A., Ed. and K. Zeilenga, Ed, "Simple Authentication and Security Layer (SASL)", RFC 4422, June 2006. π¦[TLS-IMAPPOP]Newman, C., "Using TLS with IMAP, POP3 and ACAP", RFC 2595, June 1999. π¬
8. Acknowledgements π«Ά
A significant amount of the text in this document was lifted from RFC 2595 by Chris Newman and RFC 3207 by Paul Hoffman π
Special acknowledgement also goes to the people who commented privately on intermediate revisions of this document, as well as the members of the IETF NNTP Working Group for their continual insight in discussion π
Authors' Addresses πΊοΈ
Kenneth Murchison
Carnegie Mellon University
5000 Forbes Avenue
Cyert Hall 285
Pittsburgh, PA 15213 USA
EMail: murch@andrew.cmu.edu
Jeffrey M. Vinocur
Department of Computer Science
Upson Hall
Cornell University
Ithaca, NY 14853
EMail: vinocur@cs.cornell.edu
Chris Newman
Sun Microsystems
3401 Centrelake Dr., Suite 410
Ontario, CA 91761
EMail: Chris.Newman@sun.com
Full Copyright Statement βοΈ
Copyright (C) The Internet Society (2006).
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 π
Intellectual Property π§
The IETF takes no position regarding the validity or scope of any Intellectual Property Rights 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. Nor does it represent that it has made any independent effort to identify any such rights π Information on the procedures with respect to rights in RFC documents can be found in BCP 78 and BCP 79 π
Copies of IPR disclosures made to the IETF Secretariat, 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 on-line IPR repository at http://www.ietf.org/ipr π
The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology that may be required to implement this standard. Please address the information to the IETF at ietf-ipr@ietf.org π
Acknowledgement π
Funding for the RFC Editor function is provided by the IETF Administrative Support Activity (IASA) β¨
π¦ where this page comes from
- ietf: rfc4642 2006-10
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms