Re: [OAUTH-WG] Ambiguity in draft-ietf-oauth-v2-1-08 when code_challenge is omitted

M Hickford <mirth.hickford@gmail.com> Mon, 10 April 2023 10:19 UTC

Return-Path: <matt.hickford@gmail.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 B7CEBC1522C2; Mon, 10 Apr 2023 03:19:02 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.095
X-Spam-Level:
X-Spam-Status: No, score=-2.095 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, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nXIxaNwpvjAo; Mon, 10 Apr 2023 03:19:02 -0700 (PDT)
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D7F60C1522A4; Mon, 10 Apr 2023 03:19:01 -0700 (PDT)
Received: by mail-ej1-x62b.google.com with SMTP id ga37so11699180ejc.0; Mon, 10 Apr 2023 03:19:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1681121939; x=1683713939; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Gg8SwKAu2+pV0a5ptgf5daeRVv7exKWH9bbz4aEpLHg=; b=RdGndisYkM8YNy+bnV1eg/NY5k6r5e3Kr6n7T4pbw7pTmybQSaKqdJv4okj9Y987tY WSfhVA2Nrszt26+1ej+2kUnIBzXKgE2lETPD3LwDfSijlVmkzH5hRFMk/7mYOp1fT+RL ZWan2OX/VZa3gO096VYbatVD4hxKoAjvMArizdyycI6CaCCTvjAfQG00KWIST230QzDP +BIjYdJ/6SVkQT3SH9D5pC9StzctzdxFDfrQH67eeYvOp4h7a0SiPZ8R3PGRMZhLlpNj Ds6Vfz6DxNiAsJ+uMp6pirsvoCLy/Ese05G3zJ5Dysjehwov0G+2ZSZ1swUp/6s5EF/m Eh9w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681121939; x=1683713939; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Gg8SwKAu2+pV0a5ptgf5daeRVv7exKWH9bbz4aEpLHg=; b=rOkt57GKsqv1vYT9+spnuVmFOtEjORDN493TRr7LoVEDfZ1zFOard+7r67cncjtLVJ 3QGJzrtVmt+5Mb4or/T0a2FnsbYS5j9/8WbXROEKxRuek7VKGYr1QMl0pwV3xAVLn1tR cY/ktGnJpqt/iGW9dlrEGc9ILbMa0GtMoet9KhSyHsXexIO4vYViJ98OdBxyIbCnWXPW VazoRrei4zO8d/bBJam0wUcPw8FkyX8LSfy8LCKA8ezIpZ7FKW9xvhRXQcqAp11eEwXE NUM5jYPs4sZY0z1rOOrv9g9FHV2MULj37fUcY1ECGAxq64wC99ut/3y2k+5p060tNP0E X/gg==
X-Gm-Message-State: AAQBX9fkhzc2lAOLXRyIyrpDU/CIfBg/vblHkuB/XDkUfAK9vdPl2fT8 JnWDhbjvWUqnCQREJF0x+VwSrUPA8Bx6WXC+r/SZUy/HOX+pTA==
X-Google-Smtp-Source: AKy350YsT+bAFRzjTTibZpdivzgaYJnANG+hvwk1ZFpT9aAhJU4rVvyjSQEdN4E2nswvDWdk8QweXeMlIrpROiFewSM=
X-Received: by 2002:a17:906:c411:b0:94a:4728:6651 with SMTP id u17-20020a170906c41100b0094a47286651mr2597092ejz.9.1681121939130; Mon, 10 Apr 2023 03:18:59 -0700 (PDT)
MIME-Version: 1.0
References: <CAGJzqskHFRUXo304+ySV6AG6SdZ8aitC=-cVThDm+t93rH2WGw@mail.gmail.com>
In-Reply-To: <CAGJzqskHFRUXo304+ySV6AG6SdZ8aitC=-cVThDm+t93rH2WGw@mail.gmail.com>
From: M Hickford <mirth.hickford@gmail.com>
Date: Mon, 10 Apr 2023 11:18:22 +0100
Message-ID: <CAGJzqsk3e9vBZAhwzqkNzturBc=uoo0BiHu+FEi_AqW5iqMXhA@mail.gmail.com>
To: draft-ietf-oauth-v2-1@ietf.org, draft-ietf-oauth-security-topics@ietf.org
Cc: oauth@ietf.org
Content-Type: multipart/alternative; boundary="000000000000018f0c05f8f8b497"
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/8EDoF59V1E_z1YPqE3pIWucPfmg>
Subject: Re: [OAUTH-WG] Ambiguity in draft-ietf-oauth-v2-1-08 when code_challenge is omitted
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.39
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: Mon, 10 Apr 2023 10:19:02 -0000

On Wed, 5 Apr 2023 at 08:00, M Hickford <mirth.hickford@gmail.com> wrote:
>
>
https://www.ietf.org/archive/id/draft-ietf-oauth-v2-1-08.html#name-countermeasures-2
> says
>
> > To prevent injection of authorization codes into the client, using
code_challenge and code_verifier is REQUIRED for clients, and authorization
servers MUST enforce their use unless both of the following criteria are
met...
>
> Suppose a client (that doesn't meet the exception criteria) omits
> code_challenge in an authorization request. Must the authorization
> server reject it?   "Enforce their use" is unclear to me.  It could
> mean  "if populated, enforce that they are used correctly" (weaker) or
> "enforce that they are populated AND used correctly" (stronger).

Aha. A different section of the doc answers my question
https://www.ietf.org/archive/id/draft-ietf-oauth-v2-1-08.html#section-4.1.2.1

> [Authorization servers] MUST reject requests without a code_challenge
from public clients

I still think the tet around "Enforce their use" could be improved to
clarify this point
https://www.ietf.org/archive/id/draft-ietf-oauth-v2-1-08.html#name-countermeasures-2

Meanwhile
https://www.ietf.org/archive/id/draft-ietf-oauth-security-topics-22.html
says "Public clients MUST use PKCE" but (so far as I can see) doesn't
specify the authorization server behaviour if a public client omits
code_challenge . I think this would be worthwhile to specify, ie.
"Authorization servers MUST reject requests without a code_challenge from
public clients"
https://www.ietf.org/archive/id/draft-ietf-oauth-security-topics-22.html