Re: [TLS] How ALPN makes the http2-tls-relaxed option less secure, compared to NPN (was Re: ALPN concerns)

Alfredo Pironti <> Mon, 09 December 2013 16:40 UTC

Return-Path: <>
Received: from localhost ( []) by (Postfix) with ESMTP id 260981AE30B for <>; Mon, 9 Dec 2013 08:40:45 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.379
X-Spam-Status: No, score=-1.379 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, SPF_PASS=-0.001] autolearn=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id e_S2BKNWLGeN for <>; Mon, 9 Dec 2013 08:40:43 -0800 (PST)
Received: from ( [IPv6:2607:f8b0:4003:c01::22a]) by (Postfix) with ESMTP id 6F6411AE359 for <>; Mon, 9 Dec 2013 08:40:42 -0800 (PST)
Received: by with SMTP id wp18so4020584obc.29 for <>; Mon, 09 Dec 2013 08:40:38 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=TImCgECTtdKxvu6tTWVcMsFNz976GQhgLM7qe/UW2Ds=; b=gw7YZOd8NU/S8eacwd10dm3ns/+AmiWDB6AYpd/o/d9Liw6yr1cAKzRGtuOuHZHqct +qbsJEl4tlgfU4+rWImhuMLvTO4we2/O7RHFAjlNUPFeo1TrPu1LPYg75eHqXrNJLc9V BL7u89mRn72DfNP7ifvtgwmmGyBvDSp+RXurk=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=TImCgECTtdKxvu6tTWVcMsFNz976GQhgLM7qe/UW2Ds=; b=eZcg9DtDQyZ2/3z1k7d3AoDoPXRj06x9SJmLP5tZQxvJch6s2mCtsp0mdch4qTt8E9 RmhLGoL7a1UT0Ss/a4r176zHCfBztV0ua7ss0j4uAAI66vcpJJOHVdC/vhQPPAWdaDSG vg8gG3l0SIOTFOnj+udBftOJwHZ3/WzDdgCGAr5Ong1P6CstDrKBSqs5UqDKVEkx2jDT DdhGBjJBachMTmjRXXI/2jChO6pn1A7WqEOozBA+XzZJWjufnYYittJaBcdxaNd28w8m 3ZhQNoZvmRiCS8oStB4EorMStkZ7dDYNhwymmhyOmjohq1uYgojdMZ7nMhrTcRiWXiqF JuIg==
X-Gm-Message-State: ALoCoQm140cN079zTIBbjTczbwvQrUDp2oxCKAZVLcjmNuZpPkHtobIS0/MvCfr3z7gdczV+XpLd
MIME-Version: 1.0
X-Received: by with SMTP id k8mr13378604oex.7.1386607237855; Mon, 09 Dec 2013 08:40:37 -0800 (PST)
Received: by with HTTP; Mon, 9 Dec 2013 08:40:37 -0800 (PST)
X-Originating-IP: []
In-Reply-To: <>
References: <> <> <>
Date: Mon, 9 Dec 2013 17:40:37 +0100
Message-ID: <>
From: Alfredo Pironti <>
To: Brian Smith <>
Content-Type: text/plain; charset=UTF-8
Cc: Peter Gutmann <>, "<>" <>
Subject: Re: [TLS] How ALPN makes the http2-tls-relaxed option less secure, compared to NPN (was Re: ALPN concerns)
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Mon, 09 Dec 2013 16:40:45 -0000

Hi Brian,

Thanks for clarifying, I now understand the use case you were
referring to. I especially missed case 1. I have further comments,
that I put inline.

On Mon, Dec 9, 2013 at 5:10 PM, Brian Smith <> wrote:
> On Mon, Dec 9, 2013 at 7:23 AM, Alfredo Pironti <> wrote:
>>> The case where the server does not use a certificate that the client
>>> would verify correctly as it would in the "normal" HTTPS case is not
>>> interesting. However, the case where opportunistic encryption is being
>>> used with a certificate that *is* valid (as defined by RFC5280, et
>>> al.) is interesting.
>> I think this pre-condition makes your counter-example invalid.
>> A client that only accepts valid certificates is in practice only
>> implementing http2, not http2-tls-relaxed, in that client's behavior
>> doesn't change.
> Let's say the client is connecting to using TLS. There
> are two interesting possibilities:
> 1. The client could be resolving an http:// link that uses
> opportunistic encryption. In this case, if the client supports
> opportunistic encryption, the client would support "http2-tls-relaxed"
> and "http2-tls" (and "http1-tls") and a MitM attack, if attempted,
> would succeed.
> 2. The client could be resolving an https:// link. In this case, the
> client would only support "http2-tls" (and "http1-tls") and a MitM
> attack, if attempted, would fail in a end-user-notable way.
> With ALPN, it is trivial for the MitM to determine which case it is
> and act accordingly. With NPN, it is not trivial (it requires
> correlating data from multiple connections) and in many cases it may
> be impossible (e.g. when an HTTP cache has stored the response with
> the alternate-service upgrade header).

With ALPN, the client could always send both "http2-tls-relaxed" and
"http2", making its behavior indistinguishable in cases 1 and 2. Isn't
this enough to make your attacker desist?

For functionality, you may say that allowing "http2-tls-relaxed" in
case 2 may lead the server to send an invalid certificate when it
could have sent a valid one (and so one needs to distinguish the two
cases). Do we have a realistic scenario of this? I mean: a server that
prefers a "mitm-able" connection over a more secure one. A case where
the server would send a invalid certificate to disguise its identity
doesn't seem to work, because any further "http2"-only connection
(from any unauthenticated client) may reveal its identity anyway.

(I don't want to defend ALPN at all costs, but maybe what I propose is
enough to satisfy your use case? I'd prefer to conceal the upper
protocol from the attacker, but this has to be done at the same
security that other TLS-protected data get, and I find NPN does not
quite achieve this.)


>> Indeed, but under the assumption that only valid certificates are
>> accepted, the behaviors coincide to "http2".
> In the case of opportunistic encryption, we would support both valid
> and invalid certificates. In the case of normal "http2-tls" and
> "http1-tls", we would support only valid certificates.
> Cheers,
> Brian
> --
> Mozilla Networking/Crypto/Security (Necko/NSS/PSM)