Re: [OAUTH-WG] Clarifying Bearer token usage OAuth 2.1 draft-ietf-oauth-v2-1-00

Jim Manico <jim@manicode.com> Thu, 30 July 2020 22:09 UTC

Return-Path: <jim@manicode.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 00B283A0BD4 for <oauth@ietfa.amsl.com>; Thu, 30 Jul 2020 15:09:45 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.088
X-Spam-Level:
X-Spam-Status: No, score=-2.088 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_FONT_LOW_CONTRAST=0.001, HTML_MESSAGE=0.001, NICE_REPLY_A=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_KAM_HTML_FONT_INVALID=0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=manicode.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 3EVEaMLZNYH8 for <oauth@ietfa.amsl.com>; Thu, 30 Jul 2020 15:09:42 -0700 (PDT)
Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) (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 029EF3A044E for <oauth@ietf.org>; Thu, 30 Jul 2020 15:09:41 -0700 (PDT)
Received: by mail-qt1-x832.google.com with SMTP id v22so15676650qtq.8 for <oauth@ietf.org>; Thu, 30 Jul 2020 15:09:41 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manicode.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=uk3gWRYCcsFYgXAfy86pEXZS3sYurW9UI9yU2Umj/yM=; b=IAwoxZCBF/iNtEF1XYMLX7BDC0zERDBp9oucXOx6uK5o9sbhEYAUJHLSfvBDUcqe9Q mSUnoKI/CU+G3zFFfx+WUmaJWULeNjYTKGPRXdv7gW7vXHAxfexm8vwdRGSYSxFDzfoZ 0y3bXLDfAsBixgctZ3JpJsrj42MtiK+fpbOE1vw6YCpRwIDl5kb60vqQ6Jx2OWI5Mbzd cKkoW4+cmJPVYAbFPOISbyrvi3p8cQmxCVhN6aAWKccONPmbBuYZ+glEMDB3JHI1WyKG J6Mh1GAUVO6eS/EFKYsBDtBXrWaSw6jwuM+TAP34g2KLMJJS8YMp/yMBJURtPUDYjsEv 4ExQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=uk3gWRYCcsFYgXAfy86pEXZS3sYurW9UI9yU2Umj/yM=; b=OuINk6TArqoiOqMyj/UleG0t0c6M+KAqnUDsBqCAmFQrbpIzGv18umLPXafMNWWVHz vbkIS777YqvCgUVsF/pC6ffXY4HMrmuh3gE2nsaK1BrsLLYojNn8lnqKPljg4LoJtQNb MAd49XRmqlCYR/tmSH1Rq9Nb/hKPHONkzRV0OfAFQSMKTedZK1G1t0TxwB8JtOs3ROd+ Gn2BPw89ymI1xEZkdYffmywEAH19u+/tsgOIvPxTS90hp10wr54JWYA676mmESSXgZzb cDcxQBMdO8Z/tbIN4BLxZKfAVFRGylq5jLMRYuxDZxJq4w62sNjNzIPYMd+WiwfUpphg 1kFw==
X-Gm-Message-State: AOAM5324jf4EJpAFvEWzUIfdTM/tmc9q7Gm//jnQk6s5bOuUU2Vw/oEc 6I53rYeW+WeYyI9MHsfGZH8NRPN621k=
X-Google-Smtp-Source: ABdhPJwjNkZywlQvc6qwvfbgdrpNY6s8cJc/WiYJBOXy2lQ2DAlIgeXmXxx8pKBjOqED9s8an6lwLQ==
X-Received: by 2002:aed:27d5:: with SMTP id m21mr897094qtg.4.1596146980198; Thu, 30 Jul 2020 15:09:40 -0700 (PDT)
Received: from heembo.fios-router.home (pool-71-126-184-140.washdc.east.verizon.net. [71.126.184.140]) by smtp.googlemail.com with ESMTPSA id k25sm5823806qtp.72.2020.07.30.15.09.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Jul 2020 15:09:39 -0700 (PDT)
To: Aaron Parecki <aaron@parecki.com>, Dick Hardt <dick.hardt@gmail.com>
Cc: oauth <oauth@ietf.org>
References: <CAD9ie-uUeX2fKxz=Cn0ea2vcec-rEsGvjTRsYJgCcVrqQf8H3A@mail.gmail.com> <1842CB01-E0DE-4121-AFAF-B3BE749E55F0@manicode.com> <CAD9ie-uYefVfBv_aNu2jnsu3q=uv8=Dir-nLKGEbaPH37hhnmw@mail.gmail.com> <CAGBSGjoXd-0WKCQoniwoRBBjOn-jfRBZMke=97B9LtNYu4wTjg@mail.gmail.com>
From: Jim Manico <jim@manicode.com>
Message-ID: <361274fb-f514-bb2a-6865-d8e4def69929@manicode.com>
Date: Thu, 30 Jul 2020 18:09:38 -0400
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.11.0
MIME-Version: 1.0
In-Reply-To: <CAGBSGjoXd-0WKCQoniwoRBBjOn-jfRBZMke=97B9LtNYu4wTjg@mail.gmail.com>
Content-Type: multipart/alternative; boundary="------------A12CDFF1DA18548CFA7C69D2"
Content-Language: en-US
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/xTj48saTTzSfTqEYE9iySL3ONrY>
Subject: Re: [OAUTH-WG] Clarifying Bearer token usage OAuth 2.1 draft-ietf-oauth-v2-1-00
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, 30 Jul 2020 22:09:45 -0000

Two thumbs up!

I would rather delay and get it right. Good things come to those who wait.

But; I am the least experienced standard author or advisor. I am an 
idealist and am ok stating my opinion and moving on so others with more 
experience in this area can make the decisions.

Aloha.

- Jim Manico

On 7/30/20 5:16 PM, Aaron Parecki wrote:
> I have a draft from a coworker that defines a cookie response mode and 
> cookie bearer token usage. It's something we've considered bringing to 
> the working group but haven't actually proposed yet. Is this the kind 
> of thing you're talking about?
>
> https://github.com/jaredhanson/draft-oauth-cookie-response-mode/blob/master/spec.txt
>
> This looks like a good starting point and I am happy to work with 
> Jared on refining this.
>
> ---
> Aaron Parecki
> https://aaronparecki.com
> https://oauth2simplified.com
>
> On Thu, Jul 30, 2020 at 1:55 PM Dick Hardt <dick.hardt@gmail.com 
> <mailto:dick.hardt@gmail.com>> wrote:
>
>     I hear you Jim, but it is not so much rules, as expectations and
>     expediency.
>
>     There may be significant debate on how to do the feature. You
>     would not want to hold up the OAuth 2.1 document for that would
>     you? There are other documents already in flight -- which other
>     ones should OAuth 2.1 wait for?
>
>     Reducing the "20 standards" to one document was the goal of OAuth 2.1.
>
>     Having said that, if members of the working group want to get
>     working on this feature, and if it is completed quickly, it could
>     be referenced or included in OAuth 2.1 depending on the relative
>     timing.
>
>     /Dick
>
>
>
>
>     ᐧ
>
>     On Thu, Jul 30, 2020 at 1:47 PM Jim Manico <jim@manicode.com
>     <mailto:jim@manicode.com>> wrote:
>
>         I politely encourage the rules to be bent and to integrate
>         this basic but fundamental security control into the core
>         standard.
>
>         This is just basic security; we want as much basic security in
>         the core of any standard. Dev’s now need to read 20 standards
>         to get OAuth2 basics... and that’s a barrier to entry.
>
>         --
>         Jim Manico
>         @Manicode
>
>>         On Jul 30, 2020, at 3:21 PM, Dick Hardt <dick.hardt@gmail.com
>>         <mailto:dick.hardt@gmail.com>> wrote:
>>
>>         
>>         One of the constraints of the OAuth 2.1 document that aligned
>>         the WG was it would have no new features.
>>
>>         I'd recommend a separate document for the cookie bearer token
>>         feature.
>>
>>         ᐧ
>>
>>         On Thu, Jul 30, 2020 at 12:15 PM Jim Manico <jim@manicode.com
>>         <mailto:jim@manicode.com>> wrote:
>>
>>             Yea to cookie configuration suggestions!
>>
>>             I suggest SameSite=LAX at least, which is actually the
>>             default behavior in chrome if you do not set the samesite
>>             value. LAX will not break links that originate from
>>             emails, STRICT will.
>>
>>             Point being is that CSRF defense is easy. XSS defense is
>>             brutally hard in apps with complex UI’s!
>>
>>             --
>>             Jim Manico
>>             @Manicode
>>
>>
>>>             On Jul 30, 2020, at 1:13 PM, Warren Parad
>>>             <wparad@rhosys.ch <mailto:wparad@rhosys.ch>> wrote:
>>>
>>>             
>>>
>>>                 Cookie storage of tokens does leave one open to CSRF
>>>                 attacks so it's certainly a trade-off. But CSRF is
>>>                 much easier to defense against that XSS and cookies
>>>                 are a better choice if the specific risk of having
>>>                 tokens stolen via XSS matters to your threat model.
>>>
>>>
>>>             I would assume if we included cookie language, it would
>>>             explicitly specify *Secure; HttpOnly;
>>>             SameSite=Strict* as the recommendation, and then neither
>>>             XSS nor CSRF should be a problem (right?)
>>>
>>>
>>>                 OAuth 2.1 isn't supposed to add new features that
>>>                 don't already exist, but this sounds like a good
>>>                 candidate to develop as an OAuth extension.
>>>
>>>
>>>             Is this really a /new feature/ though?
>>>
>>>             Okay, I'll submit that RFC 6749 does state the cookie
>>>             wouldn't be created by the AS.
>>>
>>>                 5.1. Successful Response
>>>                 <https://tools.ietf.org/html/rfc6749#section-5.1>
>>>                 <https://tools.ietf.org/html/rfc6749#section-5.1> The
>>>                 authorization server issues an access token and
>>>                 optional refresh
>>>                 <https://tools.ietf.org/html/rfc6749#section-5.1> token,
>>>                 and constructs the response by *adding the following
>>>                 parameters
>>>                 *
>>>                 <https://tools.ietf.org/html/rfc6749#section-5.1>* to
>>>                 the entity-body of the HTTP response* with a 200
>>>                 (OK) status code:
>>>                 <https://tools.ietf.org/html/rfc6749#section-5.1>
>>>
>>>             However that wouldn't prevent a client using the
>>>             password grant (I know I said a bad word) or
>>>             authorization code flow from creating the cookie to
>>>             contain that. Specifically
>>>
>>>                 7. Accessing Protected Resources
>>>                    The client accesses protected resources by
>>>                 presenting the access
>>>                    token to the resource server.  The resource
>>>                 server MUST validate the
>>>                    access token and ensure that it has not expired
>>>                 and that its scope
>>>                    covers the requested resource. *The methods used
>>>                 by the resource
>>>                    server to validate the access token (as well as
>>>                 any error responses)
>>>                    are beyond the scope of this specification but
>>>                 generally involve an
>>>                    interaction or coordination between the resource
>>>                 server and the
>>>                    authorization server*.
>>>                    The method in which the client utilizes the
>>>                 access token to
>>>                    authenticate with the resource server depends on
>>>                 the type of access
>>>                    token issued by the authorization server.
>>>                 * Typically, it involves
>>>                    using the HTTP "Authorization" request header*
>>>                 field [RFC2617] with an
>>>                    authentication scheme defined by the
>>>                 specification of the access
>>>                    token type used, such as [RFC6750].
>>>
>>>
>>>             So that's definitely some gray area. Although perhaps
>>>             I'm missing a relevant section. If we are going to go so
>>>             far to detail a list of possible RS bearer token
>>>             possible locations (i.e. Header and Body), to what I
>>>             assume is to implicitly say /Don't use a query
>>>             parameter/. It also suggests /Don't use a cookie at
>>>             all/, even with/SameSite=Strict/. Although maybe that is
>>>             the point.
>>>
>>>             For my reference, what makes a /new feature/ and what
>>>             makes /an OAuth extension?/
>>>
>>>             	
>>>
>>>             Warren Parad
>>>
>>>             Founder, CTO
>>>
>>>             Secure your user data and complete your authorization
>>>             architecture. Implement Authress <https://bit.ly/37SSO1p>.
>>>
>>>
>>>             On Thu, Jul 30, 2020 at 6:46 PM Aaron Parecki
>>>             <aaron@parecki.com <mailto:aaron@parecki.com>> wrote:
>>>
>>>                 I haven't seen any OAuth drafts that talk about
>>>                 sending OAuth access tokens in HTTP cookies. OAuth
>>>                 2.1 isn't supposed to add new features that don't
>>>                 already exist, but this sounds like a good candidate
>>>                 to develop as an OAuth extension.
>>>
>>>                 ---
>>>                 Aaron Parecki
>>>                 https://aaronparecki.com
>>>                 https://oauth2simplified.com
>>>
>>>                 On Thu, Jul 30, 2020 at 9:35 AM Jim Manico
>>>                 <jim@manicode.com <mailto:jim@manicode..com>> wrote:
>>>
>>>                     In a browser, HTTPOnly cookies are the *only*
>>>                     location where an access (or other) token can be
>>>                     stored in a way where it *cannot be stolen from
>>>                     XSS*.
>>>
>>>                     It's a very strong place to store tokens from a
>>>                     security point of view.
>>>
>>>                     Cookie storage of tokens does leave one open to
>>>                     CSRF attacks so it's certainly a trade-off. But
>>>                     CSRF is much easier to defense against that XSS
>>>                     and cookies are a better choice if the specific
>>>                     risk of having tokens stolen via XSS matters to
>>>                     your threat model.
>>>
>>>                     - Jim
>>>
>>>                     On 7/30/20 11:43 AM, Warren Parad wrote:
>>>>                     https://www.ietf.org/id/draft-ietf-oauth-v2-1-00.html#name-bearer-tokens
>>>>
>>>>                     It seems recently more and more common to pass
>>>>                     the access_token to some RS via a cookie, yet
>>>>                     7.2.1 says it defines two methods. I think we
>>>>                     need some RFC2119
>>>>                     <https://www.ietf.org/id/draft-parecki-oauth-v2-1-03.html#RFC2119> keywords
>>>>                     here, to suggest that either SHOULD use one of
>>>>                     these two, or MUST. And then optionally state
>>>>                     whether or not we recommend or reject the use
>>>>                     of cookies as a place for access tokens. It's
>>>>                     also possible that the language threw me off,
>>>>                     because would an access token in a cookie be a
>>>>                     bearer token, but no matter, if I'm having this
>>>>                     thought, then surely others have it as well, right?
>>>>
>>>>                     <image.png>
>>>>
>>>>
>>>>                     	
>>>>
>>>>                     Warren Parad
>>>>
>>>>                     Founder, CTO
>>>>
>>>>                     Secure your user data and complete your
>>>>                     authorization architecture. Implement Authress
>>>>                     <https://bit.ly/37SSO1p>.
>>>>
>>>>                     _______________________________________________
>>>>                     OAuth mailing list
>>>>                     OAuth@ietf.org  <mailto:OAuth@ietf.org>
>>>>                     https://www.ietf.org/mailman/listinfo/oauth
>>>
>>>                     -- 
>>>                     Jim Manico
>>>                     Manicode Security
>>>                     https://www.manicode..com  <https://www.manicode.com>
>>>
>>>                     _______________________________________________
>>>                     OAuth mailing list
>>>                     OAuth@ietf.org <mailto:OAuth@ietf.org>
>>>                     https://www.ietf.org/mailman/listinfo/oauth
>>>
>>             _______________________________________________
>>             OAuth mailing list
>>             OAuth@ietf.org <mailto:OAuth@ietf.org>
>>             https://www.ietf.org/mailman/listinfo/oauth
>>
>     _______________________________________________
>     OAuth mailing list
>     OAuth@ietf.org <mailto:OAuth@ietf.org>
>     https://www.ietf.org/mailman/listinfo/oauth
>
-- 
Jim Manico
Manicode Security
https://www.manicode.com