Re: [TLS] Request for review: Next Protocol Negotiation Extension

Adam Barth <ietf@adambarth.com> Wed, 18 August 2010 20:59 UTC

Return-Path: <ietf@adambarth.com>
X-Original-To: tls@core3.amsl.com
Delivered-To: tls@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 67A5B3A6A00 for <tls@core3.amsl.com>; Wed, 18 Aug 2010 13:59:31 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.758
X-Spam-Level:
X-Spam-Status: No, score=-1.758 tagged_above=-999 required=5 tests=[AWL=0.219, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622]
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 Pmyx+zD0bK17 for <tls@core3.amsl.com>; Wed, 18 Aug 2010 13:59:30 -0700 (PDT)
Received: from mail-ew0-f44.google.com (mail-ew0-f44.google.com [209.85.215.44]) by core3.amsl.com (Postfix) with ESMTP id 03B5C3A6A1D for <tls@ietf.org>; Wed, 18 Aug 2010 13:59:29 -0700 (PDT)
Received: by ewy22 with SMTP id 22so806766ewy.31 for <tls@ietf.org>; Wed, 18 Aug 2010 14:00:04 -0700 (PDT)
Received: by 10.213.34.3 with SMTP id j3mr2536648ebd.81.1282165204529; Wed, 18 Aug 2010 14:00:04 -0700 (PDT)
Received: from mail-iw0-f172.google.com (mail-iw0-f172.google.com [209.85.214.172]) by mx.google.com with ESMTPS id a48sm1217610eei.0.2010.08.18.14.00.03 (version=SSLv3 cipher=RC4-MD5); Wed, 18 Aug 2010 14:00:03 -0700 (PDT)
Received: by iwn3 with SMTP id 3so1085308iwn.31 for <tls@ietf.org>; Wed, 18 Aug 2010 14:00:02 -0700 (PDT)
Received: by 10.231.168.211 with SMTP id v19mr7136194iby.175.1282165202170; Wed, 18 Aug 2010 14:00:02 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.231.60.18 with HTTP; Wed, 18 Aug 2010 13:59:42 -0700 (PDT)
In-Reply-To: <F91CB64B-E0F6-42B7-B91B-F9F7464709E1@iki.fi>
References: <AANLkTi=5H_0hGzxMmfNU0hLS=5psW6J3c2to756OT--7@mail.gmail.com> <4C69938A.9080808@gnutls.org> <AANLkTin3eQHNJPuVuVw09FbPUF4RBk7n9RFbc7EaFbM+@mail.gmail.com> <AANLkTi=dfCZNndm678OFkCZdzRhzfmRvBmZVLUD5-ueF@mail.gmail.com> <4C6AB936.1070801@extendedsubset.com> <AANLkTimgjqQMdwqL_xZXGSG5hSMLqDtYH62t698e_hx9@mail.gmail.com> <4C6AD7EA.4040307@extendedsubset.com> <000401cb3e4f$456f6d60$d04e4820$@briansmith.org> <4C6B1BAA.5060303@pobox.com> <AANLkTi=QzEmzuhX=rKkTFjVvWxP5r_0zcVHq00L-4JoS@mail.gmail.com> <4C6B8189.5080406@extendedsubset.com> <AANLkTi=9TLG4f5eZ6h6duYKvcVueT53H26WNZpWV6TKS@mail.gmail.com> <F91CB64B-E0F6-42B7-B91B-F9F7464709E1@iki.fi>
From: Adam Barth <ietf@adambarth.com>
Date: Wed, 18 Aug 2010 13:59:42 -0700
Message-ID: <AANLkTi=TmbOiLCpiOWyxXSDs-z-V5Bw7w=gLtvoerAvy@mail.gmail.com>
To: "tls@ietf.org" <tls@ietf.org>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Subject: Re: [TLS] Request for review: Next Protocol Negotiation Extension
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.9
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/listinfo/tls>, <mailto:tls-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/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: Wed, 18 Aug 2010 20:59:31 -0000

On Wed, Aug 18, 2010 at 2:37 AM, Juho Vähä-Herttua <juhovh@iki.fi> wrote:
> On 18.8.2010, at 11.42, Adam Barth wrote:
>> Thanks for your feedback.  This looks to be an area in which we can
>> improve the extension.
>
> This is a serious concern so far, since if the selected_protocol is not very well defined, two different users of the NPN extension might be conflicting. I don't know if using the port assignments is a good idea, since there are many undocumented and conflicting port uses as well. On the other hand a string identifier just feels a bit dirty...

It seems likely we'd want an IANA registry to avoid conflicts, similar
to the HTTP header registry.

> If that handshake is garbage, are there similar plans to "fix" the plain HTTP version of WebSockets, or is the plan that NPN would be used with TLS and the old handshake is used with HTTP? This sounds like it makes the life of WebSockets implementors a much harder, since they have to consider two completely different schemes, wouldn't it?

The plan is to remove the HTTP version.

> Since the plan of NPN is to improve the security of WebSockets, what kind of attacks it protects against, compared to simply having the HTTP style handshake negotiation inside a secure TLS connection?

Cross-protocol attacks, as described above.  I know the thread has
gotten pretty long, but hopefully you'll be able to find the answer
now that you have the key words.

> I understand that the protocol is much "cleaner" in a way with NPN, but in case it is to be used the earlier concerns about selecting a correct certificate based on the protocol type are valid as well. I think having the NextProtocol handshake message before the ChangeCipherSpec and using renegotiation in case the contents need to be protected could be considered.

Indeed.  That does seem worth considering.

> Sorry if some questions are already answered, this is a long thread and I haven't read all the messages that carefully. I'm just trying to sum up here what I've seen so far.

Yeah, I imagine this thread is pretty unapproachable at this point.  :-/

On Wed, Aug 18, 2010 at 1:47 PM, Nathaniel W Filardo <nwf@cs.jhu.edu> wrote:
> I realize this is the TLS mailing list, but...
>
> WebSockets are, AFAIK, designed to have a mandatory HTTP-alike header
> specifically so that they can be discriminated from HTTP without requiring
> any lower level identification being necessary (though apparently the drafts
> of the WS specification are less than perfect about maintaining this
> guarantee).  In any case, this ought to render any concerns of being unable
> to make WS connections while still making HTTPS connections moot; they can
> _already_ be intermixed on port 443.  Moreover, cross-protocol attacks do
> not require the advanced control present in WS (though surely it helps);
> HTTP has proven to be sufficiently useful to carry out cross-protocol
> attacks against both SMTP and IRC servers.  It seems odd to me that secure
> WS is the forcing issue here.

Browser vendors do not want to add more attack surface.  We're stuck
with HTTP, but that doesn't mean we should add more protocols that
make the same security mistakes.

> It also seems very odd to me that this is being viewed as a TLS-only thing.
> Cross-protocol attacks are not limited to the world of secured TLS streams
> (see above), and TCP ports are not in fact protocol identifiers, despite
> some traditions that conflate the two concepts.  If cross-protocol attacks
> are a concern (and I'm not saying they're not), then TLS NPN is necessary
> but insufficient -- the outer layers and insecure links must also be
> protected.

We're not trying to solve cross-protocol attacks for every protocol in
the work.  We're trying to design a new protocol that is immune to
cross-protocol attacks.

> Further, protocols inside TLS are already implicitly weakly protected if the
> endpoints require authentication.  There isn't any way that my web browser
> can carry out an HTTPS cross-protocol attack against an SMTPS server, unless
> the attacker already knows the appropriate SMTP credentials or I have client
> certs accepted by the SMTPS server loaded in my browser.  Any attempt the
> browser makes at authenticating via HTTP mechanisms is going to be ignored
> by the SMTPS server.  If I require STARTTLS for SMTP, I'm in an even better
> position than if I were using just SMTPS, as the client cert issue is gone.
> (Would that the HTTP world actually believed in Upgrade: for starting TLS!)

That's not an accurate understanding of how cross-protocol attacks
work.  Whether or not we're inside a TLS tunnel, the issues are the
same.  One way to understand this is to think about a VPN.  Clearly it
doesn't matter whether the cross-protocol attacks are taking place
inside an IPv6 tunnel, does it?

> Are there, in fact, attempts to mark sender's intended protocol outside of
> TLS being concurrently worked on (perhaps by extending the use of IPv6's
> Next Header field across the TCP header)?  If not, why should we believe
> that standardization and adoption of a TLS-only NPN will help much at all?

I'd in fact prefer to use IPv6, but WebSockets must work with IPv4.

Kind regards,
Adam