Re: [TLS] Quest for Unified Solution to TLS Renegotiation

David-Sarah Hopwood <david-sarah@jacaranda.org> Thu, 26 November 2009 17:46 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 05C053A6A9C for <tls@core3.amsl.com>; Thu, 26 Nov 2009 09:46:50 -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 JEIjlV+LUsiG for <tls@core3.amsl.com>; Thu, 26 Nov 2009 09:46:49 -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 914EE3A67E4 for <tls@ietf.org>; Thu, 26 Nov 2009 09:46:48 -0800 (PST)
Received: by ewy6 with SMTP id 6so1032582ewy.29 for <tls@ietf.org>; Thu, 26 Nov 2009 09:46:39 -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=HgeJCeno9ZMBg26a1mZKiTg8j2iMtIKK2NxWOGaRqFo=; b=qQUuVr/DZtRokJ0Irgs0DEm0ZlhsiKbqsu592TwlzYEojmPEkwWJpQEO2A3g0vsDvE CsxT8STYQp9EbFMkWk+y9+Q3c9FfmOTt3yeae/Vqik9IK18vlXMPx1oqtr4Q5wmTHmY9 04h3xAwVUajXf1h39zH8G8TLMolBwTEeu2p78=
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=sAfkb0Y0OIhMMBqPvNK7hwYY1A0UQUC/uW5GDPv8M/rV1L2IekW4zo+o+wfSMNDgx7 zqzc0Xq04MkP3HtTtRylD/rvZWn3bh5hhjRXvE1GCCcQYezLtp4BG5QAOaVttdLbkbuK i0PuvQQ2vBklX8fweUlcroOdd98sawRewTYJw=
Received: by 10.213.0.216 with SMTP id 24mr1161229ebc.10.1259257599072; Thu, 26 Nov 2009 09:46:39 -0800 (PST)
Received: from ?192.168.0.2? (5adcc5d2.bb.sky.com [90.220.197.210]) by mx.google.com with ESMTPS id 16sm444928ewy.6.2009.11.26.09.46.37 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 26 Nov 2009 09:46:38 -0800 (PST)
Sender: David-Sarah Hopwood <djhopwood@googlemail.com>
Message-ID: <4B0EBF04.7090708@jacaranda.org>
Date: Thu, 26 Nov 2009 17:46:44 +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: <200911260735.nAQ7ZbYP003893@fs4113.wdf.sap.corp>
In-Reply-To: <200911260735.nAQ7ZbYP003893@fs4113.wdf.sap.corp>
X-Enigmail-Version: 0.96.0
Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="------------enig8137181FFBC3C758BD721598"
Subject: Re: [TLS] Quest for Unified Solution to TLS Renegotiation
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: Thu, 26 Nov 2009 17:46:50 -0000

Martin Rex wrote:
> David-Sarah Hopwood wrote:
>> The old verify_data should not just be appended to the handshake_messages
>> without any further encoding, though, because it might match the bytes
>> of some valid handshake message. In that case, there is the possibility
>> that a MITM might insert the old verify_data into the stream sent to
>> one peer, as though it were a handshake message. If that peer is using
>> the unmodified Finished computation (either because it is unpatched or
>> it is doing an initial handshake), then it may end up computing the same
>> Finished hash as the other peer that is using the modified computation.
>>
>> I haven't gone through the details of this attack thoroughly enough
>> to be sure it will work, but it is too near working for comfort.
> 
> OK.  you got a point!
> 
> It's true that there is a theoretical attack.
> 
> So Mikes idea to always add a length to the hash
> (and therefore also change the initial handshake between
> updated peers) was not so bad after all.
> 
>> 2. Add the old verify_data to handshake_messages preceded by the encoding
>>    of a fatal alert. Then, attacks of the kind described above can't work
>>    because the unpatched peer would first process the alert and abort the
>>    handshake.
> 
> Alerts are no handshake messages, so that doesn't work.

You're right, the attacker could just omit the alert.

> different possibilities:
>   - add a bodyless-finished message to the beginning of the handshake
>     message hash of a secure renegotiation before the ClientHello
>     a position where the attacker can not insert handshake messages

It's not clear to me that the attacker can't insert handshake messages
there. If an implementation normally ignores handshake messages with an
unrecognized HandshakeType, then it is likely to ignore them before the
ClientHello as well.

For a random 24-byte string, the HandshakeType has a 246 in 256 ~= 96%
probability of being unrecognized, but then the length is a uint24,
and the attacker needs it to encode the number 20 in order for the
attack to work as I described it. So this attack almost certainly isn't
practical, but we should be sure to prevent it rather than relying on
probabilities.

>   - add something different to both handshake message hashes
>     before adding the verify_data to the renegotiation handshake
>     message hash
>   - frame the Client.Finished.verify_data plus
>     Server.Finished.verify_data as a Finished message
>   - signal initial and renegotiation handshakes differently in the
>     handshake

I'll have to think about these more carefully.

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