Re: [TLS] Verify data in the RI extension?

Eric Rescorla <ekr@networkresonance.com> Fri, 27 November 2009 19:26 UTC

Return-Path: <ekr@networkresonance.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 887BA3A6964 for <tls@core3.amsl.com>; Fri, 27 Nov 2009 11:26:44 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.066
X-Spam-Level:
X-Spam-Status: No, score=0.066 tagged_above=-999 required=5 tests=[AWL=0.048, BAYES_00=-2.599, FH_HOST_EQ_D_D_D_D=0.765, FH_HOST_EQ_D_D_D_DB=0.888, HELO_MISMATCH_COM=0.553, HOST_MISMATCH_NET=0.311, RDNS_DYNAMIC=0.1]
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 IGCqclI0oR8f for <tls@core3.amsl.com>; Fri, 27 Nov 2009 11:26:43 -0800 (PST)
Received: from kilo.networkresonance.com (74-95-2-169-SFBA.hfc.comcastbusiness.net [74.95.2.169]) by core3.amsl.com (Postfix) with ESMTP id BFE873A68F2 for <tls@ietf.org>; Fri, 27 Nov 2009 11:26:43 -0800 (PST)
Received: from kilo.local (localhost [127.0.0.1]) by kilo.networkresonance.com (Postfix) with ESMTP id BF0EF6C37E9; Fri, 27 Nov 2009 11:27:23 -0800 (PST)
Date: Fri, 27 Nov 2009 11:27:23 -0800
From: Eric Rescorla <ekr@networkresonance.com>
To: mrex@sap.com
In-Reply-To: <200911271634.nARGYKm1006390@fs4113.wdf.sap.corp>
References: <20091127161724.3DF546C37C8@kilo.networkresonance.com>
User-Agent: Wanderlust/2.15.5 (Almost Unreal) Emacs/22.3 Mule/5.0 (SAKAKI)
MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka")
Content-Type: text/plain; charset="US-ASCII"
Message-Id: <20091127192723.BF0EF6C37E9@kilo.networkresonance.com>
Cc: tls@ietf.org
Subject: Re: [TLS] Verify data in the RI extension?
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: Fri, 27 Nov 2009 19:26:44 -0000

At Fri, 27 Nov 2009 17:34:20 +0100 (MET),
Martin Rex wrote:
> 
> Eric Rescorla wrote:
> > 
> > At Fri, 27 Nov 2009 16:27:03 +0100 (MET),
> > Martin Rex wrote:
> > > 
> > > That problem can be trivially fixed.
> > > 
> > > We just memorize the non-encrypted Client.Finished and Server.Finished
> > > handshake messages in full, rather then just the contained verify_data.
> > 
> > Woah, that's scary....
> > 
> > We're going to take the exact messages that previously appeared on the
> > wire and inject them into the handshake hashes in order to *reduce*
> > ambiguity in the hash input stream? I mean, maybe that's OK, but it
> > sure isn't obviously OK.
> 
> What we would be doing is limiting the ambiguity with something
> arbitrary to the ambiguity with a very well-defined handshake
> message (actually, two of them).  

Hmm...

Thinking about this some more, consider the case of a client which
(improperly) ignores handshake messages which come out of sequence,
but still hashes them into handshake hashes.

In the simple attack where the server thinks there is a rehandshake
and the client thinks it is the initial handshake, what if the 
attacker between the client and the server injects the
replayed Client.Finished and Server.Finished messages into the message
stream going towards the client. The client would then ignore but hash
the messages with the result that the data hashed by the client being
the is the same as the data being hashed by the server and the attack
succeeds. Am I missing something here?

Obviously, one could just say that the client is misbehaving here
and so this doesn't matter (though I would note that others have expressed
concerns about what happens with implementation errors, and this is only
requires an error by one side, not both). However, I think it's illustrative
that we need to be pretty careful about introducing ambiguity between
messages that are on the wire and those that are merely hashed.

-Ekr