Re: [TLS] tls-flags: abort on malformed extension

Sean Turner <sean@sn3rd.com> Thu, 21 October 2021 16:40 UTC

Return-Path: <sean@sn3rd.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 AFF633A059F for <tls@ietfa.amsl.com>; Thu, 21 Oct 2021 09:40:39 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.099
X-Spam-Level:
X-Spam-Status: No, score=-2.099 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=sn3rd.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 W-AwjKH-pAzb for <tls@ietfa.amsl.com>; Thu, 21 Oct 2021 09:40:35 -0700 (PDT)
Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D10143A09E5 for <tls@ietf.org>; Thu, 21 Oct 2021 09:40:14 -0700 (PDT)
Received: by mail-qt1-x831.google.com with SMTP id n2so1041449qta.2 for <tls@ietf.org>; Thu, 21 Oct 2021 09:40:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sn3rd.com; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=GQ7eswIOtIaTce5QcsukIVwnMzIRyR3guKQHVuIyXgI=; b=VkqV9ugpLPkKqv5eoLFHeLTvPOzb0FtlwAmwnA7ZAeavZVJMzlplSr3mZ6U15D1oaI S62Imdig94wdBwk2G+AlKJB402cICVCc1+Huc4PP9s62Lfre0eVG7K4zDO/fbVnOrOwQ 73XaasCly58q8js/mFhBqaBAYilQy+225AlFE=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=GQ7eswIOtIaTce5QcsukIVwnMzIRyR3guKQHVuIyXgI=; b=JQHfWHn6XZ/gF1OfpPcELlWgyRpoqkA1SNjruwa2Qu1sB6kurgcqSBnSX+q//AW6LZ VNklDU5vs5Eh9YmYSkK3/JUSLyQiUNCD6YcgTpywMwgHAcegpzGLOr3cuqXiI1E1jlRP Agen/gNyM8gUCpTJGR3YZBdLKX7173KimmlyQpEBaHsVz3+n/LARR/yD/9ObbwYbxlRh BnUeA+jI7lxvYx6qH+0UYxjD93pmipEd0bcEAvG3tyEQI3r9zCghyUkbN0te2EbunDQS lnOgde3OUESLpfpnb57M9Ym/PHZdWDfZnbnO3ngOL2gUFm5FeB9b2qaIlYQIgDh3bRz1 Ha4g==
X-Gm-Message-State: AOAM531eEWzaGn5g+DjUp8AIOqVsyLvL5C5Fgptb9EQNpKlxYY2nNDHK kqH0h4O64BMYIHBa6epbxkrzfe2U6pUwjg==
X-Google-Smtp-Source: ABdhPJyYj6erbg1FkUs9iIXR6kCXDWmS3Fz96JgjQZTnFslEZyq4JtUa1YUYGwS/J5JEIauIgab5SA==
X-Received: by 2002:ac8:7f8c:: with SMTP id z12mr7257846qtj.292.1634834412071; Thu, 21 Oct 2021 09:40:12 -0700 (PDT)
Received: from smtpclient.apple (pool-71-178-177-131.washdc.fios.verizon.net. [71.178.177.131]) by smtp.gmail.com with ESMTPSA id g23sm2646208qtu.5.2021.10.21.09.40.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Oct 2021 09:40:11 -0700 (PDT)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\))
From: Sean Turner <sean@sn3rd.com>
In-Reply-To: <E595452A-31F6-4FF9-8BF3-ADF0E6377832@gmail.com>
Date: Thu, 21 Oct 2021 12:40:10 -0400
Cc: TLS List <tls@ietf.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <F677E7A4-79FE-4075-BB2C-99F22C09C89F@sn3rd.com>
References: <5BFCE990-52C0-4C0C-BD8A-AC3DB0A48084@gmail.com> <E37094D9-A40B-4E7B-BE6B-0AE16F0E0C64@gmail.com> <E595452A-31F6-4FF9-8BF3-ADF0E6377832@gmail.com>
To: Yoav Nir <ynir.ietf@gmail.com>
X-Mailer: Apple Mail (2.3654.120.0.1.13)
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/Cd-FpPlLfxBA9AbTu4dEevfznTA>
Subject: Re: [TLS] tls-flags: abort on malformed extension
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, 21 Oct 2021 16:40:41 -0000

Yoav,

Thanks for moving this along.

spt

> On Oct 20, 2021, at 16:11, Yoav Nir <ynir.ietf@gmail.com> wrote:
> 
> Hi.
> 
> I updated the PR.  If there are no further objections, I will commit and submit a new version in time for the submission deadline.
> 
> Yoav
> 
> 
>> On 7 Oct 2021, at 21:37, Yoav Nir <ynir.ietf@gmail.com> wrote:
>> 
>> Since I prefer to have the discussion in a single place, I’m copying below a comment by David Benjamin from GitHub:
>> 
>>> On 28 Aug 2021, at 23:36, Yoav Nir <ynir.ietf@gmail.com> wrote:
>>> 
>>> Hi.
>>> 
>>> To address Michael StJohns comment from 19-July, I submitted PR #12:
>>> 
>>> https://github.com/tlswg/tls-flags/pull/12
>>> 
>>> What is says is that any implementation receiving a malformed tls_flags extensions should abort the handshake. The text provides a list (which I hope is comprehensive) of all the ways this specific extension can be malformed. 
>>> 
>>> Please comment here or on the PR is this makes sense to everybody.
>> 
>> 
>> My proposed text:
>> 
>>>    An implementation that receives an invalid tls_flags extension MUST 
>>>    terminate the TLS handshake with a fatal illegal_parameter alert. 
>>>    Such invalid tls_flags extensions include: 
>>>     * zero-length extension
>>>     * Multiple tls_flags extensions for the same message
>>>     * A flag set in the tls_flags extension of the wrong message, as 
>>>       specified in the document for that flag     
>> 
>> 
>> 
>> David’s comment about the zero-length extension:
>>> If we want this to be invalid, we can put it in the TLS presentation language. Change FlagExtensions to:
>>> 
>>>       struct {
>>>          opaque flags<1..255>;
>>>       } FlagExtensions;
>> 
>> 
>> David’s comment about the multiple extensions:
>>> RFC8446 already prohibits this on the sender. We don't do a good job of defining the rules for the receiver, but that should probably be done uniformly across all extensions, rather than just in this one
>> 
>> 
>> David’s comment about the flag on the wrong message:
>>> This seems unimplementable. If I receive a message with a flag I don't recognize, I have no idea whether the flag is allowed in the message or not. Yet this text says I MUST enforce this rule. (There's probably some corresponding wording in RFC8446 we can borrow.)
>>> 
>>> Nit: It also seems better to phrase this in terms of the registry, rather than the document. We might have multiple documents for the flag if we have to update it.
>> 
>> OK, so now my response:
>> 
>> I agree with the first and second comments. About the third, what I meant was that a supported flag that is supposed to appear only in CH appears instead and CR, or more likely, a flag that should appear in EE apears in SH instead.
>> 
>> But I think the best way to resolve the issue is to remove the bullet point list and the last sentence before them, IOW: remove the examples.
>> 
>> If this is agreeable to everyone, I will modify it in my PR.
>> 
>> Yoav
> 
> _______________________________________________
> TLS mailing list
> TLS@ietf.org
> https://www.ietf.org/mailman/listinfo/tls