Re: [OAUTH-WG] OAuth 2.1 - require PKCE?

Aaron Parecki <aaron@parecki.com> Fri, 08 May 2020 19:42 UTC

Return-Path: <aaron@parecki.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 B78C93A088E for <oauth@ietfa.amsl.com>; Fri, 8 May 2020 12:42:24 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.897
X-Spam-Level:
X-Spam-Status: No, score=-1.897 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_FONT_LOW_CONTRAST=0.001, HTML_MESSAGE=0.001, SPF_HELO_NONE=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=parecki-com.20150623.gappssmtp.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 7pKEwHrI6tm4 for <oauth@ietfa.amsl.com>; Fri, 8 May 2020 12:42:20 -0700 (PDT)
Received: from mail-oi1-x230.google.com (mail-oi1-x230.google.com [IPv6:2607:f8b0:4864:20::230]) (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 451F63A0C44 for <oauth@ietf.org>; Fri, 8 May 2020 12:42:20 -0700 (PDT)
Received: by mail-oi1-x230.google.com with SMTP id a2so9230209oia.11 for <oauth@ietf.org>; Fri, 08 May 2020 12:42:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=parecki-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OXQsGbhPJH23QmnAZvmF0NaZP39H+SM+vtqepqk9+rQ=; b=ZuzDiTfZ49etseFEMQyuIUJfbohNPmmuldX9U8v0Wv/LBi5sEekThXTRMLGCXOXswb mnWOSDNI8scFfSWrnwRXTeyCyJ91gM/LeBVEwxPZ6mfkMfmL26wGiqx1LgIsuK+6P8lk RbY5pWz79uzod5fReQZkycDyE/InyOjbBkCq3AQ9AkP4Bj1uo3mWGMoYAxRDsp/mjrKF nreePIPTAHB26+RTZYbprKaF0NhAtrb0jlwd6LbcqIrOjh3fwEOgZhaP+1bsPUQjcD5B dqmdq7qSyAkRJ6xPLeVNvp/6mGGpmNdh76jR8MlOOLFa+4HeqFtychm+CKNgwMh4A6Qm rk0A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OXQsGbhPJH23QmnAZvmF0NaZP39H+SM+vtqepqk9+rQ=; b=HsoTVee8PGfhu8FMbnTdXtDuIne27YWhMRAzavb1foHWCeo3lNauRiSYY8ItoJRNxA DtNY0A7lf4F582LwgZjpAuB5h6YxiVYDKB2io+L2299QPvL4ubQG91bd8RQzT5RNyNj5 aYN3Lz2vh7YvdgHYOljDwK4T4FPihx747tobdyJvGkYZZy+b+1wkq3ZA63a3izgNgNqU MwYJtx6E6VpNHWmprP7hpwcTwJYXUZer9uA98KDFrSZCCEpLD76bV6RB+P39X+2EK54r 4wDyWixnPe8ghC3ujHBWvg1BvpkNgqgHebJtBmui0m52h5hT0+UUws1x7Zg1o4l73D6S kYfw==
X-Gm-Message-State: AGi0PuaLhDAMxzS4T7JNctsBtL5XSdnfQYjOXy5gs4mnvKZaxuOb3NJ0 HaTEEuEB74k99+qZ7wo52oWvY5Ws8X0=
X-Google-Smtp-Source: APiQypKxhB07mT4c0vko2fsraBDMcNVi84aQE2GnKbEjmGzHPVF7T5v25HBh9UyMKZe88ebohL/YJQ==
X-Received: by 2002:aca:1c08:: with SMTP id c8mr11634202oic.172.1588966938597; Fri, 08 May 2020 12:42:18 -0700 (PDT)
Received: from mail-oi1-f176.google.com (mail-oi1-f176.google.com. [209.85.167.176]) by smtp.gmail.com with ESMTPSA id a124sm657022oib.43.2020.05.08.12.42.17 for <oauth@ietf.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 May 2020 12:42:17 -0700 (PDT)
Received: by mail-oi1-f176.google.com with SMTP id b18so9442762oic.6 for <oauth@ietf.org>; Fri, 08 May 2020 12:42:17 -0700 (PDT)
X-Received: by 2002:a54:4512:: with SMTP id l18mr10871666oil.81.1588966937186; Fri, 08 May 2020 12:42:17 -0700 (PDT)
MIME-Version: 1.0
References: <BY5PR00MB06766F71775C01E586CD1C12F5A20@BY5PR00MB0676.namprd00.prod.outlook.com> <A16DE3EC-26C8-4D0A-8592-5703159367E0@pragmaticwebsecurity.com> <CAD9ie-vosKtF2jSLtZSKk4E2-6BEOGZzvzNeH=HQy2L6DCuonw@mail.gmail.com>
In-Reply-To: <CAD9ie-vosKtF2jSLtZSKk4E2-6BEOGZzvzNeH=HQy2L6DCuonw@mail.gmail.com>
From: Aaron Parecki <aaron@parecki.com>
Date: Fri, 8 May 2020 12:42:05 -0700
X-Gmail-Original-Message-ID: <CAGBSGjp7SKiyD5DFYFb3kQXxpnL8cU7UObDTg2J+CL_FJaK7ew@mail.gmail.com>
Message-ID: <CAGBSGjp7SKiyD5DFYFb3kQXxpnL8cU7UObDTg2J+CL_FJaK7ew@mail.gmail.com>
To: Dick Hardt <dick.hardt@gmail.com>
Cc: Philippe De Ryck <philippe@pragmaticwebsecurity.com>, Mike Jones <Michael.Jones=40microsoft.com@dmarc.ietf.org>, OAuth WG <oauth@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000d9d89f05a528314d"
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/FhmIsEod25WkCt0PTjSSaG-Iw_c>
Subject: Re: [OAUTH-WG] OAuth 2.1 - require PKCE?
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: Fri, 08 May 2020 19:42:26 -0000

> FYI: An objective of OAuth 2.1 is not to introduce anything new -- it is
OAuth 2.0 with best practices.

The line there is kind of fuzzy. The objective is not to introduce new
concepts, however there are some changes defined that are "breaking
changes" from plain OAuth 2.0, because those things being removed were not
best practices for example.

> Understanding the subtle nuances of when a nonce is fine and when PKCE
should be used is impossible without in-depth knowledge of the flows and
their properties. Misunderstandings will cause security vulnerabilities,
which can easily be avoided.

Thank you Philippe. And yes, many existing OAuth 2.0 deployments would
already need to change in order to be compliant with OAuth 2.1, just like
they would need to change to update to the latest recommendations of the
Security BCP.


On Fri, May 8, 2020 at 12:36 PM Dick Hardt <dick.hardt@gmail.com> wrote:

> FYI: An objective of OAuth 2.1 is not to introduce anything new -- it is
> OAuth 2.0 with best practices.
>
> On Thu, May 7, 2020 at 10:36 PM Philippe De Ryck <
> philippe@pragmaticwebsecurity.com> wrote:
>
>> From working with a lot of developers on understanding OAuth 2.0 and
>> OIDC, I definitely vote for simplicity. Understanding the subtle nuances of
>> when a nonce is fine and when PKCE should be used is impossible without
>> in-depth knowledge of the flows and their properties. Misunderstandings
>> will cause security vulnerabilities, which can easily be avoided.
>>
>> Since OAuth 2.1 is a separate spec, I don’t really see a problem with
>> existing code not being compliant. They support OAuth 2.0, and if they want
>> to be OAuth 2.1 compliant, they add PKCE. If I’m not mistaken, other
>> requirements of OAuth 2.1 would also clash with existing deployments (e.g.,
>> using non-exact redirect URIs).
>>
>> I believe that optimizing for making OAuth 2.1 easier to understand will
>> yield the highest return.
>>
>> Philippe
>>
>>
>> On 8 May 2020, at 03:42, Mike Jones <
>> Michael.Jones=40microsoft.com@dmarc.ietf.org> wrote:
>>
>> Aaron, I believe you’re trying to optimize the wrong thing.  You’re
>> concerned about “the amount of explanation this will take”.  That’s
>> optimizing for spec simplicity – a goal that I do understand.  However, by
>> writing these few sentences or paragraphs, we’ll make it clear to
>> developers that hundreds or thousands of deployed OpenID Connect RPs won’t
>> have to change their deployments.  That’s optimizing for interoperability
>> and minimizing the burden on developers, which are far more important.
>>
>> As Brian Campbell wrote, “They are not equivalent and have very
>> different ramifications on interoperability”.
>>
>> Even if you’re optimizing for writing, taking a minimally invasive
>> protocol change approach will optimize that, overall.  If we proceed as
>> you’re suggesting, a huge amount of writing will occur on StackOverflow,
>> Medium, SlashDot, blogs, and other developer forums, where confused
>> developers will ask “Why do I have to change my deployed code?” with the
>> answers being “Despite what the 2.1 spec says, there’s no need to change
>> your deployed code.”
>>
>> I’d gladly write a few sentences in our new specs now to prevent ongoing
>> confusion and interop problems that would otherwise result.  Let me know
>> when you’re ready to incorporate them into the spec text.
>>
>>                                                        -- Mike
>>
>> *From:* Aaron Parecki <aaron@parecki.com>
>> *Sent:* Thursday, May 7, 2020 4:39 PM
>> *To:* Dick Hardt <dick.hardt@gmail.com>
>> *Cc:* OAuth WG <oauth@ietf.org>rg>; Torsten Lodderstedt <
>> torsten@lodderstedt.net>gt;; Mike Jones <Michael.Jones@microsoft.com>
>> *Subject:* Re: OAuth 2.1 - require PKCE?
>>
>> Backing up a step or two, there's another point here that I think has
>> been missed in these discussions.
>>
>> PKCE solves two problems: stolen authorization codes for public clients,
>> and authorization code injection for all clients. We've only been talking
>> about authorization code injection on the list so far. The quoted section
>> of the security BCP (4.5.3) which says clients can do PKCE or use the
>> nonce, is only talking about preventing authorization code injection.
>>
>> The nonce parameter solves authorization code injection if the client
>> requests an ID token. Public clients using the nonce parameter are still
>> susceptible to stolen authorization codes so they still need to do PKCE as
>> well.
>>
>> The only case where OpenID Connect clients don't benefit from PKCE is if
>> they are also confidential clients. Public client OIDC clients still need
>> to do PKCE even if they check the nonce.
>>
>> OpenID Connect servers working with confidential clients still benefit
>> from PKCE because they can then enforce the authorization code injection
>> protection server-side rather than cross their fingers that clients
>> implemented the nonce check properly.
>>
>> I really don't think it's worth the amount of explanation this will take
>> in the future to write an exception into OAuth 2.1 or the Security BCP for
>> only some types of OpenID Connect clients when all clients would benefit
>> from PKCE anyway.
>>
>> Aaron
>>
>>
>>
>> On Wed, May 6, 2020 at 10:48 AM Dick Hardt <dick.hardt@gmail.com> wrote:
>>
>> Hello!
>>
>> We would like to have PKCE be a MUST in OAuth 2.1 code flows. This is
>> best practice for OAuth 2.0. It is not common in OpenID Connect servers as
>> the nonce solves some of the issues that PKCE protects against. We think
>> that most OpenID Connect implementations also support OAuth 2.0, and
>> hence have support for PKCE if following best practices.
>>
>> The advantages or requiring PKCE are:
>>
>> - a simpler programming model across all OAuth applications and profiles
>> as they all use PKCE
>>
>> - reduced attack surface when using  S256 as a fingerprint of the
>> verifier is sent through the browser instead of the clear text value
>>
>> - enforcement by AS not client - makes it easier to handle for client
>> developers and AS can ensure the check is conducted
>>
>> What are disadvantages besides the potential impact to OpenID Connect
>> deployments? How significant is that impact?
>>
>> Dick, Aaron, and Torsten
>>
>> ᐧ
>>
>> _______________________________________________
>> OAuth mailing list
>> OAuth@ietf.org
>> https://www.ietf.org/mailman/listinfo/oauth
>>
>>
>>