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

Philippe De Ryck <philippe@pragmaticwebsecurity.com> Fri, 08 May 2020 05:36 UTC

Return-Path: <philippe@pragmaticwebsecurity.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 3405B3A053F for <oauth@ietfa.amsl.com>; Thu, 7 May 2020 22:36:24 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.098
X-Spam-Level:
X-Spam-Status: No, score=-2.098 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_FONT_LOW_CONTRAST=0.001, HTML_MESSAGE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=pragmaticwebsecurity.com header.b=HGFPVSji; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=CeGq1uts
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 yvWviF7B7uHm for <oauth@ietfa.amsl.com>; Thu, 7 May 2020 22:36:20 -0700 (PDT)
Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 688D83A0544 for <oauth@ietf.org>; Thu, 7 May 2020 22:36:20 -0700 (PDT)
Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 2789B1BD; Fri, 8 May 2020 01:36:19 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 08 May 2020 01:36:19 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= pragmaticwebsecurity.com; h=from:message-id:content-type :mime-version:subject:date:in-reply-to:cc:to:references; s=fm3; bh=yqCrMUsCxUVd+fdtbSIhqn8nRhRO6xuTAz/rjI1Y19E=; b=HGFPVSjiSw/o KJeTExZXdgCCbiYvzoGCrxx7EUFdXjlGUM4mITjsmpZ0rRvI/sQKtmtfl/ddR5bT I/JHqJFMOnqR3udceZZGBQxTHOT8IbPNb1/tAUIeuZZHf+zokapmLy5mE8UFCU5Q OdtUHYLcHM9HPaY5GGug/ykFbvMJM5r8GWiQI7N+kdEscXfJwVq//6HSEboFyKPJ 7Eg4jDVf/eSgr8YykEKWNgk0XYrBjKvGChVJ0ovtdyC2OnzzPe9SzFQ/acaz3hgB t4AwSwFjJWl0gMPUXOGFMbDgdrJ2aGfZklWLBqyK7uh+p8LWge9i5FD9j94+ehPS EbbTBj4e3w==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=yqCrMU sCxUVd+fdtbSIhqn8nRhRO6xuTAz/rjI1Y19E=; b=CeGq1utsgHFE+4rBmWSjjM HgJzY5dwy54QdM6ypA4U22SIe2qRJlwmqdGhphLYUYixgTQCGs714NlClgbllyuj Uj+ffbshoHjsYBEwx7AqsIENsYvDWxHdCdXDE/sOgnpgqZfT3bl1IqoEaZxhfGBQ udgq3J/YS5X1IppXuHRL/lBd23IqNJ+JpbaP2xhkgeKIuXDhI1Lm+gCR8AcY32M1 bYadYLrlIg5nybLx/bFtzOZ0GawW0ojCi1bkItSR2UIfv7uB9Q/3s5fPOG08bh1d Jl31hDSaX6q2zvQw2/4h6JUYBJNPL/gIbDeY6VBjhlFYUZRsSHE6RXSgQs4E/Wiw ==
X-ME-Sender: <xms:0u-0Xiws0ZQ_ZVpsf7tEwA9flRWwQtghh9UsYpLpCuBUwS1-mx33Yg>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrkedugdelgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhkfgtggfuffgjvfhfofesrgdtmherhhdtjeenucfhrhhomheprfhhihhlihhp phgvucffvgcutfihtghkuceophhhihhlihhpphgvsehprhgrghhmrghtihgtfigvsghsvg gtuhhrihhthidrtghomheqnecuggftrfgrthhtvghrnhepkefggeduudfhleffffeflefh ffdugfevjedtgeejhfeileduvdeileekkedvtdetnecuffhomhgrihhnpehivghtfhdroh hrghenucfkphepkedurdduieegrdduvdelrdelheenucevlhhushhtvghrufhiiigvpedt necurfgrrhgrmhepmhgrihhlfhhrohhmpehphhhilhhiphhpvgesphhrrghgmhgrthhitg ifvggsshgvtghurhhithihrdgtohhm
X-ME-Proxy: <xmx:0u-0XpN1f7rY0LkS21LWaOglqBmqWbr_HTiAGscFBUNXwrHJwnCNRA> <xmx:0u-0XjWYc9cI0ZtJKeh0ZmtkAJxnHpQSGJug6hD8sAuHW1nodMWJUA> <xmx:0u-0Xt1wodzlE9Atvv2GHVX-I4BFtBAmWZvdej0tpyoVqpT7WVY7Lw> <xmx:0u-0XlGDLcfqUY32Bhuz4qhxveO0iDGjTy-tm6iY10PGe_q8VO7QDg>
Received: from philippes-imac.localdomain (d51a4815f.access.telenet.be [81.164.129.95]) by mail.messagingengine.com (Postfix) with ESMTPA id 9145030661E6; Fri, 8 May 2020 01:36:17 -0400 (EDT)
From: Philippe De Ryck <philippe@pragmaticwebsecurity.com>
Message-Id: <A16DE3EC-26C8-4D0A-8592-5703159367E0@pragmaticwebsecurity.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_3757594F-D6B8-44DC-A04C-8EC2CCD86BA6"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\))
Date: Fri, 08 May 2020 07:36:15 +0200
In-Reply-To: <BY5PR00MB06766F71775C01E586CD1C12F5A20@BY5PR00MB0676.namprd00.prod.outlook.com>
Cc: Aaron Parecki <aaron@parecki.com>, Dick Hardt <dick.hardt@gmail.com>, OAuth WG <oauth@ietf.org>
To: Mike Jones <Michael.Jones=40microsoft.com@dmarc.ietf.org>
References: <BY5PR00MB06766F71775C01E586CD1C12F5A20@BY5PR00MB0676.namprd00.prod.outlook.com>
X-Mailer: Apple Mail (2.3608.80.23.2.2)
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/xY-3EjYFpnNVlSDv7dGfB6aBM-A>
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 05:36:24 -0000

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 <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
>  
> ᐧ
> _______________________________________________
> OAuth mailing list
> OAuth@ietf.org <mailto:OAuth@ietf.org>
> https://www.ietf.org/mailman/listinfo/oauth <https://www.ietf.org/mailman/listinfo/oauth>