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

From: Mike Jones <[email-masked]>
Date: Fri, 8 May 2020 16:55:17 +0000

Daniel, you wrote:
> We would then have:
> - use PKCE, except if you use OIDC with a nonce, then you don't need PKCE, except if you are a public client, then you still need PKCE.
> - use state, except if you use PKCE, then you don't need state.

I believe that this is an accurate statement of the facts, balancing interoperability and simplicity.  That’s what we should therefore say in the spec (possibly rewording it to make it easier to parse and understand).

I would be OK going so far as also saying something along the lines of:
  - Alternatively, new implementations may choose to always use PKCE, provided that the client somehow can determine that the server it is communicating with also supports PKCE.
That seems like a viable compromise, giving developers accurate information that is actionable.

But mandating PKCE in all cases, even when unnecessary, would be an interop disaster and would cause many to simply ignore the new spec.

OAuth 2.1 was supposed to not introduce breaking changes.  If you want to do that, please do it in TxAuth instead.

                                                       -- Mike

From: OAuth <[email-masked]> On Behalf Of Daniel Fett
Sent: Thursday, May 7, 2020 11:50 PM
To: [email-masked]
Subject: Re: [OAUTH-WG] OAuth 2.1 - require PKCE?

+1 to all what Aaron said. Thanks for pointing this out!

We need to address this in the security BCP and this will be a normative change that affects OpenID Connect Core (just as our current recommendation on the usage of nonce).

We would then have:

- use PKCE, except if you use OIDC with a nonce, then you don't need PKCE, except if you are a public client, then you still need PKCE.
- use state, except if you use PKCE, then you don't need state.

I think there are very good reasons to simplify this down to

- use PKCE
- you may or may not use state

First and foremost, not many people will understand why there are cases when the BCP/OAuth 2.1 mandate PKCE and some where they don't. However, understanding why you have to do something is key to compliance. The short version "PKCE protects the code; there is a specific case where it is not needed, but its better to use it all the time" is easy to understand. We will not see many implementations following the long version above correctly.

Second, we dramatically reduce technical complexity by reducing cases that need to be handled. We reduce correctness and compliance testing complexity in the same way. We reduce the cost of security analysis, which scales really badly to more cases.

And finally, using nonce to protect against code injection is less robust than PKCE. AS have a better track record than clients when it comes to correctly implementing security mechanisms.

Yes, this will make a number of implementations non-spec-compliant, but I do not think that this is a huge problem. Software needs to adapt all the time and a software that has not been changed in a while is probably not one you would want to use anyway. We are setting a new goal for implementations to meet and eventually, maintained implementations will get there.

-Daniel

Am 08.05.20 um 01:38 schrieb Aaron Parecki:
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!

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

[email-masked]<mailto:[email-masked]>

https://www.ietf.org/mailman/listinfo/oauth

---

From: Torsten Lodderstedt <[email-masked]>
Date: Sun, 10 May 2020 12:15:05 +0200

Hi Mike,

Mike Jones <Michael.Jones=[email-masked]> schrieb am Fr. 8.
Mai 2020 um 18:55:

> OAuth 2.1 was supposed to not introduce breaking changes.
>
I cannot remember the WG met that decision. Can you please refer to the
respective thread?

Requiring exact redirect URI matching is already a breaking change. Do you
oppose against this as well?

If you want to do that, please do it in TxAuth instead.

Interesting statement. Does it mean you want to conserve OAuth 2.0 and
force any enhancements/improvements to go into TXAuth? This would cause
huge migration efforts for existing deployments wanting to benefit from
those enhancements.

I think existing deployments are better served by actively maintaining and
evolving the 2.x line. For example, PAR and RAR are attempts to improve
OAuth 2.x and make it usable for new use cases. That’s better protection of
existing investments than sending them of to TXAuth.

> Kind regards,
Torsten.

>
>                                                        -- Mike
>
>
>
> *From:* OAuth <[email-masked]> *On Behalf Of * Daniel Fett
> *Sent:* Thursday, May 7, 2020 11:50 PM
> *To:* [email-masked]
> *Subject:* Re: [OAUTH-WG] OAuth 2.1 - require PKCE?
>
>
>
> We need to address this in the security BCP and this will be a normative
> change that affects OpenID Connect Core (just as our current recommendation
> on the usage of nonce).
>
>
>
> We would then have:
>
>
>
> - use PKCE, except if you use OIDC with a nonce, then you don't need PKCE,
> except if you are a public client, then you still need PKCE.
>
> First and foremost, not many people will understand why there are cases
> when the BCP/OAuth 2.1 mandate PKCE and some where they don't. However,
> understanding *why* you have to do something is key to compliance. The
> short version "PKCE protects the code; there is a specific case where it is
> not needed, but its better to use it all the time" is easy to understand.
> We will not see many implementations following the long version above
> correctly.
>
>
>
> Second, we dramatically reduce technical complexity by reducing cases that
> need to be handled. We reduce correctness and compliance testing complexity
> in the same way. We reduce the cost of security analysis, which scales
> really badly to more cases.
>
>
>
> And finally, using nonce to protect against code injection is less robust
> than PKCE. AS have a better track record than clients when it comes to
> correctly implementing security mechanisms.
>
>
>
> Yes, this will make a number of implementations non-spec-compliant, but I
> do not think that this is a huge problem. Software needs to adapt all the
> time and a software that has not been changed in a while is probably not
> one you would want to use anyway. We are setting a new goal for
> implementations to meet and eventually, maintained implementations will get
> there.
>
>
>
> -Daniel
>
>
>
>
>
> 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]> 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.
>
>
>
> - 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
>
>
>
> ᐧ
>
>
>
> [email-masked]
> [email-masked]

---

From: Mike Jones <[email-masked]>
Date: Sun, 10 May 2020 19:01:32 +0000

I agree with actively maintaining and improving the OAuth 2.0 specs by adding enhancements that are voluntary to use.  I’ve worked on many such improvements, including Dynamic Client Registration, Authorization Metadata, the Device Flow, Token Exchange, DPoP, and support PAR and RAR, etc.  The issue that’s the subject is the current discussion is whether to make use of another enhancement, PKCE, mandatory in cases where it’s actually not needed, rather than making its use voluntary like the other enhancements, which I certainly support.

                                                       -- Mike

From: Torsten Lodderstedt <torsten=[email-masked]>
Sent: Sunday, May 10, 2020 3:15 AM
To: Mike Jones <[email-masked]>
Cc: Daniel Fett <[email-masked]>; [email-masked]
Subject: [EXTERNAL] Re: [OAUTH-WG] OAuth 2.1 - require PKCE?

Hi Mike,

Mike Jones <Michael.Jones=[email-masked]<mailto:[email-masked]>> schrieb am Fr. 8. Mai 2020 um 18:55:
OAuth 2.1 was supposed to not introduce breaking changes.
I cannot remember the WG met that decision. Can you please refer to the respective thread?

Requiring exact redirect URI matching is already a breaking change. Do you oppose against this as well?

Interesting statement. Does it mean you want to conserve OAuth 2.0 and force any enhancements/improvements to go into TXAuth? This would cause huge migration efforts for existing deployments wanting to benefit from those enhancements.

I think existing deployments are better served by actively maintaining and evolving the 2.x line. For example, PAR and RAR are attempts to improve OAuth 2.x and make it usable for new use cases. That’s better protection of existing investments than sending them of to TXAuth.
Kind regards,
Torsten.

                                                       -- Mike

From: OAuth <[email-masked]<mailto:[email-masked]>> On Behalf Of Daniel Fett
Sent: Thursday, May 7, 2020 11:50 PM
To: [email-masked]<mailto:[email-masked]>
Subject: Re: [OAUTH-WG] OAuth 2.1 - require PKCE?

We would then have:

- use PKCE

-Daniel

Aaron

Dick, Aaron, and Torsten

ᐧ

OAuth mailing list

---

From: Dick Hardt <[email-masked]>
Date: Sun, 10 May 2020 12:38:15 -0700

Hi Mike, I would consider upgrading to OAuth 2.1 to be voluntary, just as
the other extensions. Similarly, OAuth 1.0 deployments upgrading to OAuth
2.0 was voluntary.

Would you clarify why you think upgrading to OAuth 2.1 would be mandatory?

On Sun, May 10, 2020 at 12:02 PM Mike Jones <Michael.Jones=
[email-masked]> wrote:

> I agree with actively maintaining and improving the OAuth 2.0 specs by
> adding enhancements that are voluntary to use.  I’ve worked on many such
> improvements, including Dynamic Client Registration, Authorization
> Metadata, the Device Flow, Token Exchange, DPoP, and support PAR and RAR,
> etc.  The issue that’s the subject is the current discussion is whether to
> make use of another enhancement, PKCE, mandatory in cases where it’s
> actually not needed, rather than making its use voluntary like the other
> enhancements, which I certainly support.
>
>
>
>                                                        -- Mike
>
>
>
> *From:* Torsten Lodderstedt <torsten=[email-masked]>
> *Sent:* Sunday, May 10, 2020 3:15 AM
> *To:* Mike Jones <[email-masked]>
> *Cc:* Daniel Fett <[email-masked]>; [email-masked]
> *Subject:* [EXTERNAL] Re: [OAUTH-WG] OAuth 2.1 - require PKCE?
>
>
>
> Hi Mike,
>
>
>
> Mike Jones <Michael.Jones=[email-masked]> schrieb am Fr.
> 8. Mai 2020 um 18:55:
>
> *From:* OAuth <[email-masked]> *On Behalf Of *Daniel Fett
ᐧ

---

From: Neil Madden <[email-masked]>
Date: Sun, 10 May 2020 21:05:39 +0100

But if an AS upgrades to OAuth 2.1 then it MUST reject authorization requests that don’t include a code_challenge (section 4.1.2.1), so this will only be possible when all clients support PKCE.

This makes it impossible for a 2.1-compliant AS to also support non-PKCE 2.0 clients (i.e., the vast majority of them).

I think we can have a 2.1 spec that says clients and servers MUST support PKCE without this hard-fail clause. Otherwise I can’t see how we’d ever ship with 2.1-compliance enabled out-of-the-box.

— Neil

> On 10 May 2020, at 20:38, Dick Hardt <[email-masked]> wrote:
> 
> Hi Mike, I would consider upgrading to OAuth 2.1 to be voluntary, just as the other extensions. Similarly, OAuth 1.0 deployments upgrading to OAuth 2.0 was voluntary. 
> 
> On Sun, May 10, 2020 at 12:02 PM Mike Jones <Michael.Jones=[email-masked] <mailto:[email-masked]>> wrote:
> From: Torsten Lodderstedt <torsten=[email-masked] <mailto:[email-masked]>> 
> To: Mike Jones <[email-masked] <mailto:[email-masked]>>
> Cc: Daniel Fett <[email-masked] <mailto:[email-masked]>>; [email-masked] <mailto:[email-masked]>
> Mike Jones <Michael.Jones=[email-masked] <mailto:[email-masked]>> schrieb am Fr. 8. Mai 2020 um 18:55:
> 
> From: OAuth <[email-masked] <mailto:[email-masked]>> On Behalf Of Daniel Fett
> To: [email-masked] <mailto:[email-masked]>
> On Wed, May 6, 2020 at 10:48 AM Dick Hardt <[email-masked] <mailto:[email-masked]>> wrote:
> 
> Hello!
> 
>  
> 
> [email-masked] <mailto:[email-masked]>
> https://www.ietf.org/mailman/listinfo/oauth <https://www.ietf.org/mailman/listinfo/oauth>
>  
> 
> [email-masked] <mailto:[email-masked]>
> https://www.ietf.org/mailman/listinfo/oauth <https://www.ietf.org/mailman/listinfo/oauth>_______________________________________________
> OAuth mailing list
> [email-masked] <mailto:[email-masked]>
> https://www.ietf.org/mailman/listinfo/oauth <https://www.ietf.org/mailman/listinfo/oauth>
> ᐧ

---

From: Dick Hardt <[email-masked]>
Date: Sun, 10 May 2020 13:19:29 -0700

Is there a reason why a server can not support both OAuth 2.0 and OAuth
2.1? The version supported could be dependent on the client id, ie older
clients could still be OAuth 2.0, and newer clients would be OAuth 2.1, and
PKCE would be enforced.
ᐧ

On Sun, May 10, 2020 at 1:05 PM Neil Madden <[email-masked]>
wrote:

> But if an AS upgrades to OAuth 2.1 then it MUST reject authorization
> requests that don’t include a code_challenge (section 4.1.2.1), so this
> will only be possible when all clients support PKCE.
>
> This makes it impossible for a 2.1-compliant AS to also support non-PKCE
> 2.0 clients (i.e., the vast majority of them).
>
> I think we can have a 2.1 spec that says clients and servers MUST support
> PKCE without this hard-fail clause. Otherwise I can’t see how we’d ever
> ship with 2.1-compliance enabled out-of-the-box.
>
> — Neil
>
>> I think existing deployments are better served by actively maintaining
>> and evolving the 2.x line. For example, PAR and RAR are attempts to improve
>> - use PKCE, except if you use OIDC with a nonce, then you don't need
>> PKCE, except if you are a public client, then you still need PKCE.
>>
>> Second, we dramatically reduce technical complexity by reducing cases
>> that need to be handled. We reduce correctness and compliance testing
>> complexity in the same way. We reduce the cost of security analysis, which
>> scales really badly to more cases.
>>
>>
>>
>> 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.
>>
>>
>>
>> - reduced attack surface when using  S256 as a fingerprint of the
>> verifier is sent through the browser instead of the clear text value
>>
>>
>>

---

From: Neil Madden <[email-masked]>
Date: Sun, 10 May 2020 21:28:51 +0100

This is the same as having 2.1 compliance turned off by default. We already have a per-client setting to make PKCE mandatory.

If you can turn it off, what’s the point of making it a MUST in the spec? What does an optional MUST even mean for an AS to claim 2.1 compliance?

> On 10 May 2020, at 21:19, Dick Hardt <[email-masked]> wrote:
> 
> Is there a reason why a server can not support both OAuth 2.0 and OAuth 2.1? The version supported could be dependent on the client id, ie older clients could still be OAuth 2.0, and newer clients would be OAuth 2.1, and PKCE would be enforced.
> ᐧ
> 
> On Sun, May 10, 2020 at 1:05 PM Neil Madden <[email-masked] <mailto:[email-masked]>> wrote:
>> On 10 May 2020, at 20:38, Dick Hardt <[email-masked] <mailto:[email-masked]>> wrote:
>>

---

From: Dick Hardt <[email-masked]>
Date: Sun, 10 May 2020 13:35:36 -0700

Sounds like your clients that have set PKCE to be mandatory will then be
OAuth 2.1 compliant with no extra work.

A deployment can decide when they want to be compliant. That is not the
specifications decision. I'm unclear on what point you are wanting to make
below.

On Sun, May 10, 2020 at 1:28 PM Neil Madden <[email-masked]>
wrote:

> This is the same as having 2.1 compliance turned off by default. We
> already have a per-client setting to make PKCE mandatory.
>
> If you can turn it off, what’s the point of making it a MUST in the spec?
> What does an optional MUST even mean for an AS to claim 2.1 compliance?
>
>>> Mike Jones <Michael.Jones=[email-masked]> schrieb am
>>> Fr. 8. Mai 2020 um 18:55:
>>>
>>> And finally, using nonce to protect against code injection is less
>>> robust than PKCE. AS have a better track record than clients when it comes
>>> to correctly implementing security mechanisms.
>>>
>>>
>>>
>>> Yes, this will make a number of implementations non-spec-compliant, but
>>> I do not think that this is a huge problem. Software needs to adapt all the

---

From: Neil Madden <[email-masked]>
Date: Sun, 10 May 2020 21:46:26 +0100

Let’s go back to basics. Why is this clause a MUST in the 2.1 spec? What does that accomplish?

It doesn’t provide any security benefit - an attacker can just as easily send a code_challenge as a legitimate client, there’s no secret involved. So enforcing PKCE in this way doesn’t prevent any direct attacks. Presumably then making it a hard fail is designed to drive adoption of PKCE - turning the thumbscrews on clients that otherwise wouldn’t bother?

But if we are saying that an AS can happily support legacy 2.0 clients without PKCE then the pressure of the MUST clause evaporates and they are free to ignore it again. What’s the incentive for an AS deployment to ever enforce 2.1 compliance if all it adds is a potential incompatibility with no security gain? (Given that servers and clients can already support PKCE if they wish).

All I can see this doing is delaying adoption of 2.1 by ASes.

— Neil

> On 10 May 2020, at 21:35, Dick Hardt <[email-masked]> wrote:
> 
> Sounds like your clients that have set PKCE to be mandatory will then be OAuth 2.1 compliant with no extra work. 
> 
> A deployment can decide when they want to be compliant. That is not the specifications decision. I'm unclear on what point you are wanting to make below. 
> 
> 
> On Sun, May 10, 2020 at 1:28 PM Neil Madden <[email-masked] <mailto:[email-masked]>> wrote:
>> On 10 May 2020, at 21:19, Dick Hardt <[email-masked] <mailto:[email-masked]>> wrote:
>>

---

From: Dick Hardt <[email-masked]>
Date: Sun, 10 May 2020 17:34:36 -0700

It is a MUST to enforce consistency across all clients, and therefore to
improve security for all clients.

An AS can decide to be OAuth 2.1 for all new clients, and encourage
existing clients to migrate to OAuth 2.1 (add support for PKCE).

If the client wants OAuth 2.1, the AS will enforce it.

I don't follow your logic below wrt. what an attacker will do.

On Sun, May 10, 2020 at 1:46 PM Neil Madden <[email-masked]>
wrote:

> It doesn’t provide any security benefit - an attacker can just as easily
> send a code_challenge as a legitimate client, there’s no secret involved.
> So enforcing PKCE in this way doesn’t prevent any direct attacks.
> Presumably then making it a hard fail is designed to drive adoption of PKCE
> - turning the thumbscrews on clients that otherwise wouldn’t bother?
>
> But if we are saying that an AS can happily support legacy 2.0 clients
> without PKCE then the pressure of the MUST clause evaporates and they are
> free to ignore it again. What’s the incentive for an AS deployment to ever
> enforce 2.1 compliance if all it adds is a potential incompatibility with
> no security gain? (Given that servers and clients can already support PKCE
> if they wish).
>
>>> I think we can have a 2.1 spec that says clients and servers MUST
>>> support PKCE without this hard-fail clause. Otherwise I can’t see how we’d
>>> ever ship with 2.1-compliance enabled out-of-the-box.
>>>
>>> — Neil
>>>
>>> Hi Mike, I would consider upgrading to OAuth 2.1 to be voluntary, just
>>> as the other extensions. Similarly, OAuth 1.0 deployments upgrading to
>>> OAuth 2.0 was voluntary.
>>>
>>>> We need to address this in the security BCP and this will be a
>>>> normative change that affects OpenID Connect Core (just as our current
>>>> recommendation on the usage of nonce).
>>>>
>>>>
>>>>
>>>> We would then have:
>>>>
>>>>
>>>>
>>>> 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 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.
>>>>
>>>>
>>>>
>>>> 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
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>

---

From: Neil Madden <[email-masked]>
Date: Mon, 11 May 2020 06:38:27 +0100

There is no attack that this prevents so your claim of improving security is unsubstantiated. I can’t see how we can ship a 2.1-compliant-by-default AS while this requirement remains so I don’t support it. 

Neil

> On 11 May 2020, at 01:35, Dick Hardt <[email-masked]> wrote:
> 
> 
> It is a MUST to enforce consistency across all clients, and therefore to improve security for all clients. 
> 
> An AS can decide to be OAuth 2.1 for all new clients, and encourage existing clients to migrate to OAuth 2.1 (add support for PKCE).
> 
>> On Sun, May 10, 2020 at 1:46 PM Neil Madden <[email-masked]> wrote:
>>>> On Sun, May 10, 2020 at 1:28 PM Neil Madden <[email-masked]> wrote:
>>>>>> On Sun, May 10, 2020 at 1:05 PM Neil Madden <[email-masked]> wrote:
>>>>>>>> On Sun, May 10, 2020 at 12:02 PM Mike Jones <Michael.Jones=[email-masked]> wrote:
>>>>>>>> Mike Jones <Michael.Jones=[email-masked]> schrieb am Fr. 8. Mai 2020 um 18:55:
>>>>>>>>

---

From: Torsten Lodderstedt <[email-masked]>
Date: Mon, 11 May 2020 08:41:01 +0200

> On 11. May 2020, at 07:38, Neil Madden <[email-masked]> wrote:
> 

Are you saying PKCE does not prevent any attack?

>>>> I think we can have a 2.1 spec that says clients and servers MUST support PKCE without this hard-fail clause.. Otherwise I can’t see how we’d ever ship with 2.1-compliance enabled out-of-the-box.
>>>> 
>>>> — Neil
>>>>

---

From: Neil Madden <[email-masked]>
Date: Mon, 11 May 2020 07:47:54 +0100

> On 11 May 2020, at 07:41, Torsten Lodderstedt <[email-masked]> wrote:
> 

No, but servers and clients are already free to support PKCE. I’m saying that rejecting requests from non-PKCE clients doesn’t prevent any attack. It just denies service to legitimate clients. 

— Neil

---

From: Torsten Lodderstedt <[email-masked]>
Date: Mon, 11 May 2020 09:05:03 +0200

> On 11. May 2020, at 08:47, Neil Madden <[email-masked]> wrote:
> 
> 
> 

There are two aspects to this topic:

1) Do all ASs support PKCE? Requiring PKCE support fosters interoperability and security. Security since the client can be sure the AS supports PKCE. Today, if the AS does not support PKCE, the client will never learn since a compliant AS will just ignore additional request parameters.

2) Do ASs enforce PKCE? This fosters security since it forces clients to implement a means against code replay and CSRF.

---

From: Neil Madden <[email-masked]>
Date: Mon, 11 May 2020 08:34:04 +0100

> On 11 May 2020, at 08:05, Torsten Lodderstedt <[email-masked]> wrote:
> 
> 
> 

But just saying that a 2.1 AS MUST support PKCE is enough for this. Rejecting requests just to support feature discovery is a sledgehammer to crack a nut. 

> 2) Do ASs enforce PKCE? This fosters security since it forces clients to implement a means against code replay and CSRF.

Again, just saying that 2.1 clients MUST support PKCE achieves this aim. Rejecting non-PKCE requests doesn’t add anything to security. 

And as has been pointed out elsewhere in this thread there are clients that don’t benefit from PKCE such as confidential OIDC clients. Indeed for most confidential clients the gains of PKCE are relatively minor - code injection attacks are already pretty hard to pull off in practice against such clients. 

Neil

---

From: Torsten Lodderstedt <[email-masked]>
Date: Mon, 11 May 2020 09:53:53 +0200

> On 11. May 2020, at 09:34, Neil Madden <[email-masked]> wrote:
> 
> 
> 

I agree, but I wouldn’t say they don’t benefit at all. 

1) The nonce check happens after the OP had issued the ID Token. This means even if the transaction is being evaluated to be fraudulent afterwards, the OP releases PII to the RP. Depending on the way the OP obtained this data, this might have already caused unneglectable cost (e.g. for an external commercial claims provider).

That’s not the case with PKCE.

2) The whole check relies on the client. I would rather rely on the OP/AS to enforce this security check since clients have a less promising track record of implementing security checks. 

3) In mixed OAuth/OIDC scenarios, switching back and force between nonce and PKCE does not make developers live simpler.

---

From: Neil Madden <[email-masked]>
Date: Mon, 11 May 2020 09:59:40 +0100

> On 11 May 2020, at 08:53, Torsten Lodderstedt <[email-masked]> wrote:
> 
> 
> 

We’re talking about confidential clients. If the ID Token is not meant for this client then client authentication will fail, or else the auth code was meant for this client (but not this session) in which case the user already consented to release of PII to that RP.

If you are talking about a hybrid flow then PKCE doesn’t protect that either. I’d like to see encrypted ID tokens become mandatory in hybrid flows, but that’s not for this WG.

> 3) In mixed OAuth/OIDC scenarios, switching back and force between nonce and PKCE does not make developers live simpler. 

Maybe, but I don’t think either of these rise to the level of mandating that ASes reject non-PKCE requests.

In the interests of building consensus, maybe something along the lines of: “An AS MUST reject requests without a code_challenge from public clients, and SHOULD reject such requests from other clients unless there is reasonable assurance that the client mitigates these threats in other ways”?

— Neil

---

From: Torsten Lodderstedt <[email-masked]>
Date: Mon, 11 May 2020 11:24:24 +0200

> On 11. May 2020, at 10:59, Neil Madden <[email-masked]> wrote:
> 
> 
> 
> If you are talking about a hybrid flow then PKCE doesn’t protect that either.

Sure. The OP won’t issue an ID Token if the PKCE check fails.

> I’d like to see encrypted ID tokens become mandatory in hybrid flows, but that’s not for this WG.
> 
>> 

Sounds reasonable.