Re: [TLS] simplistic renego protection

David-Sarah Hopwood <david-sarah@jacaranda.org> Sun, 22 November 2009 04:39 UTC

Return-Path: <djhopwood@googlemail.com>
X-Original-To: tls@core3.amsl.com
Delivered-To: tls@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id CDD4C3A686B for <tls@core3.amsl.com>; Sat, 21 Nov 2009 20:39:26 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[AWL=0.000, BAYES_00=-2.599]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6S+kElwFQHMj for <tls@core3.amsl.com>; Sat, 21 Nov 2009 20:39:25 -0800 (PST)
Received: from mail-ew0-f214.google.com (mail-ew0-f214.google.com [209.85.219.214]) by core3.amsl.com (Postfix) with ESMTP id 145DB3A679C for <tls@ietf.org>; Sat, 21 Nov 2009 20:39:24 -0800 (PST)
Received: by ewy6 with SMTP id 6so852539ewy.29 for <tls@ietf.org>; Sat, 21 Nov 2009 20:39:18 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type; bh=PhQygKQYMvOesT9v9XUTvS90y2lf+CGlY1xIU1wN0/s=; b=oMqPIN9rZPYwWQVX072jqeek+LyFezw1RTGPFMKgw65nc03WFXRB7CYv7P/TIf8t+L vyaEGc4NftJoD9u/frgH9t9fNXOtwcOLrJNXW7yY0ntZ3YZeoo+Gh5SSNjyvZbIK/YDi HcBcGeRmJVY/yZGQKKBjf3Yi5DW/GFJ2Mo544=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:x-enigmail-version:content-type; b=DmXglrok6sywMlgh1E20Zwz96UeTg5rD214mcjoDDTFPrxdWuXHdV67ZNJ395M3lJ+ R0ADy1jgP9/tqRfKfzWOlq4tjk4U0zvgLcpHBye7BIGJ7AJwVoDUf0MtrIzbqkzxs0mW T6Wmg+KqlMma3GxZv4pGixW2cWZD8JBgWS5M4=
Received: by 10.213.27.8 with SMTP id g8mr2046030ebc.58.1258864758216; Sat, 21 Nov 2009 20:39:18 -0800 (PST)
Received: from ?192.168.0.2? (5e023669.bb.sky.com [94.2.54.105]) by mx.google.com with ESMTPS id 13sm571049ewy.9.2009.11.21.20.39.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 21 Nov 2009 20:39:17 -0800 (PST)
Sender: David-Sarah Hopwood <djhopwood@googlemail.com>
Message-ID: <4B08C04E.4070606@jacaranda.org>
Date: Sun, 22 Nov 2009 04:38:38 +0000
From: David-Sarah Hopwood <david-sarah@jacaranda.org>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.8.1.3) Gecko/20070326 Thunderbird/2.0.0.0 Mnenhy/0.7.5.666
MIME-Version: 1.0
To: tls@ietf.org
References: <C72E2F35.6867%stefan@aaa-sec.com>
In-Reply-To: <C72E2F35.6867%stefan@aaa-sec.com>
X-Enigmail-Version: 0.96.0
Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="------------enigF0FCE1864CC81F2B83F36A21"
Subject: Re: [TLS] simplistic renego protection
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <tls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/tls>, <mailto:tls-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/tls>
List-Post: <mailto:tls@ietf.org>
List-Help: <mailto:tls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tls>, <mailto:tls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 22 Nov 2009 04:39:26 -0000

Stefan Santesson wrote:
> On 09-11-21 11:09 PM, "David-Sarah Hopwood" <david-sarah@jacaranda.org>
> wrote:
>> Stefan Santesson wrote:
>>> On 09-11-21 8:00 PM, "David-Sarah Hopwood" <david-sarah@jacaranda.org>
>>> wrote:
>>>>
>>>> The attacker is able to add a prefix to the server's view of the session.
>>>> This changes the server's state from what it would have been on an
>>>> initial connection. How far the attacker's influence on the server's
>>>> state extends into that session, is dependent on the application protocol.
>>> So we are saying the same thing.
>>>
>>> As you say, it depends on the application. What I claim is that it is
>>> possible to design an application that use channel binding to keep itself
>>> safe from this attack. All it needs to do is to make sure that it's state is
>>> reset after completed channel binding.
>>
>> That's not correct; it needs to know that the client's state is reset as
>> well (see below).
> 
> Frankly, I can't see why it isn't enough for the server to reset it's state
> regardless of the client. The server will simply regard the first message
> after channel-binding as the first legitimate message from the client.

The data sent on the channel is only split into "messages" at the
application protocol layer (if at all). At the upper interface of the
TLS layer, it is just a duplex byte stream, so the client may have sent a
partial application message. The server will then receive the rest of that
message after having reset its state, so it will be out of sync with the
client. This situation would break the application protocol regardless of
any attack.

>> But then, why use
>> renegotiation (and unnecessarily risk interoperability problems) if you're
>> going to use it in a way that is completely equivalent to making a new
>> connection?
> 
> I agree, you have a point here. The point is more that you don't need to
> take action to turn re-negotiation off if you are safe from the attack.

But you do have to take action to ensure that the server resets its state,
and/or perform channel binding. Given that you have to take action, it's
not at all clear that these particular actions are simpler than the
alternatives; in they are definitely more complex than some alternatives.

>>> The fact that it is possible to be safe despite this vulnerability is an
>>> argument that lenient servers should be supported in the solution.
>>
>> Suppose that an unpatched client performs a renegotiation. The server
>> doesn't know whether this is an intended renegotiation or an attack; so,
>> it must reset its state,
> 
> No. If the renegotiation occurs after a successful channel binding, the
> server can be assured that this is not an attack.

Your suggestion was that channel binding could be done above the TLS layer.
As far as I can see, any channel binding that occurs above the TLS layer
cannot work to prevent the attack unless it is aware of the TLS
renegotiation boundaries. If you think that it can, please give more detail
of the protocol you're proposing; "successful channel binding" is not a
specific enough description.

[...]
>> One might argue: OK, renegotiation is unnecessary, but what if we want to
>> retain interoperability with clients that do it anyway (between stateless
>> requests, since that's the only case that would work)? However, in practice
>> clients don't renegotiate just for the fun of it; we need to consider how
>> renegotiation is actually used. I have not yet seen any plausible use case
>> for continuing to support renegotiation with unpatched clients, where it
>> wouldn't be simpler and more secure to do something else (given that you're
>> suggesting that we modify how the server uses the application protocol in
>> any case). For instance, when using renegotiation to prompt the client to
>> present a client cert, it's easier to have it make such requests on a
>> different port.
> 
> You might be absolutely right here. However, I think the burden of proof
> should be reversed. Lenient servers should be supported unless we know for
> sure that there is no legitimate use case. It should be the choice of the
> local administrator to be strict, not the choice of the protocol designer.
> 
> IMO, if one solution can support of lenient servers, and the other proposal
> can't then the one that can has merit.

Well, I've previously proposed a solution that supported lenient servers
(changing the Finished hashes unconditionally on a renegotiation, but using
extensions for signalling). That doesn't change my mind that a lenient
server policy is a bad idea.

-- 
David-Sarah Hopwood  ⚥  http://davidsarah.livejournal.com