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

Mike Jones <Michael.Jones@microsoft.com> Sun, 10 May 2020 19:02 UTC

Return-Path: <Michael.Jones@microsoft.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 39AB23A0B26 for <oauth@ietfa.amsl.com>; Sun, 10 May 2020 12:02:32 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.099
X-Spam-Level:
X-Spam-Status: No, score=-2.099 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=microsoft.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 yqspc1C5unMv for <oauth@ietfa.amsl.com>; Sun, 10 May 2020 12:02:29 -0700 (PDT)
Received: from NAM06-BL2-obe.outbound.protection.outlook.com (mail-eopbgr650090.outbound.protection.outlook.com [40.107.65.90]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 660E83A0B52 for <oauth@ietf.org>; Sun, 10 May 2020 12:02:28 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dao2HWcNurosAFhGbmxoG4GYN5fkGT+8cebsdqQrw6Zd0TWmdt6SwCUNJRZivueyoMnjj5SQoHnK8gbBzx7N8e56XtqSfcB24Wq/3XAO5JBvrNGd2IDykS8nhkWeEERKiwHnUKmTHIrdGlMlW5/0WAK83GP3qqkxAev4DcI1k8U4DhFPjFQscdfgptOUGLywrM21lIQ0DGH1s6DOFs3dSs0LH3JyQhiBw4Mzvezb8vN/GeabkRCM56RCvurbdDjYjZx1DsEsZvW2+3kKclhDWlrGNtVrYP/Qk4TKWZQYKwR23sJvv340+9Y4TD5rSpVQheuLH4AOVibgtSOMMtyyJg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7y7MTPRJ6fD+19peGpc/qBkqFdSwMpXMsMATrLaAQeU=; b=S1uciaSTjvKMDGd/79Z48J7JDvLD6Xn1Dz43lpaK8LL+H3t7NkzB2xmkejR/BK2RIF/5a+hSGcvLzFoZ4xvCrH4K5SyHRZxOPYPmUSeGtfRK49Bu3vu26uL0qSAjL1/WZQojvlRmIouBBCYe2oGDVlnG78L0cxU9UR2VQFPNFfrMIcnoyTvOS+mpB+CSVKPf00uUJuTr6apXPLLqioChY4HIqXmQgSrk/gT2/nB0M4WTCOHTruT8e6RRU7ypDDQZthAFdsI5Wh1OxukkticNU3+XGJaptnqKRR2CL3e5w5bHOa6a9eBojb+cbcV3cqDis0YKQuzieW9JKuOaO6A/+w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7y7MTPRJ6fD+19peGpc/qBkqFdSwMpXMsMATrLaAQeU=; b=Ki7SGAeeJXGkwzfq6ViSjDLzg+mNguoXfvkT1FDbJqJWAsiPWwM+1/4641SX+111ZX1u4+9bokOPfNRfx37afnDqQ4rwfOXMdgQaNEjBOyqjUxV3VXzKzfXR+YveFg87DMg7ty6tvwgZzvWddhPkd116JJ/hr8IzzmILOtlo7DA=
Received: from MN2PR00MB0688.namprd00.prod.outlook.com (2603:10b6:208:199::23) by BL0PR00MB0387.namprd00.prod.outlook.com (2603:10b6:207:1f::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3028.0; Sun, 10 May 2020 19:02:26 +0000
Received: from MN2PR00MB0688.namprd00.prod.outlook.com ([fe80::d8ef:3352:9393:c073]) by MN2PR00MB0688.namprd00.prod.outlook.com ([fe80::d8ef:3352:9393:c073%7]) with mapi id 15.20.3031.000; Sun, 10 May 2020 19:02:26 +0000
From: Mike Jones <Michael.Jones@microsoft.com>
To: Torsten Lodderstedt <torsten@lodderstedt.net>
CC: Aaron Parecki <aaron@parecki.com>, Dick Hardt <dick.hardt@gmail.com>, OAuth WG <oauth@ietf.org>
Thread-Topic: OAuth 2.1 - require PKCE?
Thread-Index: AdYm/YVC+Jlk78yPRaultu1s74SIrw==
Date: Sun, 10 May 2020 19:02:26 +0000
Message-ID: <MN2PR00MB0688E35CB78EA69D1A3F0A65F5A00@MN2PR00MB0688.namprd00.prod.outlook.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=867b6992-783e-4192-bb87-0000d2391bad; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2020-05-10T18:53:19Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47;
authentication-results: lodderstedt.net; dkim=none (message not signed) header.d=none;lodderstedt.net; dmarc=none action=none header.from=microsoft.com;
x-originating-ip: [50.47.87.252]
x-ms-publictraffictype: Email
x-ms-office365-filtering-ht: Tenant
x-ms-office365-filtering-correlation-id: 76d11500-3815-4adc-06b3-08d7f514ae10
x-ms-traffictypediagnostic: BL0PR00MB0387:
x-microsoft-antispam-prvs: <BL0PR00MB03871EE71B617614B50C9046F5A00@BL0PR00MB0387.namprd00.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:6430;
x-forefront-prvs: 039975700A
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: TISSo2op4ZV0GAg8Q3n+tmk+Zhr1GL68pH+A2bmHz3jHjIcTSfr8sh/RGq2r4zWXa7FdvPcbtJ91Y7QsF8gRp1GzBnapVGJr3MhSCFQMYBWTXXBQ91KfGUjVYXCNfwtW2RUOZM8wYJqIOYLSQVxXySmFv5H9V6mjMuXruUbHT6JGAMRaQomx+mS79K0OL1fuAwf/pmtRj6b/amTTYMa1QKSiZjnj83l42qPXm1Om+jL0sBK0jDEqK33K8Kb4ayZiTeC0Zx2bhtIHN0aDqRoQJoUBZozBUAO2irq9TEoJ7kQUlg0VZHbGkyChkrB5TIWmUL08Gf8AkJNr+zhvg7hUB9Rbr+gh0q5rS6ck5RrBd8DXyfQJO33SHgQx/eshHOpWiY4pLbZOAbeKsZOG2w98HlMauTyl+w3ju5HUIXIG+YOCbJDWql4ShhCzoNCUyzn8
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR00MB0688.namprd00.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(346002)(376002)(366004)(396003)(136003)(39860400002)(33430700001)(54906003)(66476007)(66556008)(64756008)(7696005)(82950400001)(82960400001)(316002)(76116006)(6916009)(86362001)(52536014)(478600001)(66574014)(33656002)(66946007)(33440700001)(66446008)(8936002)(26005)(186003)(5660300002)(53546011)(6506007)(10290500003)(76236002)(2906002)(4326008)(8990500004)(8676002)(9686003)(55016002)(71200400001)(99710200001); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata: rK/b4hN9O/15hlBs0oSWhL4pjdCOu/YkK2gkUtQ6OczLUbcfvvxZB3RyFDGHFrwTSlJ5tCw0pTzPLJ4tjGgY6LybnkKHDd3i4CLL1ZwFDSfbEePh9DgGOXZb5z/MlfoPy0Jqrh2tYR+9v8iHq9qZ+aQLbTmAi4I5SgIz2MFYbFRSomprrM0pozGMBKOwXL5xC84lCNWCLtHh/FCv89qj6G3xNK21qHtreaE6YHlRYsM0ZdoQwl2zAAEHn/I4GYfG77eA9RliyK/pCIL09NEFUYOkk5VEJ4NgvbGWiKnwfr3K/NLnDwcqhSOvtR40T5ruPqkh9qBqYzno7FXyKaAM4MFglp6MQJQRHm3JvZ47D6bSPdhTZ58szSDXXFJ05C61n26by29uDyMkHtj1rU3ODWhm/b6zKnGg6P34pNAQYPw4oErR+WZv7nHzJXrIR/C/22LDvzRrKyrXz0PfSoX6PE6bGtlY6YmDw0rp80SortI=
x-ms-exchange-transport-forked: True
Content-Type: multipart/alternative; boundary="_000_MN2PR00MB0688E35CB78EA69D1A3F0A65F5A00MN2PR00MB0688namp_"
MIME-Version: 1.0
X-OriginatorOrg: microsoft.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: MN2PR00MB0688.namprd00.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 76d11500-3815-4adc-06b3-08d7f514ae10
X-MS-Exchange-CrossTenant-originalarrivaltime: 10 May 2020 19:02:26.3844 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: /DLwW8JadwCkPAgAVrr6Dv/MssHgOBTuCr/1fHRGW9doFECLbGu2kt0fic96AdLK1/4Jj9Cgmu13abs6gTLJyg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR00MB0387
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/gqnj3i5C9vjCuo13mK-a3L2t5Nw>
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: Sun, 10 May 2020 19:02:38 -0000

> Did I got it right that nonce does not protect public clients from code theft/replay?

I believe that the OpenID Connect Code Hash (“c_hash”) claim protects against this.  I’d be interested in hearing John Bradley’s take on this.

                                                       -- Mike

From: Torsten Lodderstedt <torsten@lodderstedt.net>
Sent: Sunday, May 10, 2020 3:17 AM
To: Mike Jones <Michael.Jones@microsoft.com>
Cc: Aaron Parecki <aaron@parecki.com>; Dick Hardt <dick.hardt@gmail.com>; OAuth WG <oauth@ietf.org>
Subject: Re: OAuth 2.1 - require PKCE?

Mike Jones <Michael.Jones@microsoft.com<mailto:Michael.Jones@microsoft.com>> schrieb am Sa. 9. Mai 2020 um 20:46:
There’s a huge ecosystem of successful, secure OAuth 2.0 and OpenID Connect deployments that we have the responsibility to be stewards of.  This working group should be proud of what it’s accomplished.  Part of good stewardship is not unnecessarily bifurcating the ecosystem into non-interoperable segments.  OAuth 2.1 should facilitate the already secure OAuth 2.0 deployments remaining part of the interoperable OAuth 2.1 set of deployments – not intentionally doing the opposite.

If it ain’t broke, don’t fix it!
Did I got it right that nonce does not protect public clients from code theft/replay? I would consider this a security issue.

                                                       -- Mike

From: Aaron Parecki <aaron@parecki.com<mailto:aaron@parecki.com>>
Sent: Friday, May 8, 2020 8:34 PM
To: OAuth WG <oauth@ietf.org<mailto:oauth@ietf.org>>
Cc: Dick Hardt <dick.hardt@gmail.com<mailto:dick.hardt@gmail.com>>; Torsten Lodderstedt <torsten@lodderstedt.net<mailto:torsten@lodderstedt.net>>; Mike Jones <Michael.Jones@microsoft.com<mailto:Michael.Jones@microsoft.com>>
Subject: Re: OAuth 2.1 - require PKCE?

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.

I appreciate the concern about optimizing for spec simplicity. I also agree that spec simplicity should not necessarily be the driving goal.

However, what you've described is the opposite of interoperability and minimizing the burden on developers. Requiring PKCE in OAuth 2.1, without any exceptions, will optimize for interoperability between OAuth 2.1 clients and servers. Without the requirement of PKCE, there will always be the question of "but does this OAuth 2.1 client work with this OAuth 2.1 server or not?", which will only be able to be answered by investigating the docs to look for PKCE support, or by checking the AS metadata document if it publishes one (which it is not required to do).

Optimizing for interoperability and minimizing the burden on developers is absolutely a good goal, and requiring PKCE is a great way to accomplish that. OAuth 2.0 and OpenID Connect implementations that don't support PKCE will continue to work as they currently do, they just won't be able to call themselves OAuth 2.1 compliant, just as is the case as if they don't follow the other recommendations that are in OAuth 2.1 and the Security BCP.

Aaron


On Thu, May 7, 2020 at 6:42 PM Mike Jones <Michael.Jones@microsoft.com<mailto:Michael.Jones@microsoft.com>> 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<mailto:aaron@parecki.com>>
Sent: Thursday, May 7, 2020 4:39 PM
To: Dick Hardt <dick.hardt@gmail.com<mailto:dick.hardt@gmail.com>>
Cc: OAuth WG <oauth@ietf.org<mailto:oauth@ietf.org>>; Torsten Lodderstedt <torsten@lodderstedt.net<mailto:torsten@lodderstedt.net>>; Mike Jones <Michael.Jones@microsoft.com<mailto: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<mailto: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

ᐧ