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

Phillip Hunt <phil.hunt@independentid.com> Fri, 08 May 2020 16:16 UTC

Return-Path: <phil.hunt@independentid.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 985813A0C4A for <oauth@ietfa.amsl.com>; Fri, 8 May 2020 09:16:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.894
X-Spam-Level:
X-Spam-Status: No, score=-1.894 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, MIME_QP_LONG_LINE=0.001, SPF_HELO_NONE=0.001, SPF_NONE=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=independentid-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 sYKFqkWegXFP for <oauth@ietfa.amsl.com>; Fri, 8 May 2020 09:16:47 -0700 (PDT)
Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) (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 6DF073A0CCB for <OAuth@ietf.org>; Fri, 8 May 2020 09:16:47 -0700 (PDT)
Received: by mail-pl1-x62d.google.com with SMTP id u22so945074plq.12 for <OAuth@ietf.org>; Fri, 08 May 2020 09:16:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=independentid-com.20150623.gappssmtp.com; s=20150623; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=5zrBIK/gFfewezzZ3PvhwwDpyRZiuEn4G+KMkz8dMOM=; b=Ap2Jyqu6u5L8lFf1eIToT9a9U3zQw+hHs4kFahfmqLdKC6xedL6m2wL1OlYxymf6L/ KeU9c8bjvMembiFbZIN8Ol7S7ofBbH64Eh7gkt74gHHBxSk/reJgvKfV7F/wCT3UKrXY 5pnuiji1D/RPk1n+Giat2YcGuc2dYUvM45+4cZlug80B49VFs7FI0uz5n4yIzDP684Hw e8j5Vp2JgDWOh8NU+lQrUYnsTwR2cVjeVI9kd93xK20a+fGogRj0UID0JgTUrp49JR/Y Dz1Hz+N8yjCyP+iLEe7QjYylE9mVRk0JlUEOJ65Ll5VLwj9+76IB3FLhKSe6ycNKuWjd AwzQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=5zrBIK/gFfewezzZ3PvhwwDpyRZiuEn4G+KMkz8dMOM=; b=f8zYeCm1G+zb9pGJrJkngl5m9nWGEUULGLZHsmlWkuRsT9kYSP49Yxk4XgPrwHoaIb Z/k7s7O9kdU3XP4A96yVDoeF4ULjMo/LuBJbFv5Enz2uJNcMN52pEnrohbnlDsp7HRJZ Yp7v0NUDAkAqOn4UxR19Oul+SKU+NHgSNDCv4cMxMRByIq4mZ+DS5KDaxrK2IscQSzOK qdfkSNLZ9oQ1BWi5Bdvidxj3YMRdtYYR6v4w+PB+9OCUQjsD4Us2j0sASPzau8JMX7ZU +N5bsnmSS9+7dWTAzjLJ5/Xz5WtV43w99c0f7A1JKXZYmFUVaOJWyniXfGLR63OmubKv RfGg==
X-Gm-Message-State: AGi0PuYK1Yr+g4tPcwJxtB+ug5H3erzLEZ17RO3nhnRs8WDaWL1qid5z 9K+g4FGY5AxKVTZ1PqWzD3IsPLCJLC8UvQ==
X-Google-Smtp-Source: APiQypKM2Edt73qqEyOKreBpecy64R9Zs0QwlMq5981bpv9ylJ8D3Ssb26bqgaNRP2z44zRxYAmY1Q==
X-Received: by 2002:a17:902:ac87:: with SMTP id h7mr3001306plr.119.1588954606283; Fri, 08 May 2020 09:16:46 -0700 (PDT)
Received: from ?IPv6:2001:569:7a71:1d00:a011:8e51:236f:4b0e? (node-1w7jr9qrfoxx9yipdlocpzaxa.ipv6.telus.net. [2001:569:7a71:1d00:a011:8e51:236f:4b0e]) by smtp.gmail.com with ESMTPSA id m12sm1669274pgj.46.2020.05.08.09.16.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 May 2020 09:16:45 -0700 (PDT)
Content-Type: multipart/alternative; boundary=Apple-Mail-1F637A3D-CF46-4035-945F-602C9386A6E2
Content-Transfer-Encoding: 7bit
From: Phillip Hunt <phil.hunt@independentid.com>
Mime-Version: 1.0 (1.0)
Date: Fri, 8 May 2020 09:16:44 -0700
Message-Id: <C659C09A-4E37-4AD4-9D06-A0AD6D9CA0E4@independentid.com>
References: <3b016c63-facd-a1cf-cb58-6ad5d8633055@danielfett.de>
Cc: OAuth@ietf.org
In-Reply-To: <3b016c63-facd-a1cf-cb58-6ad5d8633055@danielfett.de>
To: Daniel Fett <fett@danielfett.de>
X-Mailer: iPhone Mail (17E262)
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/BMe9aNrz4z8n-pSuInnaZWnTrq0>
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 16:16:53 -0000

+1 

Phil

> On May 7, 2020, at 11:50 PM, Daniel Fett <fett@danielfett.de> wrote:
> 
> 
> +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 <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
> 
> _______________________________________________
> OAuth mailing list
> OAuth@ietf.org
> https://www.ietf.org/mailman/listinfo/oauth