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

Vittorio Bertocci <vittorio.bertocci@auth0.com> Tue, 24 March 2020 22:36 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 2C8613A053F for <oauth@ietfa.amsl.com>; Tue, 24 Mar 2020 15:36:36 -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 Ee4nz-6I_uf4 for <oauth@ietfa.amsl.com>; Tue, 24 Mar 2020 15:36:33 -0700 (PDT)
Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) (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 5A4D53A053E for <oauth@ietf.org>; Tue, 24 Mar 2020 15:36:33 -0700 (PDT)
Received: by mail-qt1-x831.google.com with SMTP id x16so458136qts.11 for <oauth@ietf.org>; Tue, 24 Mar 2020 15:36:33 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=auth0.com; s=google; h=from:to:cc:subject:thread-topic:thread-index:date:message-id :references:in-reply-to:accept-language:content-language :mime-version; bh=2LL59tOyfyJCJfxaFfQnyx5C4ofwDZ/aykvt4xSuQFs=; b=Co0pONZgtObLgZGdjZafksGsTN5HgNp/DX+nsuIzJ+mKQt85yQMv4B1BuEpmeHZB3z B3pVv2JKhKZ+5gcA3gaUu1oYL59ytvpWmtfyx77AeyXplZAw4LxmUmQN/KhIT/DWh+kG 2JiHMdGkUzyuiZsknvOgA0dQz8EKIq4in3kmJq7qVjrJHUglHsvDnj+ZyZjEDCX/r6sW 565RURhrGHIjijKJvwBo7KSOiIZFPOXB6Aw8fXsSJGm3orlJNqCPg4FYRoRx3QQJGBUz K00PgvHMvzatXHsg8fLWt8y/mnmEc+KdUB0b2L0gkN6L3PtRFtDdJ+N+YHRStyykQdIZ Ie6w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:thread-topic:thread-index :date:message-id:references:in-reply-to:accept-language :content-language:mime-version; bh=2LL59tOyfyJCJfxaFfQnyx5C4ofwDZ/aykvt4xSuQFs=; b=AoI1pfrv37hBJ4K8hY5ju+DzAwQwX6/rK7Yaga3FImJgLtPjVFxyJt8Fd6IFsWP+bg vYkdfk10digY1n/bR0HHcqEfchvdtzWMaY1ZOpArY08ypkPxDa39RjioNxJlq1bsBlxY sKP0pvOGGD/ImFwjQ553KnV3WZYpTYmQmzQ7nd4nS3+CZRdWXWSQPfxZzOTre8Ad38tu /AtIp7oEgO6z8oK3uNqaW0gEHFC8yUoG1dl3K+Rf+2cswvFjjO//KG3hFvQPgdD/9yjF T3QyLsqfuytwqPL6mEOUitsM+nWtJH4zXd9UqvmVroDs+7/qPhahuonJDf6YYoyHV4+o hv0g==
X-Gm-Message-State: ANhLgQ0trJyXRHvd72O6Q+tDJicHlFr2nnHmu5leS8EiuJV3x5iu5HhR bv9zUv8YHZg3kQVQZ+1brCGSYA==
X-Google-Smtp-Source: ADFU+vvUZGX9OZgzTYJ8Cer3MAph6UB6z6q4HOWOrXDhfI/4vk2P2nCE/sohpBoyQVwwZShB1Q4c3w==
X-Received: by 2002:ac8:18c3:: with SMTP id o3mr159108qtk.49.1585089391971; Tue, 24 Mar 2020 15:36:31 -0700 (PDT)
Received: from BL0PR08MB5394.namprd08.prod.outlook.com ([2603:1036:302:851::5]) by smtp.gmail.com with ESMTPSA id n46sm16141770qtb.48.2020.03.24.15.36.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Mar 2020 15:36:31 -0700 (PDT)
From: Vittorio Bertocci <vittorio.bertocci@auth0.com>
To: Nikos Fotiou <fotiou@aueb.gr>, 'Vittorio Bertocci' <Vittorio@auth0.com>
CC: 'Hannes Tschofenig' <Hannes.Tschofenig@arm.com>, 'oauth' <oauth@ietf.org>
Thread-Topic: [OAUTH-WG] WGLC on "JSON Web Token (JWT) Profile for OAuth 2.0 Access Tokens"
Thread-Index: ATBEMUEzVgkZHyweZLG8Yidi1aurtiQ4MiRkQWMtRFYkM2MkZMctgLzm
X-MS-Exchange-MessageSentRepresentingType: 1
Date: Tue, 24 Mar 2020 22:36:30 +0000
Message-ID: <BL0PR08MB5394732A2433F01827C98F9BAEF10@BL0PR08MB5394.namprd08.prod.outlook.com>
References: <AM0PR08MB37160B8A021052198699CD17FAF00@AM0PR08MB3716.eurprd08.prod.outlook.com> <01ec01d6017c$162eb2e0$428c18a0$@aueb.gr> <CAO_FVe7eNVX5vXaYBWVDxee2HPN38-keK8KFWgac5rAaUbBYDA@mail.gmail.com> <006901d6021e$91bf5c00$b53e1400$@aueb.gr>
In-Reply-To: <006901d6021e$91bf5c00$b53e1400$@aueb.gr>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-Exchange-Organization-SCL: -1
X-MS-TNEF-Correlator:
X-MS-Exchange-Organization-RecordReviewCfmType: 0
Content-Type: multipart/alternative; boundary="_000_BL0PR08MB5394732A2433F01827C98F9BAEF10BL0PR08MB5394namp_"
MIME-Version: 1.0
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/qCH76nTswLBNQKCvyNWgiP-z7No>
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 22:36:37 -0000

Thanks Nikos!
You are right that the goals of the two specs are different; however the current spec reflects in large part both what was observed in the proprietary JWT ATs in existing systems (hence making interop more likely/meeting a need that seems widespread) and the current practice of abusing id_tokens for calling API. People do that because their API do leverage the info in the id_token, and include those info in their custom use of JWT for ATs for the same reason. If you add to this the fact that a lot of popular libraries would actually not validate the token if it would not comply with the validation requirements in OIDC, I think we can conclude there’s value in specifying those settings are requirements for successful interop.

From: Nikos Fotiou <fotiou@aueb.gr>
Date: Tuesday, March 24, 2020 at 13:55
To: 'Vittorio Bertocci' <Vittorio@auth0.com>
Cc: 'Hannes Tschofenig' <Hannes.Tschofenig@arm.com>, 'oauth' <oauth@ietf.org>
Subject: RE: [OAUTH-WG] WGLC on "JSON Web Token (JWT) Profile for OAuth 2.0 Access Tokens"

Just a general comment, OIDC has been designed for a specific reason (“identity layer on top of the OAuth 2.0”) whereas JWT access tokens are used for more applications. Since the goal of this specification is to “provide a standardized and interoperable profile as an alternative to the proprietary JWT access tokens layout”,  I feel it is restrictive.

Best,
Nikos

From: Vittorio Bertocci <Vittorio@auth0.com>
Sent: Tuesday, March 24, 2020 7:57 PM
To: Nikos Fotiou <fotiou@aueb.gr>
Cc: Hannes Tschofenig <Hannes.Tschofenig@arm.com>; oauth <oauth@ietf.org>
Subject: Re: [OAUTH-WG] WGLC on "JSON Web Token (JWT) Profile for OAuth 2.0 Access Tokens"

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<mailto: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<mailto:oauth-bounces@ietf.org>> On Behalf Of Hannes Tschofenig
Sent: Monday, March 23, 2020 11:18 PM
To: oauth <oauth@ietf.org<mailto: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<mailto:OAuth@ietf.org>
https://www.ietf.org/mailman/listinfo/oauth