[OAUTH-WG] AD Review of draft-ietf-oauth-security-topics-24

Roman Danyliw <rdd@cert.org> Mon, 18 December 2023 23:08 UTC

Return-Path: <rdd@cert.org>
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 C2C2EC14CE4D for <oauth@ietfa.amsl.com>; Mon, 18 Dec 2023 15:08:28 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.106
X-Spam-Level:
X-Spam-Status: No, score=-2.106 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, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=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 (1024-bit key) header.d=cert.org
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 NRsnilyrPvAr for <oauth@ietfa.amsl.com>; Mon, 18 Dec 2023 15:08:24 -0800 (PST)
Received: from USG02-CY1-obe.outbound.protection.office365.us (mail-cy1usg02on0095.outbound.protection.office365.us [23.103.209.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 68B36C14CE42 for <oauth@ietf.org>; Mon, 18 Dec 2023 15:08:24 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector5401; d=microsoft.com; cv=none; b=gIoQC7TnYXJrnBQCLxKBgnigsWFDsdJQhlR/znArcNyer25d6ZO0J44d/hW7abeEzpEef0h8rWI0AfHtnuJVC85ejUPW8Ep9od8EgRHW+aPs+qBtdjwzolF/dOGaT9FzeVNokdPspad55e76LrtVrSR1m8HJfw24RnoKUHx/ZRiDcaRZnD49rJ+rn/eu9TH+NmufhK3bnU9QGxSsKuckW2IOh7Q8ijnS3i4jKqpFywIC6GFRvF2QcW8LbUJn/fg48MMMl6ga/1S93+kfiXhHU4MU9fvWDQtdNBb1e/Jtfrq0HXKkoKsWKNUf6OpoeppN2tm1ElQ1s+C4BjWjhVr0uA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector5401; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OBvri0hnn8EIVDJmdJxu+U2+nX27JINB5ZQKUcD18rU=; b=AQjD1GMtTF7+aGfm5Ah80ipK1B2QCVlEZ8uChOfu9VXXO927F5LuAg6TbbUzlFsNCm4XPECuQojMKPnbo730HYyGv6BNnopemOf6xm51vQRDY+sd5ZPwpSXp9lM/aGnU7sgzZrwDK42OkKRQPa4i789rG2oT+Z1M9oBKzv71YfpNb6FC2WLvC9B24e+Ps8taRp5RZXKHOUerDsrrQLFfij6bcs+sTBr3b+bP4NrmBC5aMBXlskBgzo9wyY6494SB9G8QSg/+Ix/XPVGPsuXnOSIw2x0vusjzkDdch51y8Q8ZsRLXnt+E+N04zNx6AVlIdcxMZYhP33p0ecZ+p7V/AA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cert.org; dmarc=pass action=none header.from=cert.org; dkim=pass header.d=cert.org; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cert.org; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OBvri0hnn8EIVDJmdJxu+U2+nX27JINB5ZQKUcD18rU=; b=gyURQ+hmFuBSHQ7V2ey7BKSvg+ll0YnrBlk6VyKN5AYHDWYMokduU4iHSab2f1RWsVvpV2EvmS40uVqkJXQOfeEWsN8kB2P8DRSpw7Ic9EHb34M8JC1q7oz7Z9B4iA4gp1UJnZlxHE/jzM2+tpCpt7vNJ9NhGiv0rBjzYlElX58=
Received: from BN2P110MB1107.NAMP110.PROD.OUTLOOK.COM (2001:489a:200:168::11) by BN2P110MB1288.NAMP110.PROD.OUTLOOK.COM (2001:489a:200:17a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.40; Mon, 18 Dec 2023 23:08:21 +0000
Received: from BN2P110MB1107.NAMP110.PROD.OUTLOOK.COM ([fe80::3eef:e20:c04d:1ffe]) by BN2P110MB1107.NAMP110.PROD.OUTLOOK.COM ([fe80::3eef:e20:c04d:1ffe%6]) with mapi id 15.20.7002.040; Mon, 18 Dec 2023 23:08:21 +0000
From: Roman Danyliw <rdd@cert.org>
To: oauth <oauth@ietf.org>
Thread-Topic: AD Review of draft-ietf-oauth-security-topics-24
Thread-Index: AdoyBsv+aAbH2NL1QTqqDZUblAlc2g==
Date: Mon, 18 Dec 2023 23:08:21 +0000
Message-ID: <BN2P110MB1107E776ABB32FDCA7534988DC90A@BN2P110MB1107.NAMP110.PROD.OUTLOOK.COM>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=cert.org;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: BN2P110MB1107:EE_|BN2P110MB1288:EE_
x-ms-office365-filtering-correlation-id: 20138f7d-6c7f-41bd-219d-08dc001e3a98
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: Wm2+9cO294E1C5bHDUywBn4dOesUi+7K8hwDThwYE997tU0mWfUZXPI8CRAQoGFQescLlFaPdCP0F6zTj5Xuv5Gkemll26IbN9MSHH1akHaidvNBS8+ACvFhxpRfTmnjlFzPh3UL4Y3xF7HW/yfmqxxPne5Torv1GnmLGXI4HvE47f99itIZ1Z9yxRYX/dCkjoUDK8/L7Z1MIvxJKg2AYz7aE2fnr0b2Z+rBrXQCwzK8pmi+4xFVEdfobV8mCNUSECJ0kg+DHrBmdpAft3vqXg9GWaX3hVaKpJiOaLOcLZ0xqrWgM4hZhKasuvI5RutA967rgAuSIBVplxBGW4mxncx0RdqlhJyGwaY9mbA7P4GnOStSuxP01FJFAs5INy/4vAFKIaX/91QGDGx6iGoUuIvK+0vUAYzg2dITo1MEulZQYl/RHJV0BhNSaJhxUmrxAJ3yz77F0SBijGTyjOXsRF0iqhTibl6km7TmMTHxlWa32yMLes1mKXVSwAEOshGiAY/SSh7cdXQQtsJMpzdVzJfjIyuUzILZQog2reM1lgiFxCf0/y8rvpeY+WVD55ODdqDt9Gxa9IQ3hheKCQAiI7BXzGE1re+wyvPfjtbu8JQDVKdpLitqnEN1LMwynuoCAZ+T3QPTg0wFkut8Pk4MjovJ44u8mi1YZWKfw2GDW3Q=
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN2P110MB1107.NAMP110.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230031)(39830400003)(396003)(366004)(136003)(230273577357003)(230173577357003)(230922051799003)(1800799012)(451199024)(186009)(64100799003)(66446008)(6506007)(66556008)(66476007)(66946007)(76116006)(83380400001)(6916009)(38070700009)(86362001)(7696005)(26005)(71200400001)(9686003)(33656002)(38100700002)(122000001)(82960400001)(508600001)(64756008)(41320700001)(5660300002)(55016003)(15650500001)(2906002)(52536014)(8936002)(41300700001)(66574015)(8676002); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-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N3HoE6wPT9K5hO5TK+wB2tvRVjv/8SXSs0Ove5TnYGIr0CkIEbL6mtX5+hJmOn2Gm5jcidRmJqd6ixZad2n0UwF6Iqh/aVRlpxQEVejfkMK0V3lT87VDv545+DQj+0G1MNNE/LXQ7MLY8ZM2aGM8ZVJN5U+D6SsZPpi1F8WxTiBmeDBd6EjYLxWUeKnBAC2l+nwv74hGSAyJbv4LprgGHp7te3MNnM5u0IgZYEaoYuzpEgRDiZLqkUcNPjBCgbRDwhhwXhy6zziZriJrBW4s83B1pw4h/7QcVQzZteWeut9+XgFj8I8I/ZzM2z+0BHK1cg4YXP+Bj9dkGJZJyZkFInUpdyVNkiUbg6c5y7LwvTNOlNP93qIOiiCENubhxSC4Fkz+vejTwZRqo7h49710aeoRm/NJG4jxTMSz99rZIm7LjoqQ+fxGrxmvY+0=
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: cert.org
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: BN2P110MB1107.NAMP110.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: 20138f7d-6c7f-41bd-219d-08dc001e3a98
X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Dec 2023 23:08:21.1415 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 95a9dce2-04f2-4043-995d-1ec3861911c6
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN2P110MB1288
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/bTb-cLGsgUo9cWo5D1UFSwIGWtU>
Subject: [OAUTH-WG] AD Review of draft-ietf-oauth-security-topics-24
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, 18 Dec 2023 23:08:28 -0000

Hi!

I performed an AD review of draft-ietf-oauth-security-topics-24.  Thank you for taking the time to document many years of operational deployment experience.  My feedback is below:

From idnits:
** All documents that are called out as being updated in the meta-data need to be mentioned in the abstract:

  -- The draft header indicates that this document updates RFC6750, but the
     abstract doesn't seem to mention this, which it should.

  -- The draft header indicates that this document updates RFC6749, but the
     abstract doesn't seem to mention this, which it should.

  -- The draft header indicates that this document updates RFC6819, but the
     abstract doesn't seem to mention this, which it should.

** Replaced RFC7231 with RFC9110
  -- Obsolete informational reference (is this intentional?): RFC 7231
     (Obsoleted by RFC 9110)

** I haven’t done the detailed review, but how much of this document applies to OAuth 2.1?  If it is significant, should it be mentioned?

** I struggled to understand what was mandatory in the mix of RFC2119 keywords.
(a) Section 1 says “Nonetheless, it is RECOMMENDED that implementers upgrade their implementations and ecosystems when feasible.”

(b) Section 3 says “OAuth MUST ensure that the authorization of the resource owner (RO) (with a user agent) at the authorization server (AS) and the subsequent usage of the access token at the resource server (RS) is protected at least against the following attackers:”

(c) Section 3 later says “Implementers MUST take into account all possible types of attackers in the environment in which their OAuth    implementations are expected to run.”

(b) and (c) seem to be making strong statements mandatory requirements for high-level threats.  However, (a) seems to suggest that conformance is only recommended.  Furthermore, Section 4.* helpfully provides very extensive guidance on threat mitigation but there are a many “SHOULDs” with few rationales on why a given practice is not mandatory.  I recommend reviewing the “SHOULDs” in Section 4.* and confirming they can’t be MUSTs or explaining why the not.


** Section 1.  Editorial.
   OAuth 2.0 ("OAuth"
   in the following)

This parenthetical is a fragment.  Should it be “referred to as simply “OAuth” in this document”?

** Section 2.1
   When an OAuth client can interact with more than one authorization
   server, a defense against mix-up attacks (see Section 4.4) is
   REQUIRED.  To this end, clients SHOULD
         …

   In the absence of these options, clients MAY instead use ...

The text is clear on saying some defense from a mix-up attack is needed.  What happens if the client cannot use the methods prescribed by the SHOULD and MAY in this text?

** Section 2.1.1
   Clients MUST prevent authorization code injection attacks (see
   Section 4.5) and misuse of authorization codes using one of the
   following options:

What approach should a confidential client take of PKCE is not used?  It is only recommended in the subsequent bulleted list.

** Section 2.2.

   The privileges associated with an access token SHOULD be restricted
   to the minimum required for the particular application or use case.

Under what circumstances should access tokens not be restricted?  Can this be documented?

** Section 2.3
   In particular, access tokens SHOULD be restricted to certain resource
   servers (audience restriction), preferably to a single resource
   server.

Is there anyway to refine this text to make the interplay of the SHOULD and “preferably” clearer?

** Section 2.4
  and authentication processes that require multiple
   steps can be hard or impossible.

Is this difficulty due to complexity?  It would be helpful to refine why it is “hard”.

** Section 2.6.
   It is RECOMMENDED to use end-to-end TLS between the client and the
   resource server.  If TLS traffic needs to be terminated at an
   intermediary, refer to Section 4.13 for further security advice.

Is there further TLS guidance to provide?  Could BCP 195 be used (RFC9325)?

** Section 3.
     It must also be assumed that web attackers can lure the user to
      open arbitrary attacker-chosen URIs at any time.

Is “open” needed here?  Isn’t it just arbitrary URIs?

** Section 3.
Implementers MUST take into account all possible
   types of attackers in the environment in which their OAuth
   implementations are expected to run.  Previous attacks on OAuth have
   shown that OAuth deployments SHOULD in particular consider the
   following, stronger attackers in addition to those listed above:

The mix of MUST in the first sentence and SHOULD in the second is confusing.  The first sentence requires taking all possible attacks into consideration.  However, the second sentence then uses the weaker SHOULD for specific attacks that seem in-scope of the first sentence.

** Section 4.1

   Several
   successful attacks exploiting flaws in the pattern matching
   implementation or concrete configurations have been observed in the
   wild .

Could these be cited?

** Section 4.1.1.  Editorial.  These examples are very helpful.  For the inline URLs, consider putting them in quotes to improve readability.

** Section 4.5.3.  Editorial.
   There are two good technical solutions to achieve this goal, outlined
   in the following.

Recommend restating the goal.

** Section 4.7.1
   *  If state is used for carrying application state, and integrity of
      its contents is a concern, clients MUST protect state against
      tampering and swapping.  This can be achieved by binding the
      contents of state to the browser session and/or signed/encrypted
      state values as discussed in the now-expired draft
      [I-D.bradley-oauth-jwt-encoded-state].

Is [I-D.bradley-oauth-jwt-encoded-state] the only way this can be achieved?  If not, s/This can be achieved/An example of how this can be achieved/.  Otherwise, there is a normative dependency created on an expired draft.

** Section 4.7.1.  Editorial. s/but AS MAY/but the AS MAY/

** Section 4.8.1
      the client has set the parameter
       code_challenge=sha256(abc)

-- Isn’t it base64(sha265(abc))?

-- Recommend citing that this is S256 per Section 4.2 of RFC7636 otherwise IETF LC or IESG review feedback will likely ask for a SHA256 citation.

** Section 4.8.2.  Editorial?
   Therefore, ASs MUST take precautions against this threat.

Is that the same things as saying this attack MUST be mitigated in some way?

** Section 4.9.2.
   If the attacker were able to gain full control, including shell
   access, all controls can be circumvented and all resources can be
   accessed.

What is the link to “shell access”?

** Section 4.9.2.
   *  The resource server MUST treat access tokens like any other
      credentials.  It is considered good practice to not log them and
      not store them in plain text.

Consider tightening up the language here.  There are a multitude of credentials with varied practices.  Recommend being specific on the desired OAuth token behavior.

** Section 4.10.2.
   The proposed mechanism [RFC8707] could be used or by
   encoding the information in the scope value.

-- What is “proposed” about RFC8707?

-- Please provide a reference to the scope value (Section 3.3 of RFC6749)

** Section 4.12.  Typo. s/unambigiously/unambiguously/

** Section 4.14.2
   Authorization servers SHOULD determine, based on a risk assessment,
   whether to issue refresh tokens to a certain client.

How can the decision to issue refresh tokens selectively be ambiguous?  Either they are issued or not.  Why isn’t this a MUST?

** Section 4.18.2.  Formally cite that these are Javascript (?) examples.

Regards,
Roman