Re: [OAUTH-WG] proposed resolution for PKCE in OAuth 2.1

Torsten Lodderstedt <> Thu, 14 May 2020 06:56 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 0CB2C3A0BE1 for <>; Wed, 13 May 2020 23:56:50 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.099
X-Spam-Status: No, score=-2.099 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=unavailable autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (2048-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id UN8Z4cb7m1pA for <>; Wed, 13 May 2020 23:56:48 -0700 (PDT)
Received: from ( [IPv6:2a00:1450:4864:20::336]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 374B53A0BE8 for <>; Wed, 13 May 2020 23:56:48 -0700 (PDT)
Received: by with SMTP id g12so31112583wmh.3 for <>; Wed, 13 May 2020 23:56:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=abgmHWOXYhGcAxlKfMhqGaZuwN13N1U0ALTyJvAcQWM=; b=0FDuTYwLYCJzA1avr0XMtHLj50SZcaBpuN0FrepCU7DzwyC40XhlhxfzFP8VSqckdv Kuwqmi/hwoxpptivrTmGPIDcTAcWmLNS1N05Ww4ln0ZrU/rWyndNNxERwxlat4B4r6MS a63r32POzvJkGOGaxmAyr9ZUoBUY37fw1NvycAbMsOUF26XQr5HOjGka3fl1o2I+olDd 05X9pTNowtGDyp2M45nPhL0hu/6W+INZoGnkyIHfVXEZgQCeW9yyO9/sH/Bt/XsAuEvX Bnpaw6Mx7y+xztfoJ38cI+LSgyWqo4khXrBrnvrshwpfB50SDKQgz8uoNtrwYzHUCqa8 rKJg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=abgmHWOXYhGcAxlKfMhqGaZuwN13N1U0ALTyJvAcQWM=; b=iND4x/yWO0hwSU9XtCsfKMOQazto7adKSDHNg1cr/FzkNAcOyoH9+PqxKLXj/9wuYx YfrPGmwlLDWZ8nKc9sVNJZLrRpRpWP99TyKtwD4oMBo1q2/lXa0/BQQ4zjBhDETSSDpf V1IbnsIW2t/k09KvhHWjPOFfr5dSO++RQYRH2CFFw6ehwjmZ7jkihTna8T5ngUfCsxo6 q2a8Gttzq5j9C6rLST6BTTVNddATsKUMy4lmFoEKFa4VtRgPQ7fx9b0K5qv/xKs98MRW 9EO15q5IwZ0LZ1+YKxKmv/6oXmCu0a+by5cV//NqAHB604DkoD5WLg6V0nzjN7IBhLTL rm9Q==
X-Gm-Message-State: AGi0PubKdwot3hoIAzsqV7/WA9HzyNmh2PaJyijKFHQlBvWzZ6sArMxO wT51csiNqLcjMe/a1IqipbAWavvenuk=
X-Google-Smtp-Source: APiQypIXmby0zMVzWPD31sDjvhb4iwUYZFs3kOEEj0UeJ+R3B6jzN8z7YdaWt6l6uQgrrW6h/AIi5A==
X-Received: by 2002:a1c:27c7:: with SMTP id n190mr24341389wmn.68.1589439406257; Wed, 13 May 2020 23:56:46 -0700 (PDT)
Received: from ( [2003:eb:8f30:1f8b:1d49:93d4:1b24:6345]) by with ESMTPSA id t71sm40852370wmt.31.2020. (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 May 2020 23:56:45 -0700 (PDT)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.\))
From: Torsten Lodderstedt <>
In-Reply-To: <>
Date: Thu, 14 May 2020 08:56:43 +0200
Cc: Aaron Parecki <>, Mike Jones <>
Content-Transfer-Encoding: quoted-printable
Message-Id: <>
References: <>
To: OAuth WG <>
X-Mailer: Apple Mail (2.3608.
Archived-At: <>
Subject: Re: [OAUTH-WG] proposed resolution for PKCE in OAuth 2.1
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: OAUTH WG <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Thu, 14 May 2020 06:56:50 -0000

Hi all,

I would also like to thank everybody for the substantial discussion.  

The proposed change for Section works for me (as already stated). I’m not fully comfortable with the proposed change for Section 9.7 for the following reasons:

- The text is weaker than Section since it RECOMMENDS use of PKCE instead of requiring it (with a well-defined exception).
- Given the latest findings re nonce I don’t feel comfortable with recommending any mechanism that this WG is not responsible for and thus did not conduct the security threat analysis for. I think the better way for us as WG is to define the extension point for other mechanisms. The OpenID Foundation (or any other body) can then fill in and issue a statement that nonce (or another suitable mechanism) fulfils the requirements of the extension point. 

Based on this considerations, I propose the following text for Section 9.7:

Clients MUST prevent injection (replay) of authorization codes into
the authorization response by attackers. Public clients MUST use the 
"code_challenge” with a transaction-specific value that is
securely bound to the client and the user agent in which the
transaction was started. Confidential clients MUST use 
the “code_challenge” in the same way or other suitable mechanisms to 
mitigate authorization code injection. 

This text follows the logic in Section and allows use of the nonce for confidential clients.

best regards,

> On 12. May 2020, at 02:21, Mike Jones <> wrote:
> That works for me.  Thanks all for the useful back-and-forth that got us to this point of clarity.  I suspect many of us learned things along the way; I know that I did!
>                                                        Cheers,
>                                                        -- Mike
> From: Aaron Parecki <> 
> Sent: Monday, May 11, 2020 4:55 PM
> To: OAuth WG <>
> Cc: Neil Madden <>; Mike Jones <>
> Subject: Re: [OAUTH-WG] proposed resolution for PKCE in OAuth 2.1
> Thank you Neil.
> To address Mike's concerns in the previous threads, I would like to also update section 9.7 with the following text:
> Clients MUST prevent injection (replay) of authorization codes into the 
> authorization response by attackers. The use of the `code_challenge`
> parameter is RECOMMENDED to this end. For confidential clients, the 
> OpenID Connect `nonce` parameter and ID Token Claim {{OpenID}} MAY be used 
> instead of or in addition to the `code_challenge` parameter for this 
> purpose. The `code_challenge` or OpenID Connect `nonce` value MUST be
> transaction-specific and securely bound to the client and the user agent 
> in which the transaction was started.
> This change better clarifies the specific circumstances under which the "nonce" parameter is sufficient to protect against authorization code injection.
> Aaron Parecki
> On Mon, May 11, 2020 at 11:55 AM Neil Madden <> wrote:
> I am happy with this proposed wording. Thanks for updating it.
> — Neil
> On 11 May 2020, at 19:52, Aaron Parecki <> wrote:
> Thanks for the lively discussion around PKCE in OAuth 2.1 everyone! 
> We would like to propose the following text, which is a slight variation from the text Neil proposed. This would replace the paragraph in ( that begins with "If the client does not send the "code_challenge" in the request..."
> "An AS MUST reject requests without a code_challenge from public clients, and MUST reject such requests from other clients unless there is reasonable assurance that the client mitigates authorization code injection in other ways. See section 9.7 for details."
> Section 9.7 is where the nuances of PKCE vs nonce are described.
> As Neil described, we believe this will allow ASs to support both OAuth 2.0 and 2.1 clients simultaneously. The change from Neil's text is the clarification of which threats, and changing to MUST instead of SHOULD. The "MUST...unless" is more specific than "SHOULD", and since we are already describing the explicit exception to the rule, it's more clear as a MUST here.
> Aaron Parecki
> _______________________________________________
> OAuth mailing list
> _______________________________________________
> OAuth mailing list