Re: [OAUTH-WG] WGLC on "JSON Web Token (JWT) Profile for OAuth 2.0 Access Tokens"

Vittorio Bertocci <Vittorio@auth0.com> Tue, 24 March 2020 17:57 UTC

Return-Path: <vittorio.bertocci@auth0.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 2A7393A0F6C for <oauth@ietfa.amsl.com>; Tue, 24 Mar 2020 10:57:18 -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_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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=auth0.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 4o4wrJhuFDTV for <oauth@ietfa.amsl.com>; Tue, 24 Mar 2020 10:57:15 -0700 (PDT)
Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) (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 8BD003A0DE9 for <oauth@ietf.org>; Tue, 24 Mar 2020 10:57:15 -0700 (PDT)
Received: by mail-il1-x12c.google.com with SMTP id k29so17675801ilg.0 for <oauth@ietf.org>; Tue, 24 Mar 2020 10:57:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=auth0.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=o8j7qQi5FyEhB2Yo27xnOz7Z7DKwg4pZHHkszOICk0o=; b=MyayF6no4Q050qlN+vfs5ERzq8+U4aZP0l96nAdWXOeqwm6M6aouBBYNQan37CWJ6S sTECvjfbhD6QZZd85ty6/qzXUyvoay0SfyJ0MBnALm52oZufyPGSfpxnejFNouU4qYSI hqPIxNPKionBW8TbwcpYV00BS7h52FynzkSgJnocRAMLh9Q3r3u2eTmwe+OvdesVis+B EQkVcQDDB6WffQhB4wAGk7t28SB9Jn7HRIwocBm2ekM/Gf6nrLJ7bmSUmBaRPTjia1q/ kUMrnHCFvA+G4L/Egrf95C83TRezNpmB73LtxTOS2aWWoaS/AlBLPSktt8g6UpENz1JK ob3g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=o8j7qQi5FyEhB2Yo27xnOz7Z7DKwg4pZHHkszOICk0o=; b=uZOFeow27IUaQ5piMlztJt9upiMIQWU5rO5zVt7F8vrcfbHfSzXxxJsJDA+cS069NB cPz4jeRhn2hvhdV/GefeLAnWZIBpPkKU0J7Mxc3k/Q+NwdKzMnU+u3DNLFLa74hMmqLD ixT1Q7kvqqkUdr/4WwSRatnZiRxAfodY8trHrTG1Oykxy7TPG3dmYd57T9ySDpOn0/Ux 5KE8D8enKhd2f7kk0oUTEkH+lmE/NzCfaambFmkVS+TKWlU5YzNaExEzDBMTfRz7wORO qQFfcA2JX92qZ3KchuOD1W5paps862+X/gQDnEQHcDo6grKB+uquVXHWka38Mnyx6H01 iqBA==
X-Gm-Message-State: ANhLgQ1rgO4ivLzBSeEYiwahqeJ0sIAlUMo5FHiKWD6TFZYTx9KV1/nw IkbuCpaKjG6jRoEZq+Ep/Fcmc0hmTWaQWEPotFL+0w==
X-Google-Smtp-Source: ADFU+vuyxkIGjHrA0G3kGDl8ofgT25rc24MdPVN3tKq35u2WqJn5SWo/uXql4Rhh9vd4nJDPecI/sAtJF5vwMaY2SL8=
X-Received: by 2002:a92:c790:: with SMTP id c16mr5075092ilk.206.1585072634053; Tue, 24 Mar 2020 10:57:14 -0700 (PDT)
MIME-Version: 1.0
References: <AM0PR08MB37160B8A021052198699CD17FAF00@AM0PR08MB3716.eurprd08.prod.outlook.com> <01ec01d6017c$162eb2e0$428c18a0$@aueb.gr>
In-Reply-To: <01ec01d6017c$162eb2e0$428c18a0$@aueb.gr>
From: Vittorio Bertocci <Vittorio@auth0.com>
Date: Tue, 24 Mar 2020 10:57:02 -0700
Message-ID: <CAO_FVe7eNVX5vXaYBWVDxee2HPN38-keK8KFWgac5rAaUbBYDA@mail.gmail.com>
To: Nikos Fotiou <fotiou@aueb.gr>
Cc: Hannes Tschofenig <Hannes.Tschofenig@arm.com>, oauth <oauth@ietf.org>
Content-Type: multipart/alternative; boundary="0000000000004bdfc005a19d7b80"
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/hq6iahIQYB75BqAxeVMZfkXZ4s4>
Subject: Re: [OAUTH-WG] WGLC on "JSON Web Token (JWT) Profile for OAuth 2.0 Access Tokens"
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: Tue, 24 Mar 2020 17:57:39 -0000

Hi Nikos,
thanks for taking the time to review and write down your feedback!
Inline

- In Section 2.2 why nbf claim (
> https://tools..ietf.org/html/rfc7519#section-4.1.5)
> <https://tools.ietf.org/html/rfc7519#section-4.1.5)> is not considered? I
> can imagine some interesting applications of this claim.

The validation rules are partly following the ones defined in OpenID
Connect, given that a lot of in market deployments reuse some low level JWT
validation components.

  - In the same section, it is not clear why some claims are required,
> especially exp, sub, and client_id. The last two claims are not even used
> during token validation.

 Being this an interop profile, it reflects the information commonly found
in many existing JWT based access tokens solutions in the wild. Both sub
and client_id provide information that proved to be useful to RSes and
SDKs/middlewares, hence guaranteeing their presence will help creating
reusable libraries with broader applicability. The AS has ready access to
that info, and there are no obvious security reasons for omitting them.
Also, sub and exp are both required in OIDC, and clientID is available via
aud (also required) - hence requiring their presence helps developers to
reuse existing validation logic to at least some extent.

  - RFC7519 specifies that, in the general case, the aud claim is an array
> of StringOrURI values. In this draft it is not clear if this still the
> case, or here aud is a simple string (e.g., in page 5 it is stated: the
> resource indicated in the aud claim, rather than the resource*s*).

For simplicity, and above all for avoiding ambiguity in evaluating to what
resource the granted scopes should be applied to, the idea would be to
restrict to a single string.

  - In the token validation procedure, i.e., Section 4, is there any reason
> why the resource server first checks the aud claim, then the signature, and
> finally the exp claim? Given the fact that Error responses are not
> specified, returning something like “invalid aud claim” even for tokens
> with invalid signature may result in privacy/security attacks.

 The sequence of those checks follows
https://openid.net/specs/openid-connect-core-1_0.html#IDTokenValidation.  As
OIDC doesn't define error responses nor call this aspect out in the
security considerations, I largely relied on this being mainstream.

  - IMHO The token validation procedure it too bound to the particular
> discovery mechanisms mentioned at the beginning of this section. E.g., Step
> 2 mentions a “registration” process, and Step 3 mentions and an “Issuer
> Identifier” which must much the iss claim. Moreover, I think it should be
> explicitly mentioned that the resource server “must validate that the JWT
> access token has been singed with a signing key that corresponds to the
> authorization server included in the iss claim”

As per the other points, the language follows closely OIDC.
The step does contain the phrase "The resource server MUST use the keys
provided by the authorization server." Do you feel the language should be
more explicit? The document doesn't specify any other mechanism for
acquiring keys, hence it shouldn't be too ambiguous... but we can always
tighten it up.


On Mon, Mar 23, 2020 at 6:32 PM Nikos Fotiou <fotiou@aueb.gr> wrote:

> Hi all,
>
>
>
> Allow me some comments and forgive me if some of them are naïve.
>
> - In Section 2.2 why nbf claim (
> https://tools..ietf.org/html/rfc7519#section-4.1.5)
> <https://tools.ietf.org/html/rfc7519#section-4.1.5)> is not considered? I
> can imagine some interesting applications of this claim.
>
> - In the same section, it is not clear why some claims are required,
> especially exp, sub, and client_id. The last two claims are not even used
> during token validation.
>
> - RFC7519 specifies that, in the general case, the aud claim is an array
> of StringOrURI values. In this draft it is not clear if this still the
> case, or here aud is a simple string (e.g., in page 5 it is stated: the
> resource indicated in the aud claim, rather than the resource*s*).
>
> - In the token validation procedure, i.e., Section 4, is there any reason
> why the resource server first checks the aud claim, then the signature, and
> finally the exp claim? Given the fact that Error responses are not
> specified, returning something like “invalid aud claim” even for tokens
> with invalid signature may result in privacy/security attacks.
>
> - IMHO The token validation procedure it too bound to the particular
> discovery mechanisms mentioned at the beginning of this section. E.g., Step
> 2 mentions a “registration” process, and Step 3 mentions and an “Issuer
> Identifier” which must much the iss claim. Moreover, I think it should be
> explicitly mentioned that the resource server “must validate that the JWT
> access token has been singed with a signing key that corresponds to the
> authorization server included in the iss claim”
>
>
>
>
>
> Best,
>
> Nikos
>
>
>
> *From:* OAuth <oauth-bounces@ietf.org> *On Behalf Of *Hannes Tschofenig
> *Sent:* Monday, March 23, 2020 11:18 PM
> *To:* oauth <oauth@ietf.org>
> *Subject:* [OAUTH-WG] WGLC on "JSON Web Token (JWT) Profile for OAuth 2.0
> Access Tokens"
>
>
>
> Hi all,
>
>
>
> this is a working group last call for "JSON Web Token (JWT) Profile for
> OAuth 2.0 Access Tokens".
>
>
>
> Here is the document:
>
> https://tools.ietf.org/html/draft-ietf-oauth-access-token-jwt-04
>
>
>
> Please send you comments to the OAuth mailing list by April 6, 2020.
>
>
>
> Ciao
>
> Hannes & Rifaat
>
> IMPORTANT NOTICE: The contents of this email and any attachments are
> confidential and may also be privileged. If you are not the intended
> recipient, please notify the sender immediately and do not disclose the
> contents to any other person, use it for any purpose, or store or copy the
> information in any medium. Thank you.
> _______________________________________________
> OAuth mailing list
> OAuth@ietf.org
> https://www.ietf.org/mailman/listinfo/oauth
>