Re: [TLS] [EXTERNAL] Re: Narrowing allowed characters in ALPN ?

Nick Harper <ietf@nharper.org> Thu, 20 May 2021 18:53 UTC

Return-Path: <nharper@nharper.org>
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 845A93A2222 for <tls@ietfa.amsl.com>; Thu, 20 May 2021 11:53:07 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.897
X-Spam-Level:
X-Spam-Status: No, score=-1.897 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 cw4ndXbwSVMn for <tls@ietfa.amsl.com>; Thu, 20 May 2021 11:53:02 -0700 (PDT)
Received: from mail-vs1-f54.google.com (mail-vs1-f54.google.com [209.85.217.54]) (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 C0E813A2221 for <tls@ietf.org>; Thu, 20 May 2021 11:53:02 -0700 (PDT)
Received: by mail-vs1-f54.google.com with SMTP id q6so4889999vsp.13 for <tls@ietf.org>; Thu, 20 May 2021 11:53:02 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=9Hj9AN4bDRq3csCobh+uJ6XRCqPACqQBDEDqZgt6R24=; b=SUKaKdZW6sDWPxczRGhXz0rrjm2t6XuTF8FoTR6PMKqsJ03VS1rpDaTE2IIkyR0Pi2 r2VGDCbNzjnFcT6hcr4U3H2cR8L0Gruc2birD40sNSVLzEMndb5uMh/OkJA3/2vjo4Ki FLUXG1geRCboEirWF7KjY0shC0be1tYqa5Fc3YV9Y81tyS0MT5PMb+fVBnd53Rjn7haV Sr48mPK4ISTalcGj65frLcUpt2NIsIko3+LeVpj6ME/3193KdKdjK6HqV1uwZe4kLZJx EyfODaHeE2XTuJ6tkCLH0ZsVPKHaGKhPFuY62SJ0Fde5MNY5ehy5BMa/mKlhOxd29IfV J7jg==
X-Gm-Message-State: AOAM530U1e7fifm6eI8ddAkKHUYrnAXHoaMpytmkt6qBa3zSO7Ohxt13 EULFHbElZMXLK7qY13qqAI0bBh6rREz+H1rx40xEsvSnU61QW4I9
X-Google-Smtp-Source: ABdhPJwDlC85mymz/W36PdvGoGaB9p3hQgY/u5N3NInKJ7CwqiVOfvuvwdBb9glJZ4yu4NqhajiQvsOVqg77lIOvlXE=
X-Received: by 2002:a67:6a02:: with SMTP id f2mr5878013vsc.49.1621536781096; Thu, 20 May 2021 11:53:01 -0700 (PDT)
MIME-Version: 1.0
References: <CAKC-DJjSq2sVKsJphX4QQBHOBojnTVHNE-wkdnZyZtv8NiGpQA@mail.gmail.com> <B3472BAC-AB21-4E5F-B18D-DC7179E4EA8F@akamai.com> <YKX5vXDSHrvVzHy6@straasha.imrryr.org> <CAErg=HH5DfBpkPx48NKy4air1N1FKiwVCttYz5ddCfw+K3eQuA@mail.gmail.com> <DM6PR00MB0713CB495B3FFEFCA0DD95338C2A9@DM6PR00MB0713.namprd00.prod.outlook.com> <YKaWNfguJPyL1QSZ@straasha.imrryr.org> <CAErg=HFjOi5=u8pDA713MBDw2YLZczy0EYDzGN6DRH8OGPPOEw@mail.gmail.com> <YKaoKnrziIBON2Y5@straasha.imrryr.org>
In-Reply-To: <YKaoKnrziIBON2Y5@straasha.imrryr.org>
From: Nick Harper <ietf@nharper.org>
Date: Thu, 20 May 2021 11:52:50 -0700
Message-ID: <CACcvr=k=8-myYtCPshWoJPiz2gQE6_202_7vnxertAx624MnmA@mail.gmail.com>
To: tls@ietf.org
Content-Type: multipart/alternative; boundary="000000000000d3f40205c2c773a2"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/vUuUGMqNv9LH-vzdR2r9EwOXGqY>
Subject: Re: [TLS] [EXTERNAL] Re: Narrowing allowed characters in ALPN ?
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, 20 May 2021 18:53:08 -0000

On Thu, May 20, 2021 at 11:19 AM Viktor Dukhovni <ietf-dane@dukhovni.org>
wrote:

> On Thu, May 20, 2021 at 01:46:38PM -0400, Ryan Sleevi wrote:
>
> > > It is fine for the TLS protocol to not care, but the *standard* ALPN
> > > values in the IANA registry (that might then also appear in DNS
> > > zone files, configuration files, ...) a more restricted character
> > > set would actually be helpful.
> >
> > I'm a little torn here, because you've again mentioned usability and
> > interoperability suffer, but it's unclear if you're seeing that as a
> > generic statement or simply "with respect to configuring DNS zone files".
>
> At present, more the latter, but not exclusively so, since there are
> likely other places where operators might be recording choices of
> supported ALPN values in configuration files.
>
> > Saying BIDI, LTR/RTL or NFKC/NFKD are issues here is like saying TLS
> > wireprotocol version field itself suffers from left-to-right issues.
> Such a
> > statement makes no sense, because the version, like the ALPN, is a byte
> > string.
>
> And indeed at present also in the DNS wire format.  What's new, is that
> those values are now also going to be manipulated by operators in their
> presentation form, which gets rather unwieldy when the values happen to
> contain commas, double-quotes, control characters, ... let alone strings
> that in UTF-8 appear to be NFKD, BIDI, ...
>
> > We don't say that the TLS version is "COMBINING TILDE" (U+0303), we
> > say it's 0x03 0x03, or, if we want to make the string human readable, we
> > convert it to a value that has no relation to its wire representation -
> > such as "TLS 1.3"
>
> Of course, we all understand they're plain octet-strings.  But that does
> not help the poor operator trying to enter them into a config file or
> a web form.
>
> > The suggestion here, of restricting the registered set, seems like it
> > should equally be obvious as creating and amplifying interoperability
> > issues, rather than resolving them, because of the assumption again that
> > values will be ASCII, even though that's not what the wire protocol
> > assumes.
>
> I don't see a substantial risk that TLS stacks will start to not treat
> the ALPN string as an opaque byte string, it would take more code to do
> otherwise.
>
> > APIs, from the TLS implementation itself to those that expose or
> > rely on the TLS information (such as the Web APIs previously mentioned)
> > would, if such a path as you suggest here were adopted, no doubt assume
> > that despite the spec saying it's a byte string, it's in fact an ASCII
> > string.
>
> This is of course possible, but does not look like a substantial risk.
> And there's always GREASE.
>
> > This issue is, functionally, an example of that. It seems like the issue
> is
> > not at all related to the DNS wire format, which is perfectly happy with
> > this, but rather the configuration text syntax used with DNS, and not
> > wanting to do things like escape byte sequences.
>
> Correct, but more than just DNS, basically any data-at-rest
> serialisation of ALPN values in configuration files, or use
> with interactive data entry, ...
>
> > This is why it seems like it's simply a matter of being inconvenient,
> > but have I misunderstood and there's a deeper issue I've missed?
>
> The incovenience means that applications that process SVCB/HTTPS data
> entered by users need much more complex and easier to mess up parsers.
>
> Since the likelihood of actually adding exotic ALPN values to the
> registry appears slim, why not say so.  That would leave the exotic
> values for private on-the-wire use, while allowing DNS and other
> configuration serialisation forms to avail themselves of more
> straight-forward parsers.
>

Encoding ALPN identifiers in hex for these configuration files sounds like
a very straightforward way to support all valid ALPN identifiers. We
already have "exotic" ALPN identifiers in the registry (for GREASE). Any
new scheme that handles ALPN should be designed to handle all possible
values. Not doing so will lead to interoperability issues that others have
already mentioned.

>
> --
>     Viktor.
>
> _______________________________________________
> TLS mailing list
> TLS@ietf.org
> https://www.ietf.org/mailman/listinfo/tls
>