Re: [OAUTH-WG] Authorization code reuse and OAuth 2.1

Warren Parad <wparad@rhosys.ch> Wed, 13 October 2021 18:18 UTC

Return-Path: <wparad@rhosys.ch>
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 CE9053A0902 for <oauth@ietfa.amsl.com>; Wed, 13 Oct 2021 11:18:33 -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_MESSAGE=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=rhosys.ch
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 UtOhxUaV1nQH for <oauth@ietfa.amsl.com>; Wed, 13 Oct 2021 11:18:28 -0700 (PDT)
Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com [IPv6:2607:f8b0:4864:20::b30]) (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 1634E3A08DE for <oauth@ietf.org>; Wed, 13 Oct 2021 11:18:28 -0700 (PDT)
Received: by mail-yb1-xb30.google.com with SMTP id i84so8479731ybc.12 for <oauth@ietf.org>; Wed, 13 Oct 2021 11:18:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rhosys.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4PPFc/34zNHfyUrPGzbooZ32z0L9uX+6wTqvz6wepnU=; b=h6ppNXkxztLN7Ec5LV9X2KiL+kotsk7EekfivT8wy8mzWTr/zi0KukyMljb7UrQG0C 8WIL3TVACUFKAuvis3amCiw8hXMvp0RIBJNu7ar8JrjpbPymSHQb5LmSGbqFfmrs/tS0 Jh2Jj6iFL9QeAq5gy93TXKXRZUiZtyY+Yfn+FJp/39nl7KNGPkhQK+Wqx7eUTb5k7XfZ 3JxOM65ZWU8kmMhwKfwAWH7+nr0cH4AmrXyzshiMdGoHKXQUmT414jh4xFER1r/jrnWq gNx+FtvzRwKAU5YVySAeFpipNjp1bPORyE1Z1DnXAoytUeIVdmIs+hhwn4yOFCW0xCzp gpUw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4PPFc/34zNHfyUrPGzbooZ32z0L9uX+6wTqvz6wepnU=; b=WWg3ZWQH/VPVPdMsoHRaa+P/E4PrMOntbBte4z/AD2qOe4iFPrBuPIJimpRR3KNcGA JCNPaqZ//g4WENwLTGEQ2sbHhZFe9zK40w/0baxlTA+saAcedY9mnFkbpyqs0+h+3rzl XORElkOk4fcVLZFogt/Ozh4guRK/HdkbIhG/HeyCNIBZrkcJiK1xS0iLfL+YN8K4c8VY +HZPhTZ77S1XWEz3S6BZ5NjF+jco5p/sYQRPWcvSK4lSc9IEZPu/nPCjAW9UoES2i84N PZjIED9tRL+acEVvdIQPaJ92GIBG+9IYZ3zwmnPdRpj/NZ+SLuvFAdMHpvxbsNDohQbI rYtQ==
X-Gm-Message-State: AOAM531J5D4nt33LRJEdB4HOdR2fowofK6CEEPQFz/yRlG8AxibayiiE XP8YOcFlFbZIOmx3tPVhRzsjK60sImXZllS9sSYskp6+iA==
X-Google-Smtp-Source: ABdhPJwqIKG93UTzymK3VwpR7viV9D7ftolXDh2ksSfehMCzd2Iy51wPlgo1dIZ6v92jpdrgXMSOpqnCpalu03qwLw0=
X-Received: by 2002:a25:5646:: with SMTP id k67mr1007570ybb.127.1634149107022; Wed, 13 Oct 2021 11:18:27 -0700 (PDT)
MIME-Version: 1.0
References: <CAGBSGjpJrM4uUTdVvsEzh5sT0H9ZpEJ0D3yfo-p_1S9w_tdF8g@mail.gmail.com> <4E04231B-51FA-429F-8D45-022B7D27E5B1@forgerock.com> <CAJot-L2K3XCwUSgE7Jq9Ug3serBNgQS0=fxa0BoLi=uKZqCZLg@mail.gmail.com> <CAKhDPzPSgV2vgx+Jm3PCD=7upU=x4sD6wh-a_xBC0SwCo_DyjQ@mail.gmail.com>
In-Reply-To: <CAKhDPzPSgV2vgx+Jm3PCD=7upU=x4sD6wh-a_xBC0SwCo_DyjQ@mail.gmail.com>
From: Warren Parad <wparad@rhosys.ch>
Date: Wed, 13 Oct 2021 20:18:16 +0200
Message-ID: <CAJot-L2bMy-NiZ_orW19ejzVXVqAV550WrDxwJHV6okcXbGzjA@mail.gmail.com>
To: Jeff Craig <jeffcraig=40google.com@dmarc.ietf.org>
Cc: Neil Madden <neil.madden@forgerock.com>, oauth <oauth@ietf.org>
Content-Type: multipart/alternative; boundary="00000000000008d26b05ce3ffda7"
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/5Wjd2hNUiW_SU-pm58BcgjLp_BU>
Subject: Re: [OAUTH-WG] Authorization code reuse and OAuth 2.1
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: Wed, 13 Oct 2021 18:18:34 -0000

(It's a bit of a tangent, but having the PKCE for confidential clients
severely cuts down on extra complexity for client platforms/development
teams when an AS choses to allow it for some clients and not for others.
Consistency here is a good thing, since it's fairly easy to implement the
roundtrip through libraries.)

Warren Parad

Founder, CTO
Secure your user data with IAM authorization as a service. Implement
Authress <https://authress.io/>.


On Wed, Oct 13, 2021 at 8:15 PM Jeff Craig <jeffcraig=
40google.com@dmarc.ietf.org> wrote:

> OAuth 2.1 makes PKCE a requirement.
>
> I'm of two minds about PKCE for Confidential Clients, but it isn't a
> substantially more complex flow even if Confidential Clients benefit far
> less from PKCE than Public Clients, and I see the benefit to always doing
> it.
>
> I am inclined to agree that with PKCE, replay attacks are substantially
> less of a risk, but I need to think more about this (and I missed today's
> meeting, so I should look over the notes before commenting too deeply).
>
> On Wed, Oct 13, 2021 at 1:03 PM Warren Parad <wparad=
> 40rhosys.ch@dmarc.ietf.org> wrote:
>
>> Thanks Aaron, that's a great point. In light of that, I would ask about
>> the recommendation for non-SPA. I was under the impression that non-SPA's
>> don't require the use of PKCE, which would make them vulnerable to replay
>> attacks. Or am I missing something?
>>
>> Warren Parad
>>
>> Founder, CTO
>> Secure your user data with IAM authorization as a service. Implement
>> Authress <https://authress.io/>.
>>
>>
>> On Wed, Oct 13, 2021 at 7:59 PM Neil Madden <neil.madden@forgerock.com>
>> wrote:
>>
>>> I wasn’t on the call either, so maybe I’m missing something. If you’re
>>> using PKCE with the “plain” challenge type then both the auth code and the
>>> verifier are exposed in redirect URI parameters in the user-agent aren’t
>>> they? That seems a bit risky to drop the one-time use requirement.
>>>
>>> I can’t see anything in the minutes of the meeting describing the
>>> difficulty of implementing the one-time use req. I seem to see
>>> announcements for new globally-consistent high-scale cloud database
>>> services every day - is this really that hard to implement?
>>>
>>> — Neil
>>>
>>> On 13 Oct 2021, at 18:41, Aaron Parecki <aaron@parecki.com> wrote:
>>>
>>> 
>>> Warren, I didn't see you on the interim call, so you might be missing
>>> some context.
>>>
>>> The issue that was discussed is that using PKCE already provides all the
>>> security benefit that is gained by enforcing single-use authorization
>>> codes. Therefore, requiring that they are single-use isn't necessary as it
>>> doesn't provide any additional benefit.
>>>
>>> If anyone can think of a possible attack by allowing authorization codes
>>> to be reused *even with a valid PKCE code verifier* then that would warrant
>>> keeping this requirement.
>>>
>>> ---
>>> Aaron Parecki
>>>
>>>
>>> On Wed, Oct 13, 2021 at 10:27 AM Warren Parad <wparad=
>>> 40rhosys.ch@dmarc.ietf.org> wrote:
>>>
>>>> Isn't it better for it to be worded as we want it to be, with the
>>>> implication being that of course it might be difficult to do that, but that
>>>> AS devs will think long and hard about sometimes not denying the request?
>>>> Even with MUST, some AS will still allow reuse of auth codes. Isn't that
>>>> better than flat out saying: *sure, there's a valid reason*
>>>>
>>>> In other words, how do we think about RFCs? Do they exist to be
>>>> followed to the letter or not at all? Or do they exist to stipulate this is
>>>> the way, but acknowledge that not everyone will build a solution that holds
>>>> them as law.
>>>>
>>>> Let's look at *SHOULD*
>>>>
>>>>> This word, or the adjective "RECOMMENDED", mean that there may exist
>>>>> valid reasons in particular circumstances to ignore a particular item, but
>>>>> the full implications must be understood and carefully weighed before
>>>>> choosing a different course.
>>>>
>>>>
>>>> I think *recommended* here is not sufficient nor are there valid
>>>> reasons. "It's too hard" isn't really a valid reason. Isn't it better in
>>>> this case for an AS to not be compliant with the RFC, than it is to relax
>>>> this to SHOULD and have lots of AS thinking reusing auth codes is a viable
>>>> solution, "because they are a special snowflake where SHOULD should apply".
>>>>
>>>> Are we setting the standard or instead attempting to sustain a number
>>>> of "AS that are in compliance with the RFC"?
>>>>
>>>>
>>>> Warren Parad
>>>>
>>>> Founder, CTO
>>>> Secure your user data with IAM authorization as a service. Implement
>>>> Authress <https://authress.io/>.
>>>>
>>>>
>>>> On Wed, Oct 13, 2021 at 7:17 PM Mike Jones <Michael.Jones=
>>>> 40microsoft.com@dmarc.ietf.org> wrote:
>>>>
>>>>> During today’s call, it was asked whether we should drop the OAuth 2.0
>>>>> language that:
>>>>>
>>>>>          The client MUST NOT use the authorization code
>>>>>
>>>>>          more than once.  If an authorization code is used more than
>>>>>
>>>>>          once, the authorization server MUST deny the request and
>>>>> SHOULD
>>>>>
>>>>>          revoke (when possible) all tokens previously issued based on
>>>>>
>>>>>          that authorization code.”
>>>>>
>>>>>
>>>>>
>>>>> The rationale given was that enforcing one-time use is impractical in
>>>>> distributed authorization server deployments.
>>>>>
>>>>>
>>>>>
>>>>> Thinking about this some more, at most, we should relax this to:
>>>>>
>>>>>          The client MUST NOT use the authorization code
>>>>>
>>>>>          more than once.  If an authorization code is used more than
>>>>>
>>>>>          once, the authorization server SHOULD deny the request and
>>>>> SHOULD
>>>>>
>>>>>          revoke (when possible) all tokens previously issued based on
>>>>>
>>>>>          that authorization code.”
>>>>>
>>>>>
>>>>>
>>>>> In short, it should remain illegal for the client to try to reuse the
>>>>> authorization code.  We can relax the MUST to SHOULD in the server
>>>>> requirements in recognition of the difficulty of enforcing the MUST.
>>>>>
>>>>>
>>>>>
>>>>> Code reuse is part of some attack scenarios.  We must not sanction it.
>>>>>
>>>>>
>>>>>
>>>>>                                                           -- Mike
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> 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
>>>>
>>> _______________________________________________
>>> OAuth mailing list
>>> OAuth@ietf.org
>>> https://www.ietf.org/mailman/listinfo/oauth
>>>
>>>
>>> Manage My Preferences <https://preferences.forgerock.com/>, Unsubscribe
>>> <https://preferences.forgerock.com/>
>>>
>>> _______________________________________________
>> OAuth mailing list
>> OAuth@ietf.org
>> https://www.ietf.org/mailman/listinfo/oauth
>>
>