Re: [OAUTH-WG] New OAuth for Browser-Based Apps draft -02

Torsten Lodderstedt <torsten@lodderstedt.net> Thu, 25 July 2019 19:04 UTC

Return-Path: <torsten@lodderstedt.net>
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 5D2BE12022C for <oauth@ietfa.amsl.com>; Thu, 25 Jul 2019 12:04:09 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.6
X-Spam-Level:
X-Spam-Status: No, score=-2.6 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 EHbiV7dxAXNX for <oauth@ietfa.amsl.com>; Thu, 25 Jul 2019 12:04:07 -0700 (PDT)
Received: from smtprelay02.ispgateway.de (smtprelay02.ispgateway.de [80.67.18.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E4590120248 for <oauth@ietf.org>; Thu, 25 Jul 2019 12:04:06 -0700 (PDT)
Received: from [91.13.158.20] (helo=[192.168.71.102]) by smtprelay02.ispgateway.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from <torsten@lodderstedt.net>) id 1hqj24-0002zE-DT; Thu, 25 Jul 2019 21:04:04 +0200
Content-Type: multipart/signed; boundary="Apple-Mail-6FCA0155-0B48-43E5-864B-7CF910F102FD"; protocol="application/pkcs7-signature"; micalg="sha-256"
Mime-Version: 1.0 (1.0)
From: Torsten Lodderstedt <torsten@lodderstedt.net>
X-Mailer: iPhone Mail (16F203)
In-Reply-To: <1903519861.188545.1563954610968@mail.yahoo.com>
Date: Thu, 25 Jul 2019 21:04:04 +0200
Cc: Brian Campbell <bcampbell=40pingidentity.com@dmarc.ietf.org>, David Waite <david@alkaline-solutions.com>, OAuth WG <oauth@ietf.org>
Content-Transfer-Encoding: 7bit
Message-Id: <B033CD2E-38BC-42CD-9BA1-99BA016CD332@lodderstedt.net>
References: <CAGBSGjqVV3jJaXEX28N_fKbLSp3ijzb34N9NrZwZ+ZNXwXGKAg@mail.gmail.com> <0C094925-1429-46ED-8CF6-0D7B8DFB332F@lodderstedt.net> <CA+k3eCT5eG=S9AjM7Ss=DwHvsjwnriuZC3_yMxhrUaJXf2-vrw@mail.gmail.com> <99169CD8-F415-43CB-9F93-D779E5A15592@alkaline-solutions.com> <1903519861.188545.1563954610968@mail.yahoo.com>
To: Tomek Stojecki <tstojecki=40yahoo.com@dmarc.ietf.org>
X-Df-Sender: dG9yc3RlbkBsb2RkZXJzdGVkdC5uZXQ=
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/I4_0B_6uCwFG7BDahveq8vcaxWo>
Subject: Re: [OAUTH-WG] New OAuth for Browser-Based Apps draft -02
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.29
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: Thu, 25 Jul 2019 19:04:21 -0000


> Am 24.07.2019 um 09:50 schrieb Tomek Stojecki <tstojecki=40yahoo.com@dmarc.ietf.org>:
> 
> I agree that 6.1 takes too broad of a swipe, but I'd say with same-site cookies and (sadly) without token-binding, the suggestion to use cookie based session following oauth/oidc auth is a good one and should be incorporated perhaps in 6.2?

Sure. Such mechanisms are also used in a backend based architecture for OAuth, just as a complement and not an alternative to OAuth

> 
> Leo sums it up well here:
>> We need to be clear on the distinction between browser based apps that hold the token(s) in the browser space, vs. those that don't.  I agree that with this "common domain" architecture, the tokens should not be held in the browser, but it doesn't follow that oauth should not be used at all.  
> 
> Finally and sorry if this is off-topic, why isn't this discussion taking place in github? Aaron has uploaded the document there. This medium, while good for some things, seems to have a lot of shortcomings for this sort of discussion and review. 

Well, since this is IETF ;-)

> 
> Thanks,
> Tomek
> 
> 
> On Wednesday, July 24, 2019, 04:14:14 AM GMT+2, David Waite <david@alkaline-solutions.com> wrote: 
> 
> 
> 
> 
> 
> 
> 
>> On Jul 23, 2019, at 12:47 PM, Brian Campbell <bcampbell=40pingidentity.com@dmarc.ietf.org> wrote:
>> 
>> 
>> 
>>> On Mon, Jul 22, 2019 at 7:31 AM Torsten Lodderstedt <torsten@lodderstedt.net> wrote:
>>> 
>>> 2) Regarding architectures: I think this BCP should focus on recommendations for securely implementing OAuth in the different potential architecture. I don’t think we should get into the business of recommending and assessing other solutions (e.g. section 6.1.). Just to give you an example: Section 6.1. states 
>>> 
>>> "OAuth and OpenID Connect provide very little benefit in this deployment scenario, so it is recommended to reconsider whether you need OAuth or OpenID Connect at all in this case.”
>>> 
>>> Really? What experiences is this statement based on? In my experience, sharing the same domain == host name tells you nothing about the overall architecture of a certain deployment. There may be several reasons why OAuth could be good choice in such a scenario, e.g. security considerations (since your common domain is just a proxy server encapsulating a whole universe of systems) or even modularity as an architecture principle. 
>>> 
>>> I suggest to remove section c. and to rephrase the second paragraph of the abstract.
>> 
>> I believe the experiences that the statement is based on are the predominant practice over the course of much of the history of the web of using a cookie to maintain an authenticated HTTP session in web applications. When the script of the browser-based application is served from a domain that can share cookies with the domain of the API, then cookies can still be used to authorize requests (even if those requests are API calls rather than full page HTTP request/response). And I do believe that's likely a better decision in a lot of such cases. 
>> 
>> That authenticated HTTP session may be establish from a username/password form submission, FIDO/WebAuthn, or whatever.  Even as a result of an OpenID Connect flow. Or even SAML for that matter. But the the requests after that are authorized by the cookie. 
>> 
>> I think there's a tendency to assume because SPA style apps make API calls, they simply must use OAuth. Because API implies OAuth in the minds of many (which is a sign of its success). But OAuth isn't necessarily the only thing that can be used for API authorization. Cookies work too. I think/hope that's what Section 6.1. is getting at - providing some potential guidance that OAuth might not necessarily be the right choice in those cases where a common domain allows for a cookie. Perhaps the text in that section could be phased in a different or better way, but I think its useful to have some mention of in this document. 
>> 
>> Although taking out "and OpenID Connect" from the sentence quoted above might be more appropriate and alleviate some confusion. 
>> 
>> 
> 
> Perhaps it should be turned into a stated document assumption (that the reader has decided to use OAuth) rather than guidance later in the document (that OAuth may not be the best fit)
> 
> There is AFAIK no set of security considerations or best practices we can point to for “use some non-standardized system for acquiring and using cookies” or even “here’s a standard for acquiring and using cookies”. Omitting some of the moving pieces of OAuth might alleviate some security concerns, but also resurrect some other security issues. The most immediate example that comes to mind: using a HttpOnly cookie-as-token instead of an access token may mean that you can’t have injected scripts exfiltrate the token, but applying the access token was also a mitigation against browser CSRF for your APIs.
> 
> -DW
> _______________________________________________
> OAuth mailing list
> OAuth@ietf.org
> https://www.ietf.org/mailman/listinfo/oauth
> 
> _______________________________________________
> OAuth mailing list
> OAuth@ietf.org
> https://www.ietf.org/mailman/listinfo/oauth