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

From: Mike Jones <[email-masked]>
Date: Wed, 6 May 2020 20:39:20 +0000

It could, but that would require an explicit decision by the OpenID Connect working group to make existing RPs incompatible with new OPs, breaking interoperability.  That’s not a decision we should make lightly or without a compelling reason to do so.

                                                       -- Mike

From: Phillip Hunt <[email-masked]>
Sent: Wednesday, May 6, 2020 1:16 PM
To: Mike Jones <[email-masked]>
Cc: Aaron Parecki <[email-masked]>; Steinar Noem <[email-masked]>; [email-masked]
Subject: Re: [OAUTH-WG] OAuth 2.1 - require PKCE?

Why couldn’t OIDC evolve as a spec to conform and match FAPI and 2.1?
Phil

On May 6, 2020, at 12:34 PM, Mike Jones <[email-masked]<mailto:[email-masked]>> wrote:

Yes, FAPI requires PKCE, which is great.  Many of its requirements come from OpenID Connect but some of them are intentionally incompatible – such as requiring that Basic authentication not be supported, whereas Connect requires that it be supported.  It’s a different ecosystem with different requirements.

Don’t get me wrong, I support PKCE where it makes sense, such as when you’re doing bare OAuth without OpenID Connect.  But trying to impose an unnecessary requirement on a working and secure ecosystem will just create grief for us and our customers and lessen our credibility as stewards of the OAuth ecosystem.

                                                       -- Mike

From: Aaron Parecki <[email-masked]<mailto:[email-masked]>>
Sent: Wednesday, May 6, 2020 12:29 PM
To: Steinar Noem <[email-masked]<mailto:[email-masked]>>
Cc: Phillip Hunt <[email-masked]<mailto:[email-masked]>>; Mike Jones <[email-masked]<mailto:[email-masked]>>; [email-masked]<mailto:[email-masked]>
Subject: Re: [OAUTH-WG] OAuth 2.1 - require PKCE?

I should add that even some OpenID Connect profiles require PKCE, such as FAPI:

https://openid.net/specs/openid-financial-api-part-1.html#authorization-server

So the precedent for requiring PKCE already exists within some OpenID Connect profiles.

On Wed, May 6, 2020 at 12:23 PM Aaron Parecki <[email-masked]<mailto:[email-masked]>> wrote:
Yes, and also, many of those providers very likely already support PKCE already. Skimming through that list of certified OPs, I recognize many names there from providers that I know support PKCE.

On Wed, May 6, 2020 at 12:18 PM Steinar Noem <[email-masked]<mailto:[email-masked]>> wrote:
So, wouldn't a MUST just mean that we would have some OPs that are 2.1 compliant and some that aren't?

ons. 6. mai 2020 kl. 21:12 skrev Phillip Hunt <[email-masked]<mailto:[email-masked]>>:
Mike,

The point of 2.1 is to raise the security bar..

Yes it adds new MUST requirements.

But what about OIDC would break other than required implementation of PKCE to support 2.1?

Eg Would additional signaling be required to facilitate interoperability and migration between versions? Would that be an oauth issue or an OIDC one?

Phil

On May 6, 2020, at 11:56 AM, Aaron Parecki <[email-masked]<mailto:[email-masked]>> wrote:

> In particular, authorization servers shouldn’t be required to support PKCE when they already support the OpenID Connect nonce.

The Security BCP already requires that ASs support PKCE: https://tools.ietf.org/html/draft-ietf-oauth-security-topics-15#section-2.1.1 Are you suggesting that the Security BCP change that requirement as well? If so, that's a discussion that needs to be had ASAP. If not, then that's an implicit statement that it's okay for OpenID Connect implementations to not be best-practice OAuth implementations. And if that's the case, then I also think it's acceptable that they are not complete OAuth 2.1 implementations either.

On Wed, May 6, 2020 at 11:21 AM Mike Jones <Michael.Jones=[email-masked]<mailto:[email-masked]>> wrote:
The disadvantage of requiring PKCE for OpenID Connect implementations is that you’re trying to add a normative requirement that’s not required of OpenID Connect deployments today, which would bifurcate the ecosystem.  There are hundreds of implementations (including the 141 certified ones at https://openid.net/certification/), none of which have ever been required to support PKCE.  Therefore, most don’t.

Per feedback already provided, I believe that OAuth 2.1 should align with the guidance already in the draft Security BCP, requiring EITHER the use of PKCE or the OpenID Connect nonce.  Trying to retroactively impose unnecessary requirements on existing deployments is unlikely to succeed and will significantly reduce the relevance of the OAuth 2.1 effort.

In particular, authorization servers shouldn’t be required to support PKCE when they already support the OpenID Connect nonce.  And clients shouldn’t reject responses from servers that don’t support PKCE when they do contain the OpenID Connect nonce.  Doing so would unnecessarily break things and create confusion in the marketplace.

                                                          -- Mike

From: OAuth <[email-masked]<mailto:[email-masked]>> On Behalf Of Dick Hardt
Sent: Wednesday, May 6, 2020 10:48 AM
To: [email-masked]<mailto:[email-masked]>
Subject: [OAUTH-WG] OAuth 2.1 - require PKCE?

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

[https://mailfoogae..appspot.com/t?sender=aZGljay5oYXJkdEBnbWFpbC5jb20%3D&type=zerocontent&guid=452438ba-d429-4656-ace9-b284744bc171]ᐧ
_______________________________________________
OAuth mailing list
[email-masked]<mailto:[email-masked]>
https://www.ietf.org/mailman/listinfo/oauth
_______________________________________________
OAuth mailing list
[email-masked]<mailto:[email-masked]>
https://www.ietf.org/mailman/listinfo/oauth
_______________________________________________
OAuth mailing list
[email-masked]<mailto:[email-masked]>
https://www.ietf.org/mailman/listinfo/oauth

--
Vennlig hilsen

Steinar Noem
Partner Udelt AS
Systemutvikler

| [email-masked]<mailto:[email-masked]> | [email-masked]<mailto:[email-masked]>  | +47 955 21 620 | www.udelt.no<http://www.udelt.no/> |

---

From: Mike Jones <[email-masked]>
Date: Wed, 6 May 2020 20:51:12 +0000

Requiring a change to every deployed RP is not “a very small leap”.  It’s an invasive big deal, introducing a breaking change and bifurcating a well-functioning ecosystem without sufficient cause.

What this actually points out to me is that we should modify the language in the Security BCP to say something like “OAuth Servers MUST support PKCE unless they are only used for OpenID Connect Authentication Requests”.  I’d thought that that was already the case, as that mirrors the client requirements and I apparently failed to read it closely enough.  I’ll submit a separate request for the change to the Security BCP to make it self-consistent.

                                                       -- Mike

From: Aaron Parecki <[email-masked]>
Sent: Wednesday, May 6, 2020 1:43 PM
To: Mike Jones <[email-masked]>
Cc: Dick Hardt <[email-masked]>; [email-masked]
Subject: Re: [OAUTH-WG] OAuth 2.1 - require PKCE?

Going back to this point about server vs client requirements, since both the Security BCP and OAuth 2.1 currently say that ASs MUST support PKCE, isn't that already imposing additional requirements on OpenID Connect providers that don't currently exist in OpenID Connect alone?

OPs that want to be compliant with the Security BCP will need to add PKCE support if they don't already have it (many of them already support it so for many of them this will not be any change), so it seems like a very small leap to also require clients implement PKCE as well.

On Wed, May 6, 2020 at 12:31 PM Mike Jones <[email-masked]<mailto:[email-masked]>> wrote:
I realize what it says about servers.  My point is that OAuth 2.1’s requirements on clients should match those in the security BCP and not try to go beyond them.

                                                       -- Mike

From: Aaron Parecki <[email-masked]<mailto:[email-masked]>>
Sent: Wednesday, May 6, 2020 12:24 PM
To: Mike Jones <[email-masked]<mailto:[email-masked]>>
Cc: Dick Hardt <[email-masked]<mailto:[email-masked]>>; [email-masked]<mailto:[email-masked]>
Subject: Re: [OAUTH-WG] OAuth 2.1 - require PKCE?

Yes, the BCP says *clients* may use either PKCE or nonce to prevent authorization code injection. Shortly after that quoted segment is the below:

> Authorization servers MUST support PKCE [RFC7636].

On Wed, May 6, 2020 at 12:22 PM Mike Jones <[email-masked]<mailto:[email-masked]>> wrote:
Aaron, the section you cited at https://tools.ietf.org/html/draft-ietf-oauth-security-topics-15#section-2.1.1 makes it clear that clients can support EITHER PKCE or the OpenID Connect nonce.   The text is:

   Clients MUST prevent injection (replay) of authorization codes into
   the authorization response by attackers.  The use of PKCE [RFC7636<https://tools.ietf.org/html/rfc7636>]
   is RECOMMENDED to this end.  The OpenID Connect "nonce" parameter and
   ID Token Claim [OpenID<https://tools.ietf.org/html/draft-ietf-oauth-security-topics-15#ref-OpenID>] MAY be used as well.  The PKCE challenge or
   OpenID Connect "nonce" MUST be transaction-specific and securely
   bound to the client and the user agent in which the transaction was
   started.

We should not attempt to change that in OAuth 2.1, as doing so would needlessly break already working and secure clients.

                                                       -- Mike

From: Aaron Parecki <[email-masked]<mailto:[email-masked]>>
Sent: Wednesday, May 6, 2020 11:56 AM
To: Mike Jones <[email-masked]<mailto:[email-masked]>>
Cc: Dick Hardt <[email-masked]<mailto:[email-masked]>>; [email-masked]<mailto:[email-masked]>
Subject: [EXTERNAL] Re: [OAUTH-WG] OAuth 2.1 - require PKCE?

                                                          -- Mike

Hello!

Dick, Aaron, and Torsten

---

From: Mike Jones <[email-masked]>
Date: Fri, 8 May 2020 20:24:50 +0000

Actually, the first paragraph of the Security BCP section at https://tools.ietf.org/html/draft-ietf-oauth-security-topics-15#section-2.1.1, which has gone through WGLC, includes the use of “nonce” to prevent authorization code injection as a best practice.  That’s already a pretty strong stamp of approval by the OAuth working group.

                                                       -- Mike

From: Phillip Hunt <[email-masked]>
Sent: Friday, May 8, 2020 12:45 PM
To: Dick Hardt <[email-masked]>
Cc: Philippe De Ryck <[email-masked]>; Mike Jones <[email-masked]>; OAuth WG <[email-masked]>
Subject: Re: [OAUTH-WG] OAuth 2.1 - require PKCE?

We are not discussing anything new here. We are discussing adoption of best practice.

The disconnect appears to be that one dependent standard’s “typical” use (nonces) does not have the ietf consensus as best practice.

This lack of consensus needs to be resolved.

Phil

On May 8, 2020, at 12:37 PM, Dick Hardt <[email-masked]<mailto:[email-masked]>> 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 <[email-masked]<mailto:[email-masked]>> 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=[email-masked]<mailto:Michael.Jones=[email-masked]>> 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 <[email-masked]<mailto:[email-masked]>>
Sent: Thursday, May 7, 2020 4:39 PM
To: Dick Hardt <[email-masked]<mailto:[email-masked]>>
Cc: OAuth WG <oauth@ietf..org<mailto:[email-masked]>>; Torsten Lodderstedt <[email-masked]<mailto:torsten@lodderstedt..net>>; Mike Jones <[email-masked]<mailto:[email-masked]>>
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 <[email-masked]<mailto:[email-masked]>> wrote:
Hello!

Dick, Aaron, and Torsten

ᐧ