Re: [xmpp] #39: prohibition on TLS renegotiation

Peter Saint-Andre <stpeter@stpeter.im> Tue, 06 July 2010 16:54 UTC

Return-Path: <stpeter@stpeter.im>
X-Original-To: xmpp@core3.amsl.com
Delivered-To: xmpp@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 2FDFB3A6838 for <xmpp@core3.amsl.com>; Tue, 6 Jul 2010 09:54:16 -0700 (PDT)
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 H7RHr28xvgYi for <xmpp@core3.amsl.com>; Tue, 6 Jul 2010 09:54:15 -0700 (PDT)
Received: from stpeter.im (stpeter.im [207.210.219.233]) by core3.amsl.com (Postfix) with ESMTP id E9E3D3A67F4 for <xmpp@ietf.org>; Tue, 6 Jul 2010 09:54:14 -0700 (PDT)
Received: from dhcp-64-101-72-121.cisco.com (dhcp-64-101-72-121.cisco.com [64.101.72.121]) (Authenticated sender: stpeter) by stpeter.im (Postfix) with ESMTPSA id E5AFE40E36 for <xmpp@ietf.org>; Tue, 6 Jul 2010 10:54:16 -0600 (MDT)
Message-ID: <4C335FB7.2030806@stpeter.im>
Date: Tue, 06 Jul 2010 10:54:15 -0600
From: Peter Saint-Andre <stpeter@stpeter.im>
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4
MIME-Version: 1.0
To: xmpp@ietf.org
References: <057.cd3487385f077266653b25eecf323b0d@tools.ietf.org> <4C27CFDC.4060701@stpeter.im> <87lj9re7r2.fsf@mocca.josefsson.org> <4C335537.6070605@stpeter.im>
In-Reply-To: <4C335537.6070605@stpeter.im>
X-Enigmail-Version: 1.0.1
OpenPGP: url=http://www.saint-andre.com/me/stpeter.asc
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg="sha1"; boundary="------------ms090408040304030508010506"
Subject: Re: [xmpp] #39: prohibition on TLS renegotiation
X-BeenThere: xmpp@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: XMPP Working Group <xmpp.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/xmpp>, <mailto:xmpp-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/xmpp>
List-Post: <mailto:xmpp@ietf.org>
List-Help: <mailto:xmpp-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/xmpp>, <mailto:xmpp-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 06 Jul 2010 16:54:16 -0000

On 7/6/10 10:09 AM, Peter Saint-Andre wrote:
> On 7/4/10 6:44 AM, Simon Josefsson wrote:
>> Peter Saint-Andre <stpeter@stpeter.im> writes:
>>
>>> On 6/21/10 6:11 PM, xmpp issue tracker wrote:
>>>> #39: prohibition on TLS renegotiation
>>>> --------------------------------+-------------------------------------------
>>>>  Reporter:  stpeter@…           |       Owner:  stpeter@…         
>>>>      Type:  defect              |      Status:  new               
>>>>  Priority:  minor               |   Milestone:                    
>>>> Component:  3920bis             |     Version:                    
>>>>  Severity:  In WG Last Call     |    Keywords:                    
>>>> --------------------------------+-------------------------------------------
>>>>  Regarding Section 5.2.5, Matthew Wild commented: "is it really desired to
>>>>  put a complete ban on any renegotiation?"
>>>
>>> Based on my conversations with TLS mavens and discussion in the TLS WG
>>> during the interminable threads on the renegotiation vulnerability, I
>>> would say: yes, it really is desired to put a complete ban on any
>>> renegotiation.
>>>
>>> Can you make an argument for why TLS renegotiation should be allowed in
>>> XMPP applications?
>>
>> I would not argue for permitting TLS renegotiation, but there ARE some
>> reasons for permitting TLS renegotiations:
>>
>> * Protect client credentials, i.e., first do server-authentication and
>>   then do client authentication in the protected channel.
>>
>> * Support sequence number wrapping (unlikely).  From 5246:
>>
>>    sequence number
>>       Each connection state contains a sequence number, which is
>>       maintained separately for read and write states.  The sequence
>>       number MUST be set to zero whenever a connection state is made the
>>       active state.  Sequence numbers are of type uint64 and may not
>>       exceed 2^64-1.  Sequence numbers do not wrap.  If a TLS
>>       implementation would need to wrap a sequence number, it must
>>       renegotiate instead.  A sequence number is incremented after each
>>       record: specifically, the first record transmitted under a
>>       particular connection state MUST use sequence number 0.
>>
>> * Refresh encryption keys.
>>
>> On the whole, I would agree that these small use-cases do not outweigh
>> the complexity in permitting renegotiation and that it is the right
>> decision.  But I wouldn't agree that it is a clear-cut obvious decision,
>> it is a careful trade-off.  Documenting why the decision has been made,
>> and its pros and cons, is useful.
> 
> Thanks for the clarifications. I agree that it would be good to explain
> the reasoning in more detail, so I'll add some text about that to the
> next version of the spec.

How is this for proposed text in Section 5.2.5? (The first paragraph is
unchanged; I've included here only to provide context.)

###

5.2.5.  Renegotiation

   XMPP entities MUST NOT attempt TLS renegotiation, and if either party
   to a TLS-protected stream detects a TLS renegotiation attempt it MUST
   immediately close the underlying TCP connection without returning a
   stream error (since the violation has occurred at the TLS layer, not
   the XMPP layer; see Section 13.3).

      Security Note: There are some rare cases in which TLS
      renegotiation might be justified, such as (1) refreshing
      encryption keys, (2) wrapping the TLS sequence number as explained
      in [TLS], and (3) protecting client credentials by completing
      server authentication first and then completing client
      authentication over the protected channel.  In the first two cases
      it is preferable to use an XMPP stream reset instead of performing
      TLS renegotiation.  The third case has slightly improved security
      characteristics when the TLS client (which might be an XMPP
      server) presents credentials to the TLS server, however that
      slight benefit is outweighed by the complexity of requiring
      implementations to support TLS renegotiation.

###