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

Martin Rex <mrex@sap.com> Thu, 26 November 2009 18:32 UTC

Return-Path: <mrex@sap.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 AB9893A6A88 for <tls@core3.amsl.com>; Thu, 26 Nov 2009 10:32:01 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.184
X-Spam-Level:
X-Spam-Status: No, score=-6.184 tagged_above=-999 required=5 tests=[AWL=0.065, BAYES_00=-2.599, HELO_EQ_DE=0.35, RCVD_IN_DNSWL_MED=-4]
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 wqHBxoafvgj9 for <tls@core3.amsl.com>; Thu, 26 Nov 2009 10:32:01 -0800 (PST)
Received: from smtpde03.sap-ag.de (smtpde03.sap-ag.de [155.56.68.140]) by core3.amsl.com (Postfix) with ESMTP id A68CD3A6801 for <tls@ietf.org>; Thu, 26 Nov 2009 10:32:00 -0800 (PST)
Received: from mail.sap.corp by smtpde03.sap-ag.de (26) with ESMTP id nAQIVs1v016192 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 26 Nov 2009 19:31:54 +0100 (MET)
From: Martin Rex <mrex@sap.com>
Message-Id: <200911261831.nAQIVrqb017425@fs4113.wdf.sap.corp>
To: david-sarah@jacaranda.org
Date: Thu, 26 Nov 2009 19:31:53 +0100
In-Reply-To: <4B0EBF04.7090708@jacaranda.org> from "David-Sarah Hopwood" at Nov 26, 9 05:46:44 pm
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Scanner: Virus Scanner virwal06
X-SAP: out
Cc: tls@ietf.org
Subject: Re: [TLS] Quest for Unified Solution to TLS Renegotiation
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
Reply-To: mrex@sap.com
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 18:32:01 -0000

David-Sarah Hopwood wrote:
> 
> > 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.

ClientHello is the first handshake message on a connection
that re-initialized the handshake message hash.
If an implementation doesn't get that correct, then it is
an obvious bug of the implementation.

As an additional safety feature, the finished label for
secure renegotiations could be modified.

> 
> 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.

I also believe it isn't practical to find a collision with a 24-byte
correctly encoded no-op handshake message (i.e. one that does not
adversly affect the handshake state), but if we can avoid it,
we should avoid it.

verify_data is not predictable, even for those TLS session where
the MitM is an original server or client. 

Thanks for identifying this issue, even when it currently
does not appear as a practical attack.

explicitly inserting the header of a finished message (0x14 0x00 0x00 0x19)
in front of the verify_data might help, because this is something that
an attack does not want to insert after a ServerHello handshake
message (oh yeah, one with an odd length field).


-Martin