Re: STARTTLS & EHLO: Errata text?

Alexey Melnikov <alexey.melnikov@isode.com> Thu, 29 January 2009 23:47 UTC

Received: from balder-227.proper.com (localhost [127.0.0.1]) by balder-227.proper.com (8.14.2/8.14.2) with ESMTP id n0TNlRv4046623 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 29 Jan 2009 16:47:27 -0700 (MST) (envelope-from owner-ietf-smtp@mail.imc.org)
Received: (from majordom@localhost) by balder-227.proper.com (8.14.2/8.13.5/Submit) id n0TNlRB0046622; Thu, 29 Jan 2009 16:47:27 -0700 (MST) (envelope-from owner-ietf-smtp@mail.imc.org)
X-Authentication-Warning: balder-227.proper.com: majordom set sender to owner-ietf-smtp@mail.imc.org using -f
Received: from rufus.isode.com (rufus.isode.com [62.3.217.251]) by balder-227.proper.com (8.14.2/8.14.2) with ESMTP id n0TNlPg6046616 for <ietf-smtp@imc.org>; Thu, 29 Jan 2009 16:47:26 -0700 (MST) (envelope-from alexey.melnikov@isode.com)
Received: from [92.40.101.114] (92.40.101.114.sub.mbb.three.co.uk [92.40.101.114]) by rufus.isode.com (submission channel) via TCP with ESMTPA id <SYJACQB0lFa1@rufus.isode.com>; Thu, 29 Jan 2009 23:47:23 +0000
Message-ID: <49823FDC.4000006@isode.com>
Date: Thu, 29 Jan 2009 23:46:36 +0000
From: Alexey Melnikov <alexey.melnikov@isode.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915
X-Accept-Language: en-us, en
To: ned+ietf-smtp@mrochek.com
CC: SM <sm@resistor.net>, Tony Hansen <tony@att.com>, ietf-smtp@imc.org
Subject: Re: STARTTLS & EHLO: Errata text?
References: <497DE492.4080506@pscs.co.uk> <497DED29.70402@att.com> <497ED420.30708@pscs.co.uk> <alpine.LSU.2.00.0901271403220.4546@hermes-2.csi.cam.ac.uk> <497F86CB.60904@att.com> <alpine.LSU.2.00.0901281434440.4546@hermes-2.csi.cam.ac.uk> <498088B8.9040404@pscs.co.uk> <alpine.LSU.2.00.0901291310080.4546@hermes-2.csi.cam.ac.uk> <4981C0D5.1010401@pscs.co.uk> <4981C6BD.2040900@att.com> <37F39FF37390694B69567838@PST.JCK.COM> <4981E1AB.9000002@att.com> <6.2.5.6.2.20090129094120.02f234a0@resistor.net> <01N4VB00O5UQ00007A@mauve.mrochek.com>
In-Reply-To: <01N4VB00O5UQ00007A@mauve.mrochek.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
Sender: owner-ietf-smtp@mail.imc.org
Precedence: bulk
List-Archive: <http://www.imc.org/ietf-smtp/mail-archive/>
List-ID: <ietf-smtp.imc.org>
List-Unsubscribe: <mailto:ietf-smtp-request@imc.org?body=unsubscribe>

Hi Ned,

ned+ietf-smtp@mrochek.com wrote:

>> Hi Tony,
>
>> Some of the text in this message is from from RFC 3207.
>
>> At 09:04 29-01-2009, Tony Hansen wrote:
>
>> >If we were to write an Errata against RFC 3207, I'd suggest text 
>> such as
>> >the following (in Errata format):
>> >
>> >Section:
>> >    4.2 Result of the STARTTLS Command
>> >
>> >Old text:
>> >    The server MUST discard any knowledge obtained from the client, 
>> such
>> >    as the argument to the EHLO command, which was not obtained from 
>> the
>> >    TLS negotiation itself.
>> >
>> >New text:
>> >    The server MUST discard any knowledge obtained from the client that
>> >    was not obtained from the TLS negotiation itself. The server state
>> >    is otherwise as if the connection had just been opened.
>> >
>> >Reason:
>> >    The example is misleading and has lead some people to think that
>> >    knowledge of an EHLO having been sent previously should be
>> >    remembered.
>
>> Quoting the entire paragraph from the RFC:
>
>>    "Upon completion of the TLS handshake, the SMTP protocol is reset to
>>     the initial state (the state in SMTP after a server issues a 220
>>     service ready greeting).  The server MUST discard any knowledge
>>     obtained from the client, such as the argument to the EHLO command,
>>     which was not obtained from the TLS negotiation itself.  The client
>>     MUST discard any knowledge obtained from the server, such as the 
>> list
>>     of SMTP service extensions, which was not obtained from the TLS
>>     negotiation itself.  The client SHOULD send an EHLO command as the
>>     first command after a successful TLS negotiation."
>
>> Updated text:
>
>>     Upon completion of the TLS handshake, the SMTP protocol is reset to
>>     the initial state (the state in SMTP after a server issues a 220
>>     service ready greeting).  The server MUST discard any knowledge 
>> obtained
>>     from the client, such as command verbs and their arguments, that was
>>     not obtained from the TLS negotiation itself.  The client MUST 
>> discard any
>>     knowledge obtained from the server, such as the list of SMTP 
>> service extensions,
>>     which was not obtained from the TLS  negotiation itself.  As the 
>> server state is
>>     as when a SMTP session is initiated, the client SHOULD send an 
>> EHLO command as the
>>     first command after a successful TLS negotiation.
>
> While I have no objection to making this change, I note in passing 
> that quite a
> few servers, ours included, violate the "the server MUST discard any 
> knowledge
> obtained from the client" part of this and will continue to do so no 
> matter
> what is written in any standard.
>
> The reason for this is simple: Limits used in controlling spam and DOS 
> attacks.
> Servers impose limits on all sorts of things, including but not 
> limited to the
> number of transactions in a session, the total number of recipients, 
> the total
> time a session has taken, and so on. If a server follows this MUST it 
> turns
> STARTTLS into a one time "reset all my rate limits" pass. That's 
> simply not
> acceptable in today's email climate.

Good point.

> Please note that I am not arguing that such limits are effective in 
> controlling
> spam or deflecting DOS attacks. (Nor am I arguing that they aren't.) 
> My point
> is rather that mail system administrators insist on having these sort 
> of limits
> available as part of their security toolbox. If they aren't available 
> or are
> there in a form that can easily be bypassed they will run a different 
> mail
> server product instead.
>
> The simplest fix to bring this text in line with reality is to change 
> the MUST
> into a SHOULD. Beyond that lies a slippery slope where we attempt to 
> categorize
> what sorts of information a server can or cannot retain. I really 
> don't think
> we want to go there.

I would like suggest an alternative: how about saying

    The server MUST NOT trust any information obtained
    from the client, such as command verbs and their arguments, prior to 
the TLS negotiation.
    The client MUST NOT trust any information obtained from the server,
    such as the list of SMTP service extensions,
    prior to the TLS negotiation.

This avoid the whole issue of what the client/server must and must not 
remember.
 [...]

>> >Section:
>> >    4. The STARTTLS Command
>> >
>> >Old text:
>> >    The format for the STARTTLS command is:
>> >
>> >    STARTTLS
>> >
>> >    with no parameters.
>> >
>> >New text:
>> >    The format for the STARTTLS command is:
>> >
>> >    STARTTLS
>> >
>> >    with no parameters.
>> >
>> >    Because the server state machine is reset to an initial connection
>> >    state after negotiating TLS, and any modifications to the server
>> >    state will be lost, the client SHOULD NOT issue any MAIL
>> >    FROM or RCPT TO commands prior to using the STARTTLS command.
>
>> Agreed.
>
> While this clarification exercise is all well and good, if we're 
> actually going
> to issue a revision to RFC 3207 we should consider fixing its most 
> serious flaw
> (IMO) - the lack of a domain parameter on the STARTTLS command, in 
> order to
> allow a single SMTP server to provide "virtual hosting" support for 
> multiple
> domains.

This is an interesting issue, because it affects pretty much any 
application protocol that have STARTTLS command or similar.

While I agree that this functionality is needed, I came to conclusion 
that this change at the application layer is not needed, as there a TLS 
extension for doing exactly that (RFC 4366, section 3.1). It might even 
be supported by OpenSSL.
But lack of APIs for controlling this in TLS libraries might be a problem.

> This would have to be done by advertising a separate extension, say
> STARTTLSDOMAIN, which if present says the STARTTLS command accept a 
> single,
> optional parameter specifying the domain associated with the 
> certificate the
> client would like to see the server assert. Text for this can be 
> adapted from
> section 6 of RFC 3887.
>
> As things stand now these sorts of virtual hosting setups require the 
> use of
> multiple separate ports or IP addresses (usually the latter given how 
> many
> clients don't support alternate ports). That's fine and dandy when 
> you  have
> two or three domains, but unacceptable when you're hosting thousands 
> of them or
> more.