Re: [Doh] WG Review: DNS Over HTTPS (doh)

Mark Nottingham <mnot@mnot.net> Wed, 20 September 2017 22:28 UTC

Return-Path: <mnot@mnot.net>
X-Original-To: doh@ietfa.amsl.com
Delivered-To: doh@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A7620132026; Wed, 20 Sep 2017 15:28:22 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.721
X-Spam-Level:
X-Spam-Status: No, score=-2.721 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=mnot.net header.b=rQDGqjZ5; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=GnhypxkP
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 4Ag6u9HyNHPO; Wed, 20 Sep 2017 15:28:19 -0700 (PDT)
Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D1AAA1320D8; Wed, 20 Sep 2017 15:28:03 -0700 (PDT)
Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 3BC3620B87; Wed, 20 Sep 2017 18:28:03 -0400 (EDT)
Received: from frontend1 ([10.202.2.160]) by compute3.internal (MEProxy); Wed, 20 Sep 2017 18:28:03 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mnot.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=Lyqwr/20hcgWg9WZk1 MY1lU1b+idtDYMXZEt+MYdlic=; b=rQDGqjZ5PzHgL1/GFqEUjGIRGW1xF7KCS8 5lnL9TxeUsjH6HTZ3eG4OGSq/oLQT+MIU27fi2NsJoFXbEisRBI35gD2ZRf72W+r YqopOyDtdGKVdb6sTee8M0c1uWyFecMqRAYDGWxOvnH+B9JoyoMYsw5wLQiAqyU5 R5pdBKnalougSQzcq8zhvGVYksYcW+hnAB8/62b8yKnSAazbhyItf7plVM6eRhdR IDTwTdVkVC0hSM+WsnnEbhGhoeUAHaxyvjjd7Tn30emXczzCfAVrFmbF5H0Cq012 tbM65ucC+Jm9ROMEX+DiuBMZ3gggVimLtKdEe+V7EYHlUXOvqPew==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=Lyqwr/20hcgWg9WZk1MY1lU1b+idtDYMXZEt+MYdlic=; b=GnhypxkP p1X/c3SvrmxhOzFO1IVjdGHseoW+RMu0nvuyTPgkZHkjgEUfq2SwHbHcqFqFDRdF KQa0cvCkdv2eesY2xAvuJtKRZdt3PVvbfcIE9SoL6Z4zhkfXxXyUhAG/U61xBeuC XReL8uM0nKV3stopJqCBnDgQYBXuZXih8a0eyuzuPJoWKFpnpsPHt/qwqu3dryXd VzJDvY5iFj2Nq6IWEWxl+IEToNkyhsAwCukyLzDkyoCeoiVIbBNEsCW3usMzvzx/ jjwsQUnj1eU6t/70PguS6SI2UjhPYknzHbG/93wWsM500jXTU8dE0YXgzP341mJl mB5tIPmHlWcJEg==
X-ME-Sender: <xms:c-vCWadQ7Q7ofQMSyzxV81ZMVxpcPR9nmllt2UXljQFOvqR1aE0r3g>
X-Sasl-enc: jv70vaKIfJZx/KZpuAIRMpN0Rco9g5sCbwht2KihDaSI 1505946482
Received: from [192.168.1.14] (cpe-124-188-19-231.hdbq1.win.bigpond.net.au [124.188.19.231]) by mail.messagingengine.com (Postfix) with ESMTPA id CC6C97E202; Wed, 20 Sep 2017 18:28:00 -0400 (EDT)
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\))
From: Mark Nottingham <mnot@mnot.net>
In-Reply-To: <CA+9kkMBwgT39PjbfxD-wGBy2JDMJYOSVHPte0uRqYYzus6N0fg@mail.gmail.com>
Date: Thu, 21 Sep 2017 08:27:57 +1000
Cc: Adam Roach <adam@nostrum.com>, doh@ietf.org, Paul Hoffman <paul.hoffman@vpnc.org>, IETF <ietf@ietf.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <50B5D46F-CD7C-4D6A-8218-E8C0EB1A5C0A@mnot.net>
References: <150549029332.2975.12341647131707994474.idtracker@ietfa.amsl.com> <CA+9kkMBJAP23GmGf_ix-DMeOMB=Rbas+qsBQhrVwZuA5-Cv7Mg@mail.gmail.com> <EB3D58DB-1F8D-4E32-AE71-841EBCDDC3CA@vpnc.org> <42309404-8991-5d1d-7834-59087f273d41@nostrum.com> <CA+9kkMDokEDbBiCR_TRQda2RBHxoHag6mQL57Uzn7ALqakm1Og@mail.gmail.com> <e4a02fff-6803-28c7-c01d-f27a1b282d50@nostrum.com> <CA+9kkMCPRfjazW7Kk7GGnu1a0f2QNvgERV-5SGXWzp2HRmPJ=A@mail.gmail.com> <0EA5CC8C-D4B0-47F4-A8CF-950BDB1A1D55@mnot.net> <CA+9kkMDRdje0LTjAXLJkU6MeEP9tgJOmTjEP3jbtogyFtYYAwA@mail.gmail.com> <32479A66-5D72-48CF-8C33-2D131AEB2B5B@mnot.net> <CA+9kkMCHPO_VO8sO2YUFLHCw8fTKFwoB4-Jy3V22ODHjtVs5YA@mail.gmail.com> <89896E61-3275-4214-BEC5-59D40B6DDA4A@mnot.net> <CA+9kkMC=C9cW6wabYApNv9svN0DTCaWTHCedYgzbELdwqSasuQ@mail.gmail.com> <296AD098-5728-44E6-855F-91881359162C@mnot.net> <CA+9kkMBwgT39PjbfxD-wGBy2JDMJYOSVHPte0uRqYYzus6N0fg@mail.gmail.com>
To: Ted Hardie <ted.ietf@gmail.com>
X-Mailer: Apple Mail (2.3273)
Archived-At: <https://mailarchive.ietf.org/arch/msg/doh/xjSUFFKUOA55M75LDcZ2oCz8g5I>
Subject: Re: [Doh] WG Review: DNS Over HTTPS (doh)
X-BeenThere: doh@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: DNS Over HTTPS <doh.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/doh>, <mailto:doh-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/doh/>
List-Post: <mailto:doh@ietf.org>
List-Help: <mailto:doh-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/doh>, <mailto:doh-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 20 Sep 2017 22:28:23 -0000

On 21 Sep 2017, at 3:17 am, Ted Hardie <ted.ietf@gmail.com> wrote:
> 
>> Mind you, there's nothing special about the proposal on the table that makes it easier.
> 
> I have to disagree with this.  Standardizing this method should make this easier by having a common format produced by servers and consumed by clients.  

In the case you're concerned about -- hostile JS -- the server that hosts the malicious JS is the same party that produces the poisoned DNS response. Even if it's cross-origin, the attack implies that they're coordinating. Defining the wire format for those messages is trivial; I suppose we're doing a small amount of work for them, but that work isn't any barrier to the attack.

> So the scope of the problem is:  a malicious piece of JavaScript can embed a DNS service into a web page such that some resources can be retrieved using its resolution rather than the browser or system library.

No. The scope of the problem is that once someone malicious has Javascript executing within a context, it's effectively game over for that context. Much of the focus of Web Application Security over the last few years has been on reducing that attack surface, especially where it's not intentional (e.g., CSP). 

Again, there is no magical way for JavaScript to plug itself into the system DNS library. There *is* a magical way for JavaScript to monkey patch pretty much anything within the page load -- that's what we're talking about here. What this WG does doesn't affect that ability, even on the margins; it's already there.

>  It's not clear how the user would determine that this was the case, so there is a risk of mis-attribution within the web page.  

This is a pre-existing risk, and browser vendors, the WHATWG and W3C have spend significant time considering and mitigating it (in a nutshell, only trust the browser chrome, which is *not* under the control of JS). We do not own this problem.

> That there is no intent to allow that information to be further propagated is certainly useful to know, but if I understand you (and Adam) correctly, this problem must be handled somewhere because of the intersection of this proposal and JavaScript capabilities in a modern browser.  

It's already handled.

> As a charter question, is the description of the problem and/or proposals around it in scope for this proposed working group, or do we need to pass th problem to someone else.  If someone else, who?

It's not in-scope here, and since it's already handled, we don't need to pass it anywhere else.

> I think you and I agree that if an OS or browser configuration frob specifies a recursive resolver that uses DOH, that the results go where ever they would have gone had the same information come in via UDP, TCP, TLS, or DTLS.

Yes, provided it was from the same source.

> From the information in this email, we agree that taking DNS responses from a DOH recursive resolver specified in a download JavaScript application would currently be limited to that application and those from the same origin (and that building anything to take it further would be unwise).

Where 'context' is defined by the Web security model (which, like DNS, is specified a bit all-over-the-place, but still works somehow) -- yes.

>  There's some work to do on how to handle misattribution within that context, but it is not the same scope as the OS/browser configured data.

I strongly disagree that there's work to do -- this is already within the existing security model of the Web platform. 

> Should we be passing the charter by the Web Application Security WG in the W3C now for comments?

If that would help us move along, sure.

>> As above, defining this protocol won't change the capability of Web scripting by even the smallest amount. People do what they can today, and those capabilities will be the same after this is defined.
> 
> It will change the relationship of that Web scripting capability with the DNS (or at least make that relationship much easier).  Given where the DNS is in our stack, that's an important change.  If an attacker can take information from an origin and have it treated as DNS data, it become the foundation of retrievals from other origins.
> 
> To hideously over-simplify, the same origin security model presumes that resources from an origin share a scope.  But if the origin is a recursive resolver among other capabilities, the resources retrieved may provide data about where to get other resources from outside that scope.  
> 
> As long as there no APIs which push that data past the same origin boundary, the problem with that is limited to misattribution within the same origin.  But it is still a problem because of the role DNS info plays.

Right, but this is already possible today, and easy for someone to implement, because the Web allows you to create little protocols between JS and the server on-the-fly.

>>  2. Call a DOH service from Javascript (for some reason) -- note this is just like any other HTTP request; it doesn't affect browser/OS state outside of the same origin model. Yes, you can still build a browser-in-a-browser and mess with things inside that context, but that's already true today.
> 
> While this is no doubt unintended, this tends to give a "everything is already ruined" flavor to your response.

That indeed wasn't intentional; the Web still works pretty well, although I wouldn't bet on the long-term stability of the hair colour of any given Web security professional.

>  If we're standardizing this, I think we need to take how this data is integrated and presented as part of the overall deployment problem. If we're not the right folks to do that part of the work, I think we need to get the right folks involved as soon as possible and to put coordination with that community into the charter along with DNSOP and the others already listed.

Imagine we're charting a working group for a financial data format -- it's important that it has integrity and authority, and it's a target for attackers, as are DNS records. The position you're taking seems to be (roughly) that we need to make sure that people don't use the standard financial data format to misrepresent other people's finances in the case that there's a malicious piece of JS on a Web page. 

Without trivialising that attack, having a defined format for the data doesn't change its nature (and remember, we're not even really defining a format; the current proposal is to reuse an existing format in HTTP messages), and (again) we lack the expertise and authority in this area.

I'm fine if we feel we need to confirm this with WebAppSec or other parties before chartering. Beyond that, IMO adding any tasks to the WG's plate to address it is a poor use of the IETF's resources.


--
Mark Nottingham   https://www.mnot.net/