[OAUTH-WG] Re: Andy Newton's Discuss on draft-ietf-oauth-browser-based-apps-24: (with DISCUSS and COMMENT)

Aaron Parecki <aaron@parecki.com> Wed, 28 May 2025 15:53 UTC

Return-Path: <aaron@parecki.com>
X-Original-To: oauth@mail2.ietf.org
Delivered-To: oauth@mail2.ietf.org
Received: from localhost (localhost [127.0.0.1]) by mail2.ietf.org (Postfix) with ESMTP id 647592DEDAAC for <oauth@mail2.ietf.org>; Wed, 28 May 2025 08:53:22 -0700 (PDT)
X-Virus-Scanned: amavisd-new at ietf.org
X-Spam-Flag: NO
X-Spam-Score: -2.099
X-Spam-Level:
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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: mail2.ietf.org (amavisd-new); dkim=pass (2048-bit key) header.d=parecki.com
Received: from mail2.ietf.org ([166.84.6.31]) by localhost (mail2.ietf.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hzCZ1qEWQl2H for <oauth@mail2.ietf.org>; Wed, 28 May 2025 08:53:21 -0700 (PDT)
Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail2.ietf.org (Postfix) with ESMTPS id 6B3162DEDA93 for <oauth@ietf.org>; Wed, 28 May 2025 08:53:21 -0700 (PDT)
Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-551fc6d4a76so5280511e87.0 for <oauth@ietf.org>; Wed, 28 May 2025 08:53:21 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=parecki.com; s=google; t=1748447600; x=1749052400; darn=ietf.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=eLqLB2DHlw2VQigfmDwp0upI9j/SAg4WhBQaBPSYXfY=; b=k7aJJUXDUxCYTiMlsbsT1/u11ZP/QdkvJy4HvVa1UyMSx6mAgGEzwyFTNEXvVmTfX5 TtNbI6zUsIp7PoX3Y41ZNsQKlgc/ZLHt2vPxRx3VkIizcFKQLnXgRoGsSSHV0txoD4ye rQ8cTCBarptCgGd620yO0jp1fH8RB655uTUT1dXNY+vZrOPzVtatCTJd9mHbpiThIWvX AvrVnvANG5qmXzejdj8fYxGVAFRhYzZhr8z8RpPo5fJrZyq+lrJrY56AQxEHeZk4wMgM ZQjDFnOwYQ+RUQyS7rmlknkzfd3grGI0s2xdYXWf54sZeKzaGVgqyGMwfLfoAlxlu4IE Eo6w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748447600; x=1749052400; 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=eLqLB2DHlw2VQigfmDwp0upI9j/SAg4WhBQaBPSYXfY=; b=mNtHO8sT6MKWAo7qLmpMtvfpsSnt5Oi4v1KDPHHwbKd9wOTSneCTctJ9chcIk3mR2r RfwO6hYGCVDmQ0+iomkiuOi7oVSiomFpjHxI29zIAHu7+IKs8FPhQdiHw4ExFzWtP43y aUFq0FUr75bPGgWwV8qxzTfXY7BNlDJ0Kvg8C3AFZ0REm727k6fqD1h87dXouHXXvoIP Qw8V8Lu7YHf1IHWvBNNQoLUiMc41i4kjwCdSn6Q1+3YZ1HwYuUkQfPNhZOQkSxmqQ9eA DxnwivCbyZ+dl/MmFKpiqhNWCueF7WyMEjfEs5v3LStkEci7XsswlA351zfuD3lcS535 atig==
X-Forwarded-Encrypted: i=1; AJvYcCVmbCailng3akRmICoTpXjq4V1vnZGNSLN3d0WAA2HSCIV+59SDKeHr11/7kSLz4KG2zkVwCA==@ietf.org
X-Gm-Message-State: AOJu0YyWqcB0CKvH/iTj3Zzd4a40VVmTEY5RPfCat8CzTeU7JjV1kRbx AdSD4E6Epv1dWyHWlfSV+RH2NClZUmYyKKPbWHmqr89vae/zt5uZARSZ55QnRimR6Q==
X-Gm-Gg: ASbGnctN8GhMkuaHhNMdbR8wWF+8jLru/q5hh7pv2InKM+OXXekew0WedhyMPr7qQUl XrbeeesqF0ua5XGDGsoi0SFl/L6JAyB+7y01dcjMUHP5e0ym371L9YXPihvajtWnBTA3heG33W+ Ps1sO4AYWmdJMoF24o/6AEaKzG7/ajyFZRyc0uVrxWfzmkiKmiaHz9pTsSD+wmmH1uz84/OEE7t mthhsxpkI5qF5XlwW4kUJ41Yv/ZGscsJITo3q4byi68W3dD3BXiJsu7hkbv0yP0ZSEjF7oYizRo LspQGywnrkzrYX/nIULi2h48JergiimQCzbSCzcb22lola+oRguTVnMyWQheN47XqzrsuI30w9s CGswywT10m1ADPw==
X-Google-Smtp-Source: AGHT+IFCBYGPQ0o6ITEHuQAJkWZTi9Ot1xREIZtOx0UP6HwZmST+0cioqTyCTpxgVrGOZNM+fV82nw==
X-Received: by 2002:a05:6512:318e:b0:553:202e:a405 with SMTP id 2adb3069b0e04-553202ea4a3mr4268798e87.0.1748447599825; Wed, 28 May 2025 08:53:19 -0700 (PDT)
Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com. [209.85.208.169]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5532f6a61b8sm335454e87.192.2025.05.28.08.53.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 May 2025 08:53:19 -0700 (PDT)
Received: by mail-lj1-f169.google.com with SMTP id 38308e7fff4ca-30effbfaf4aso51184011fa.3; Wed, 28 May 2025 08:53:19 -0700 (PDT)
X-Forwarded-Encrypted: i=1; AJvYcCU1UZjQz3DFUquPugVSgmdSIZHV4tcQqDfIP21Hu0wVRDz7wX0x1Eam0fledlKe56T+6B0M5nQ=@ietf.org, AJvYcCU6oz5sUl3879Usyw+SoLbz7wYDNlxGDCnVpga0L1SzD60C/drtu2dmggjz2AtTa5pjiRW/OvRUeiQ6cpmo@ietf.org, AJvYcCXAArmneTP4G2W9df/Qc7uGDizGjpSHiylwu53mejHnPiM5AItcgpmRuxMOyRQU+P9ZQPuSHb64nAv3ice141K14VbmmM5iaN9HG6QcZwTYod6Feg==@ietf.org
X-Received: by 2002:a2e:bea6:0:b0:326:dcdc:1230 with SMTP id 38308e7fff4ca-3295ba96af8mr50503021fa.41.1748447598821; Wed, 28 May 2025 08:53:18 -0700 (PDT)
MIME-Version: 1.0
References: <174484320665.1477656.10258299797522091081@dt-datatracker-64c5c9b5f9-hz6qg>
In-Reply-To: <174484320665.1477656.10258299797522091081@dt-datatracker-64c5c9b5f9-hz6qg>
From: Aaron Parecki <aaron@parecki.com>
Date: Wed, 28 May 2025 08:53:06 -0700
X-Gmail-Original-Message-ID: <CAGBSGjptOfhvMheqFPRcY1yQLeBS+wSnKJj8HphTpDoBK1i15w@mail.gmail.com>
X-Gm-Features: AX0GCFuX3t7VIX5mNjBZ7gvy72Kh8QGZUw--XbhCjhqZLm3CQejJkKa3vjvG1_g
Message-ID: <CAGBSGjptOfhvMheqFPRcY1yQLeBS+wSnKJj8HphTpDoBK1i15w@mail.gmail.com>
To: Andy Newton <andy@hxr.us>
Content-Type: multipart/alternative; boundary="0000000000000947090636342e48"
Message-ID-Hash: UKEDAPHO6G6QVPQKEIXMUTJ5CIDWAPZA
X-Message-ID-Hash: UKEDAPHO6G6QVPQKEIXMUTJ5CIDWAPZA
X-MailFrom: aaron@parecki.com
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-oauth.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: The IESG <iesg@ietf.org>, draft-ietf-oauth-browser-based-apps@ietf.org, oauth-chairs@ietf.org, oauth@ietf.org
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [OAUTH-WG] Re: Andy Newton's Discuss on draft-ietf-oauth-browser-based-apps-24: (with DISCUSS and COMMENT)
List-Id: OAUTH WG <oauth.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/keYPnJfFrEBS1oJaNUkdqo_BOLk>
List-Archive: <https://mailarchive.ietf.org/arch/browse/oauth>
List-Help: <mailto:oauth-request@ietf.org?subject=help>
List-Owner: <mailto:oauth-owner@ietf.org>
List-Post: <mailto:oauth@ietf.org>
List-Subscribe: <mailto:oauth-join@ietf.org>
List-Unsubscribe: <mailto:oauth-leave@ietf.org>

Thanks for your detailed review and comments Andy! Responses are inline.


On Wed, Apr 16, 2025 at 3:40 PM Andy Newton via Datatracker <
noreply@ietf.org> wrote:

>
> ----------------------------------------------------------------------
> DISCUSS:
> ----------------------------------------------------------------------
>
> # Andy Newton, ART AD, comments for draft-ietf-oauth-browser-based-apps-24
> CC @anewton1998
>
> * line numbers:
>   -
>
> https://author-tools.ietf.org/api/idnits?url=https://www.ietf.org/archive/id/draft-ietf-oauth-browser-based-apps-24.txt&submitcheck=True
>
> * comment syntax:
>   - https://github.com/mnot/ietf-comments/blob/main/format.md
>
> * "Handling Ballot Positions":
>   -
> https://ietf.org/about/groups/iesg/statements/handling-ballot-positions/
>
> ## Discuss
>
> Many thanks to authors and working group for putting this document
> together.
> And thanks to all the reviewers who have provided very good feedback.
>
> ### Update RFC 9700
>
> 166        Many of these recommendations are derived from the Best Current
> 167        Practice for OAuth 2.0 Security [RFC9700], as browser-based
> 168        applications are expected to follow those recommendations as
> well.
> 169        This document expands on and further restricts various
> 170        recommendations given in [RFC9700].
>
> Given the above text which states that it further restricts RFC 9700,
> should this document be listed as updating RFC 9700?
>

I am not 100% sure of the criteria for marking an RFC as updating another,
but I don't think that is the case here. The recommendations in this draft
are meant to be complementary to RFC 9700.


>
> ### Consistency of Terms
>
> 188        "Browser-based application":  An application that is dynamically
> 189           downloaded and executed in a web browser, usually written in
> 190           JavaScript.  Also sometimes referred to as a "single-page
> 191           application", or "SPA".
>
> This draft introduces the term "Browser-based application" which is used
> in some places, but it also uses the term "Javascript application" in
> many more places. Here is an example where the two terms are used
> together and to mean the same thing (I think).
>
> 1436       The token-mediating backend counters the first two attack
> scenarios
> 1437       by not exposing the refresh token to the browser-based
> application.
> 1438       Even when the attacker gains full control over the JavaScript
> 1439       application, there are simply no refresh tokens to be stolen.
>
> Is a JavaScript application the same thing as a browser-based application
> in this document? I also noticed a few places where the term SPA or single
> page application were used. If these are all the same term, can one term
> be used instead of many? And if they are separate terms, can their
> definitions
> all be given even if quoting from a reference?
>

Yes, these are all intended to refer to the same thing. I've just gone
through and updated all the uses of "JavaScript application" to
"browser-based application" or "application" where appropriate. The few
references that remain to "JavaScript" should only be where we are talking
about JavaScript APIs specifically.


>
> 1737       In this scenario, the application sends JavaScript-based
> requests to
> 1738       the authorization server and the resource server.  Given the
> nature
>
> What is a Javascript-based request? Is this a request for data in JSON
> format
> or is it a request being made by code of the JavaScript application (or
> browser-based application)?
>

I've rephrased this to be more clear:

"...the application uses a browser API to send requests..."


>
> ### BFF as an HTTP Proxy
>
> From the description of the BFF with respect to the browser-based
> application
> and the resource server, it appears to act as an HTTP proxy as defined in
> Section 3.7 of RFC 9110. Should this document make note of this
> and reference the message forwarding requirements of Section 7.6 in RFC
> 9110?
>
>
The BFF is not intended to act like an HTTP proxy. It is more like a
gateway or reverse proxy, except that in this case it is considered part of
the OAuth client rather than part of the resource server (API).

I've swapped some of the uses of "proxies" with "forwards" to hopefully
avoid this connotation.


>
> ----------------------------------------------------------------------
> COMMENT:
> ----------------------------------------------------------------------
>
> ## Comments
>
> ### BFF Operational Considerations
>
> As the BFF is forwarding/proxying all requests to the resource server,
> I wonder if there are any operational issues to consider. If a resource
> server is rate limiting requests based on IP addresses, might it start
> blocking requests as it would appear many users are originating from
> one or a few sources?
>
> Good call-out. I've added a new consideration under this pattern
describing this.


>
> ## Nits
>
> ### hard drive
>
> 905        cookies are never written to the user's hard drive in plaintext
>
> Most users today probably do not use equipment with hard drives.
> This is probably better said as "local, persistent storage".
>
> Thanks, I've updated the text accordingly.

These changes are currently in the GitHub repo but not yet published to
datatracker. Here are the individual commits if you'd like to see the diffs:

*
https://github.com/oauth-wg/oauth-browser-based-apps/commit/728c360988399d6374f02677ac6202abc447a2f3
*
https://github.com/oauth-wg/oauth-browser-based-apps/commit/95f2ca974bc34fef5b8294000cbb4da5112e1d6c
*
https://github.com/oauth-wg/oauth-browser-based-apps/commit/b6c6f25ba949b268e4d22b57f2cae31f69b905e8
*
https://github.com/oauth-wg/oauth-browser-based-apps/commit/f33b5f02b67de0aea697f4a45a5970e7df7d4b8f

The current preview snapshot is here:

https://drafts.oauth.net/oauth-browser-based-apps/draft-ietf-oauth-browser-based-apps.html

Thanks!

Aaron