Re: [OAUTH-WG] Adam Roach's No Objection on draft-ietf-oauth-native-apps-11: (with COMMENT)

William Denniss <wdenniss@google.com> Mon, 22 May 2017 22:14 UTC

Return-Path: <wdenniss@google.com>
X-Original-To: oauth@ietfa.amsl.com
Delivered-To: oauth@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 9ABD01293E9 for <oauth@ietfa.amsl.com>; Mon, 22 May 2017 15:14:31 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 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, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=unavailable 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 oFIRY_KKQWMt for <oauth@ietfa.amsl.com>; Mon, 22 May 2017 15:14:27 -0700 (PDT)
Received: from mail-it0-x229.google.com (mail-it0-x229.google.com [IPv6:2607:f8b0:4001:c0b::229]) (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 ABBE41286CA for <oauth@ietf.org>; Mon, 22 May 2017 15:14:27 -0700 (PDT)
Received: by mail-it0-x229.google.com with SMTP id g126so7317044ith.0 for <oauth@ietf.org>; Mon, 22 May 2017 15:14:27 -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=wV1Ly8lMyGoxTQZC2mXANaqkl9X12UwHXEQqof+BsK0=; b=IhFQ9Ox8JzkRa2EhAjPacVO8037ysdrYJuteWQdgG75kdJKs6HMT9xulrHGCvq6Tax i3e93NxK1b0cPOQOCRawtL1H4r6+iaL/eRaus5ZnXkQVkvLpD/FGg1cDEGjjVAuF6x0F DsrMKU+Bb/5bo2v2ogrfGzIDl2YAN1bs8gTBYAJ2FUktfjivSI4DdAeUZm1CnGhqxlE6 MgmL1cjqCNkwYT++IApO4+oFCYKAsuy7cWrnqp+sCU8fHd35HR90rcRz3wQD0VPRQzQD 2C8qIC7G7xCiyw3uwmyoQ7P/LGAJcqpG+6t17fa8CPdsBQABQxCmugThom3W9ZIN0s9H 8LGw==
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=wV1Ly8lMyGoxTQZC2mXANaqkl9X12UwHXEQqof+BsK0=; b=bss3ZcLkuZGaLoC06F+GBlQiSsekOpXXwdgSO/RoOvKYM2QwvHkwPUZ01ZvDmYJd1F bVuUL+oO4HNUE2OV5PbOv5hbz86i21pIITZWA5F8ydoLLrNEwASUDmSKCAXDND0GlsRh y+ec6rfPgtB10EwSigWnlUbszNfhy7AkkFE5bRpGpN/OG/r9HPtmzihNRim72jsmczXR KP4ISLxhHg2+ixrTKyXDRNulQ5ssF80kMA7+E1JQ1dpRF3vT8KwkJZMgRy5kfguqDFD0 S0LgiqznYhHSY8GBafb98IJG0ZyQrDmlCaEz3qoCaBi139akEHgQmfbQhBalk33Nod44 rWnw==
X-Gm-Message-State: AODbwcBG+e4gg8s3p45cYvWO5k1Gf+mLbdw/TmDP91g45a8/oQ/5sGoJ nitsy1I8wuZ8RVy9+J7HIJZrxrNyVUJJlbCvoA==
X-Received: by 10.36.37.17 with SMTP id g17mr45124573itg.101.1495491266769; Mon, 22 May 2017 15:14:26 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.79.35.37 with HTTP; Mon, 22 May 2017 15:14:06 -0700 (PDT)
In-Reply-To: <149548482877.9096.13896958451655712801.idtracker@ietfa.amsl.com>
References: <149548482877.9096.13896958451655712801.idtracker@ietfa.amsl.com>
From: William Denniss <wdenniss@google.com>
Date: Mon, 22 May 2017 15:14:06 -0700
Message-ID: <CAAP42hAcc5qGCxMC-Qj=G5BKQ9kRv9N6_pdtjH8mxUCcFCD_8g@mail.gmail.com>
To: Adam Roach <adam@nostrum.com>
Cc: The IESG <iesg@ietf.org>, draft-ietf-oauth-native-apps@ietf.org, Hannes Tschofenig <Hannes.Tschofenig@gmx.net>, oauth-chairs@ietf.org, "oauth@ietf.org" <oauth@ietf.org>
Content-Type: multipart/alternative; boundary="001a114522c2b9244e0550243131"
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/n2sQGPQP_YjnH7hLuEjl_6AqnE8>
Subject: Re: [OAUTH-WG] Adam Roach's No Objection on draft-ietf-oauth-native-apps-11: (with COMMENT)
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: OAUTH WG <oauth.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/oauth>, <mailto:oauth-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/oauth/>
List-Post: <mailto:oauth@ietf.org>
List-Help: <mailto:oauth-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/oauth>, <mailto:oauth-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 22 May 2017 22:14:32 -0000

Adam,

Thank you for reviewing the draft.

On Mon, May 22, 2017 at 1:27 PM, Adam Roach <adam@nostrum.com>; wrote:

> Adam Roach has entered the following ballot position for
> draft-ietf-oauth-native-apps-11: No Objection
>
> ----------------------------------------------------------------------
> COMMENT:
> ----------------------------------------------------------------------
>
> General
> =======
> The thesis of this document seems to be that bad actors can access
> authentication information that gives them broader or more durable
> authorization than is intended; and appears to want to mitigate this
> predominantly with a single normative statement in a BCP telling
> potential bad actors to stop doing the one thing that enables their
> shenanigans.  For those familiar with the animated series "The Tick," it
> recalls the titular character yelling "Hey! You in the pumps! I say to
> you: stop being bad!" -- which, of course, is insufficient to achieve the
> desired effect.
>

I see that there is nevertheless "strong consensus" to publish the
> document;


Two years ago when I posted version 00 of the draft, nearly every native
app OAuth interaction in the wild violated that MUST. It was quite a large
problem, and we've been working in the OAuth community for a while to get
to this point, and I do believe there is a strong consensus to publish.

I see this BCP not only as a single MUST of what you shouldn't do, but also
as a valuable document detailing exactly how to meet that requirement,
which is non-trivial. Given how widespread the old practice was, I think
it's worth very clearly detailing why the old way is bad (e.g. Section
8.7), and giving as much information as possible for how to do it the right
way which is the goal of the document.

in which case, I would encourage somewhat more detail around
> what the rest of the ecosystem -- and the authentication server in
> particular -- can do to mitigate the ability of such bad actors.
> Specifically, section 8.1 has a rather hand-wavy suggestion that
> authorization endpoints "MAY take steps to detect and block authorization
> requests in embedded user agents," without offering up how this might be
> done. The problem is that that the naïve ways of doing this (UA strings?)
> are going to be easy to circumvent, and the more advanced ones (say,
> instructing users to log in using a non-OAuth flow if the auth endpoint
> detects absolutely no cookies associated with its origin) will have
> interactions that probably warrant discussion in this document. (For
> example, such an approach -- while potentially effective -- would
> interact very poorly with the "SSO mode" described in section B.3;
> although I think that recommending the use of "SSO mode" should be
> removed for other reasons, described below).
>

One of the problems with the old way of doing things is that it was hard to
tell the good actors from the bad – they all used the same techniques. So I
do actually see value in naive UA filtering as even though the bad actor
can lie, it becomes a provable lie.

Thanks for your feedback here, I'll take another look and see if we can
build in some of your suggestions.

________
>
> Specific comments follow
>
> The terminology section makes distinctions about cookie handling and
> content access in generic definitions (embedded versus external UAs, for
> example) but doesn't do the same for specific technologies. It is
> probably worthwhile noting that the "in-app browser tab" prevents apps
> from accessing cookies and content, while the "web-view" does not (I had
> to infer these facts from statements much later in the document).
>
> Section 7.3 gives examples of IPv4 and IPv6 addresses for loopback. While
> I'm sympathetic to the deployment challenges inherent in getting entire
> network paths to upgrade to IPv6, this text discusses loopback
> exclusively, which means that only the local operating system needs to
> support IPv6. Since all modern operating systems have supported IPv6 for
> well over a decade, I suggest that the use of IPv4 addresses for this
> purpose should be explicitly deprecated, so as to avoid unnecessary
> transition pain in the future. Minimally, the example needs to be
> replaced or supplemented with an IPv6 example, as per
> <https://www.iab.org/2016/11/07/iab-statement-on-ipv6/>;: "We recommend
> that existing standards be reviewed to ensure they... use IPv6
> examples."


Good points. Version 11 added an IPv6 example, and a discussion around
IPv4/6 compatibility. I believe with that we are now conformance with the
IAB guidelines.

While I agree with your statement in principle that all hosts should
support already IPv6 loopback, in practice I was dealing with a case
recently where some code that was written assuming local IPv6 availability
broke when a user had explicitly disabled IPv6 on their machine. It seems
users can still get away without IPv6 for now, meaning IPv6 loopback
availability is not completely guaranteed.

Due to this, I think documenting an approach where clients can support IPv6
only, IPv4 only, and both being available is probably best for now (and 7.3
in v11 does that in the last paragraph).  It looks like that approach we
took in v11 does follow the IAB recommendations for mixed environments.


Section 8.1 makes the statement that "Loopback IP based redirect URIs may
> be susceptible to interception by other apps listening on the same
> loopback interface." That's not how TCP listener sockets work: for any
> given IP address, they guarantee single-process access to a port at any
> one time. (Exceptions would include processes with root access, but an
> attacking process with that level of access is going to be impossible to
> defend against). While mostly harmless, the statement appears to be false
> on its face, and should be removed or clarified.
>

Will be removed in the next update. Thank you.

Section 8.4 indicates that loopback redirect URIs are allowed to vary
> from their registered value in port number only. If you decide not to
> deprecate the use of IPv4 loopback, I imagine that servers should also
> treat [::1] identical to 127.0.01 for this purpose as well.
>

The expectation here was that the client would register both I guess. That
said, they'd be no harm in treating them as identical for that purpose, so
that's good advice. I'll revise.


> Section 8.7 claims that users are likely to be suspicious of a sign-in
> request when they should have already been signed in, and goes on to
> claim that they will distinguish between completely-logged-out states and
> logged-in-but-needing-reauth states, and may even take evasive action
> based on associated suspicion. Based on what I know of user research for
> security indicators, the chances of these statements being true for any
> non-trivial portion of any user population is basically zero. I propose
> that this section simply highlight that this is effectively an
> intractable problem from the client end, without any illusions that users
> have the ability to distinguish between the two circumstances, and that
> authentication servers must be extra vigilant in detecting and avoiding
> these kinds of attacks.
>

I'll revise this, I agree the claim is a little too aspirational.

Section 8.11, third paragraph talks about keystroke logging; in practice,
> the attack here is far easier than that, as I believe that applications
> that embed a web view can simply extract authentication-related material
> directly from the DOM.
>

Yes, they can do that too (and I agree it's a simpler attack
implementation). I'll include in the next revision. I'll keep in the
keystroke logging text, as it's another vector, and people tend to have a
visceral reaction when learning this.

Section B.2 uses the phrase "Android Implicit Intends" where I believe it
> means "Android Implicit Intents."
>

Fixed in the next update, thanks.


>
> Section B.3 describes the use of a "Web Authentication Broker" in SSO
> mode, which provides an isolated authentication context. If the section
> 8.7 text regarding user detection of nefarious application behavior in
> the form of web-view embedding is not removed, this needs a very clear
> treatment of how users might be expected to distinguish between that
> behavior and the SSO mode behavior. On casual examination, it seems that
> there would be no way to do so. I'll note that this BCP also promotes the
> "already logged in" behavior as being a key benefit to OAuth (cf. the
> third paragraph of Section 4), which the described behavior seems to
> mostly defeat. I would strongly suggest either removing discussion of
> using this mode, or deprecating it in favor of the user's preferred web
> browser, so as to obtain the advantages described in section 4.
>

My understanding of the Web Authentication Broker is that it is effectively
a special-case browser designed for authentication. There is a single
cookie-jar which is retained and used with all apps that use the Web
Authentication Broker in "SSO mode". So logins are shared, and the
advantages of Section 4 apply.  It's a separate cookie-jar from the main
browser, which would imply a minimum of two sign-ins on the device (so not
quite "single" at a device level), but I'm not sure if this is enough to
disqualify it.

My goal here is to simply document the current state of the art of the
platforms, and I felt that the Web Authentication Broker qualified as an
external user agent per the BCP.  The user interface is arguably quite nice
too, which mitigates some of the downsides of using a special
authentication "browser" with a separate cookie jar.

I'm open to suggestions on this section.


Thanks again for your comments.

Best,
William