Re: [TLS] TLS 1.3 supported versions and downgrade protection

Benjamin Kaduk <bkaduk@akamai.com> Thu, 05 December 2019 17:35 UTC

Return-Path: <bkaduk@akamai.com>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1BE561208C0 for <tls@ietfa.amsl.com>; Thu, 5 Dec 2019 09:35:59 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.202
X-Spam-Level:
X-Spam-Status: No, score=-2.202 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, PDS_BTC_ID=0.499, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=akamai.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9wMZB2NieQtk for <tls@ietfa.amsl.com>; Thu, 5 Dec 2019 09:35:57 -0800 (PST)
Received: from mx0a-00190b01.pphosted.com (mx0a-00190b01.pphosted.com [IPv6:2620:100:9001:583::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1BCDC1208AB for <tls@ietf.org>; Thu, 5 Dec 2019 09:35:57 -0800 (PST)
Received: from pps.filterd (m0050093.ppops.net [127.0.0.1]) by m0050093.ppops.net-00190b01. (8.16.0.42/8.16.0.42) with SMTP id xB5HTHsK005244; Thu, 5 Dec 2019 17:35:56 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akamai.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : content-transfer-encoding : in-reply-to; s=jan2016.eng; bh=QVFQCWvscu3Zjt56ts4iyX1Yb7etnMVtCJqgouzAuJs=; b=DX696YzTQESVgph/+TF2GEj4qAjigz0IhZBTbQdod2AXrqW2FGuEPTAmH95uafV15YMK S7cqHmi04Mtf38Qy28ugdZTRXkPuOHssRXeK+v9KVmulqasW+lZ7OXHaEHkMeVukHAVs EjhKta5qBhJ6MOBb+oZq3XXU5OHQhV9wvUUG4oTHdNblke0G6+d3pxAsrqOP9Uxtu/nD aC4NZasMY44wFsidgPQw/5WeaExeyaGx6IbvnKcAGUZspYsx3hd+mQr5slrJqMypgIXS buK/7h+2jxXiw9b+msDwb79LPu1ductkgNQu80i7eEBfnDT/V1imDFjtWluLc0fQYnfk Ww==
Received: from prod-mail-ppoint6 (prod-mail-ppoint6.akamai.com [184.51.33.61] (may be forged)) by m0050093.ppops.net-00190b01. with ESMTP id 2wnk9tbeer-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 05 Dec 2019 17:35:56 +0000
Received: from pps.filterd (prod-mail-ppoint6.akamai.com [127.0.0.1]) by prod-mail-ppoint6.akamai.com (8.16.0.27/8.16.0.27) with SMTP id xB5HWS95022730; Thu, 5 Dec 2019 12:35:55 -0500
Received: from prod-mail-relay10.akamai.com ([172.27.118.251]) by prod-mail-ppoint6.akamai.com with ESMTP id 2wkmn3g9bp-1; Thu, 05 Dec 2019 12:35:55 -0500
Received: from bos-lpczi.kendall.corp.akamai.com (bos-lpczi.kendall.corp.akamai.com [172.19.17.86]) by prod-mail-relay10.akamai.com (Postfix) with ESMTP id 2D86C1FCD8; Thu, 5 Dec 2019 17:35:55 +0000 (GMT)
Received: from bkaduk by bos-lpczi.kendall.corp.akamai.com with local (Exim 4.86_2) (envelope-from <bkaduk@akamai.com>) id 1icv2f-0004hQ-Pd; Thu, 05 Dec 2019 09:35:53 -0800
Date: Thu, 05 Dec 2019 09:35:53 -0800
From: Benjamin Kaduk <bkaduk@akamai.com>
To: Daniel Van Geest <Daniel.VanGeest@isara.com>
Cc: "tls@ietf.org" <tls@ietf.org>
Message-ID: <20191205173553.GS3397@akamai.com>
References: <D4904384-8893-410A-A516-06B0226FFA4E@isara.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <D4904384-8893-410A-A516-06B0226FFA4E@isara.com>
User-Agent: Mutt/1.5.24 (2015-08-30)
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-12-05_05:, , signatures=0
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-1912050147
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-12-05_05:2019-12-04,2019-12-05 signatures=0
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 suspectscore=0 clxscore=1011 spamscore=0 impostorscore=0 mlxscore=0 adultscore=0 lowpriorityscore=0 mlxlogscore=999 malwarescore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1912050147
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/CcfIYqJGZZredO8CZOUjyNXS1FE>
Subject: Re: [TLS] TLS 1.3 supported versions and downgrade protection
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.29
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/options/tls>, <mailto:tls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/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, 05 Dec 2019 17:35:59 -0000

On Thu, Dec 05, 2019 at 05:30:10PM +0000, Daniel Van Geest wrote:
> Hi all,
> 
> I think there might be ambiguity or an interoperability issue with the TLS 1.3 ServerHello Random value downgrade protection and some (possibly?) legitimate negotiation of TLS 1.2 using the supported_versions extension.  Looking through RFC 8446 and the mail archives I don’t see anything that addresses this, maybe I’ve missed something?
> 
> RFC 8446 Section 4.1.3:
> 
>    TLS 1.3 has a downgrade protection mechanism embedded in the server's
>    random value.  TLS 1.3 servers which negotiate TLS 1.2 or below in
>    response to a ClientHello MUST set the last 8 bytes of their Random
>    value specially in their ServerHello.
> 
>    If negotiating TLS 1.2, TLS 1.3 servers MUST set the last 8 bytes of
>    their Random value to the bytes:
> 
>      44 4F 57 4E 47 52 44 01
> 
>    If negotiating TLS 1.1 or below, TLS 1.3 servers MUST, and TLS 1.2
>    servers SHOULD, set the last 8 bytes of their ServerHello.Random
>    value to the bytes:
> 
>      44 4F 57 4E 47 52 44 00
> 
>    TLS 1.3 clients receiving a ServerHello indicating TLS 1.2 or below
>    MUST check that the last 8 bytes are not equal to either of these
>    values.  TLS 1.2 clients SHOULD also check that the last 8 bytes are
>    not equal to the second value if the ServerHello indicates TLS 1.1 or
>    below.  If a match is found, the client MUST abort the handshake with
>    an "illegal_parameter" alert.
> 
> So whenever a TLS 1.3-capable server negotiates a TLS 1.2 or lower session it MUST set the appropriate Random values.
> 
> And a TLS 1.3 client MUST check for these values and abort if found. Future TLS versions aren’t mentioned so perhaps one of the use cases I’ll mention below is not a concern until the next version is defined and the behavior can be adjusted then.
> 
> Consider the potential cases for the ClientHello supported_versions values:
> 
> 
>   1.  supported_versions = { 0x0305 (TLS 1.4), 0x0303 (TLS 1.2) }
> Okay, TLS 1.4 doesn’t exist so maybe this can be addressed in the future.  If the server supports TLS 1.2 and TLS 1.3, it will negotiate TLS 1.2 and add the TLS 1.2 downgrade protection Random value.  The Client will see the TLS 1.2 version, check the downgrade protection and abort the connection.  But this is not a downgrade issue, this is the only mutually acceptable TLS version.

This is analogous to the case of wanting to support TLS 1.0 and 1.2 but not 1.1, which did (IIRC) get a little bit of discussion including from Andrei Popov.  My recollection is that we didn't really feel a need to support "gaps" in supported versions for this downgrade-protection scheme.

>   2.  supported_versions = { 0x0303 (TLS 1.2), 0x0304 (TLS 1.3) }
> The supported_versions list is in order of client preference, but it’s not required that the server respect the preference.  I’ve seen implementations which respect the client’s preference and ones which pick the highest mutually acceptable version.  If a server supports TLS 1.2 and TLS 1.3 and respects the client’s preference it will negotiate TLS 1.2 and add the downgrade protection random value.  The client would then abort the connection even though this would seem to be a legitimate non-downgrade situation  Or can we wave our hands at this and say if a client doesn’t prefer TLS 1.3 above TLS 1.2 then it’s not really a true Scotsman TLS 1.3 client and those MUSTs don’t really apply to it?.

I had forgotten that we implied a potential for client preference of supported versions.  We could perhaps debate whether it's "legitimate" for a server to prefer 1.2 over 1.3, but I think it's clear that (assuming the negotiation is protected by a full transcript hash, as in 1.3 or 1.2 with extended master secret) a server negotiating 1.2 in this case should not apply the downgrade-protection scheme.

-Ben