Re: [DNSOP] Status of "let localhost be localhost"?

Mike West <mkwst@google.com> Wed, 02 August 2017 13:08 UTC

Return-Path: <mkwst@google.com>
X-Original-To: dnsop@ietfa.amsl.com
Delivered-To: dnsop@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id AC3F91320A3 for <dnsop@ietfa.amsl.com>; Wed, 2 Aug 2017 06:08:08 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.7
X-Spam-Level:
X-Spam-Status: No, score=-2.7 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=google.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 O18fHosjIVAp for <dnsop@ietfa.amsl.com>; Wed, 2 Aug 2017 06:08:06 -0700 (PDT)
Received: from mail-oi0-x22e.google.com (mail-oi0-x22e.google.com [IPv6:2607:f8b0:4003:c06::22e]) (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 EA5C31320AC for <dnsop@ietf.org>; Wed, 2 Aug 2017 06:08:05 -0700 (PDT)
Received: by mail-oi0-x22e.google.com with SMTP id x3so43732782oia.1 for <dnsop@ietf.org>; Wed, 02 Aug 2017 06:08:05 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=vaK1lcxavvRB7URJW/pC12qM8XtaRcBCePEXKmDobCE=; b=NElCoM5j5SlaOed8zZWHxrRpRsoatY6oz1QYZRnniraAHkcKg0uDVSayvcJ08wbLzW EtstoaAdsTbp9i552X+fo8+9UEC73+NCqo7VhvYXCQMMKkhpFhMkaZ04lU105QxT4jgh hCft72cKdm40DGKtzZUUG426odDqYdgqheU7C7XN5ubAap4dh+vlgM0z1k9Y3wi/mx8v j8iGwSmtEHQiqs4gXKvmZtrsg6rbNWQHdfFp9jDBGNW+vPs7joccP+Mf/jz00GVzeW+I 7918PB668kIW0ennwIGSxCs2m3sLAkkLebE0CzTypMrmYVF4kd8DdGVV21a9TKksGp84 Chww==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=vaK1lcxavvRB7URJW/pC12qM8XtaRcBCePEXKmDobCE=; b=BEX0dUnQpz4AYQ9N2TijlYdHEUl94bPOiCu4ndIYPs4gnf8jlhkeHJva4YM3ZckH+n YJyRARIZvpbE/0+ghVCq1c2qgqkh2lToc8L5jJGZ2m6vz0L6Gaq3+Xe8cFTinyKt6ySH vMx2LjyVmTE3LNGTF2EKWj9Cwcqb1wpZ7JeOGrfMKPef6lvz6WOzqYRp9yUnQIAJSLRz fd6zmkz4DwYkIxmnnH6qDKAj8FxhzTCSwigoDhwcB6eAiMA8zuO3XKsia6effoumjvUg Sds+0w3XUUactqKSsZXBTpemBCS2a7ssaLghuk1JQ/c4UF/TQA/Gw1AwV2BAcbNvRKwM /C2Q==
X-Gm-Message-State: AIVw111NL2AypFSkNmRUiXIP/9DkRd9u/FP+uCvjsIvsv66NAw9Alhlq MOlI3ZFy9exVDZqxXpWsMw17d6JuRLOz
X-Received: by 10.202.199.138 with SMTP id x132mr18264350oif.52.1501679283862; Wed, 02 Aug 2017 06:08:03 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.74.47.5 with HTTP; Wed, 2 Aug 2017 06:07:43 -0700 (PDT)
In-Reply-To: <CAL02cgQ2z9Fze-Q2QWQ=+PHJEO_S3bTaq1fPJ6XSEwFUQ=ftvw@mail.gmail.com>
References: <05e469cf-1325-89fc-4a81-661f8647e869@eff.org> <CAKXHy=ctB=LZkX9j=8-Jy0NkTAs2tAesa4gmFhfp94O5=9U4TA@mail.gmail.com> <1dbb47a4-c6e2-97d2-a1d7-ce6c65a4042a@eff.org> <CACfw2hiX7U74n9+defcYiD7jLKZeLhtLM6WP5YM_WuAoA8ecYQ@mail.gmail.com> <CAL02cgRg6k7=b7berKr9J+9aL8PTS81nJ_yXQO8QTYqgiqXSbg@mail.gmail.com> <6B25B24C-4C80-4A04-BF27-2306F4A77EF6@fugue.com> <CAL02cgQ2z9Fze-Q2QWQ=+PHJEO_S3bTaq1fPJ6XSEwFUQ=ftvw@mail.gmail.com>
From: Mike West <mkwst@google.com>
Date: Wed, 2 Aug 2017 15:07:43 +0200
Message-ID: <CAKXHy=eV0OBW+S308rdiHZ523foOgxYNB3i07RkeFJiTjMYQEQ@mail.gmail.com>
To: Richard Barnes <rlb@ipv.sx>
Cc: Ted Lemon <mellon@fugue.com>, dnsop <dnsop@ietf.org>, Jacob Hoffman-Andrews <jsha@eff.org>, william manning <chinese.apricot@gmail.com>
Content-Type: multipart/alternative; boundary="001a11c180444bb9dc0555c4f4a6"
Archived-At: <https://mailarchive.ietf.org/arch/msg/dnsop/7MWMXY_LQvBW0imBYVVVpGVTeLg>
Subject: Re: [DNSOP] Status of "let localhost be localhost"?
X-BeenThere: dnsop@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: IETF DNSOP WG mailing list <dnsop.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dnsop>, <mailto:dnsop-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/dnsop/>
List-Post: <mailto:dnsop@ietf.org>
List-Help: <mailto:dnsop-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dnsop>, <mailto:dnsop-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 02 Aug 2017 13:08:08 -0000

On Wed, Aug 2, 2017 at 3:02 PM, Richard Barnes <rlb@ipv.sx> wrote:

> On Wed, Aug 2, 2017 at 8:48 AM, Ted Lemon <mellon@fugue.com> wrote:
>
>> On Aug 2, 2017, at 8:40 AM, Richard Barnes <rlb@ipv.sx> wrote:
>>
>> The underlying need here is that application software would like to make
>> use of the fact that it is connecting to "localhost" (vs. other domain
>> names) to make security decisions based on whether traffic is going to
>> leave the host.  So if the network layer remaps localhost to something
>> other than a loopback interface without telling the applications, then
>> you're going to have security problems.
>>
>> The point of this document is to avoid this disconnect by discouraging
>> the sorts of remappings you're talking about.
>>
>>
>> Of course, arguably this is the wrong approach.   Perhaps the right
>> approach is to understand that the security characteristics of "localhost"
>> are not the ones that we want when our goal is to be sure we are connecting
>> to the local host.   Apps don't control the name resolution software that's
>> running on the local host.   If they want to be sure they are connecting
>> locally, perhaps they should be using ::1 instead of localhost as their
>> explicit destination identifier.
>>
>
> This is indeed what happens today.
>
> https://w3c.github.io/webappsec-secure-contexts/#is-origin-trustworthy
>
> But of course having IP addresses in URLs is both a PITA for developers
> and an anti-pattern more generally.
>
> If "localhost" were properly defined to be loopback, then applications
> could just hard-wire resolution, and not depend on the good graces of the
> platform resolver.  As, for example, Firefox does with ".onion" today:
>
> http://searchfox.org/mozilla-central/source/netwerk/dns/
> nsDNSService2.cpp#708
>
> (The "localhost" stuff in that method is unrelated to this discussion BTW;
> it relates to a Firefox-internal mapping of other domains to localhost.)
>

I was typing basically this when Richard's message came in. So I'll simply
add that Problem 8 in https://tools.ietf.org/html/draft-ietf-sunset4-
gapanalysis-09#section-5 suggests that we already know that this kind of
hard-coding will cause issues for future migrations. Just as we'd like to
discourage folks from hard-coding `127.0.0.1` to be certain that they're
talking to the loopback interface, it seems reasonable to discourage folks
from hard-coding `::1`.

-mike