[OAUTH-WG] Re: PKCE RFC 7636 and registered URLs

David Waite <david@alkaline-solutions.com> Tue, 01 October 2024 20:45 UTC

Return-Path: <david@alkaline-solutions.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 7036AC180B60 for <oauth@ietfa.amsl.com>; Tue, 1 Oct 2024 13:45:30 -0700 (PDT)
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, HTML_MESSAGE=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, 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=alkaline-solutions.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 9aP2nIlTi4ho for <oauth@ietfa.amsl.com>; Tue, 1 Oct 2024 13:45:26 -0700 (PDT)
Received: from mail.alkaline-solutions.com (caesium6.alkaline.solutions [157.230.133.164]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B9E3CC1519B6 for <oauth@ietf.org>; Tue, 1 Oct 2024 13:45:26 -0700 (PDT)
From: David Waite <david@alkaline-solutions.com>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alkaline-solutions.com; s=dkim; t=1727815525; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=TF+xLAPJCl4xamQB3u7Pzu4qnSs8nFWEWmIQpgwCzNI=; b=N0BsD/yU/5KMpgmN0wsu4jGRXIudNVdiZV2kGF3IHOEiq8BFM3+ZX6osX66GtNfVZ1KVdt YtqRP7QmSG9X57znFX/cXN4NSNTTUK0B7fe/dNtazxCTJrDxqTiPe2TSRVRzdOg2VEcXRr 1Z3bhRuRHLGtFPv+Q31WfgfTS/00IZmnxSKdClqcVlGb1z002g/Yw98fFStIxdIKBcPUxE sElHZGO/UU7QZI+rw0XcfTEKmhn7GlP7qoU7LmyqL40211jFDnHOzdOUhEq3fzXEh7T7uG gNESOTeL23Sukelr3sudOp20Nt8PkvFhgdg1xYbyxKRvsfS0lxyvKd487GdvMA==
Authentication-Results: mail.alkaline-solutions.com; auth=pass smtp.mailfrom=david@alkaline-solutions.com
Message-Id: <28CC0B6A-4A52-48B5-9945-AC4D90A8F76B@alkaline-solutions.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_28985463-4B0F-44E1-81F9-4DE173F50BA5"
Mime-Version: 1.0
Date: Tue, 01 Oct 2024 14:45:21 -0600
In-Reply-To: <BE1P281MB20975E312A88C8E888F6C0ACED772@BE1P281MB2097.DEUP281.PROD.OUTLOOK.COM>
To: axel.nennker@telekom.de
References: <CAMtUnc4dr68yohygY4eqEwEVNtgv5Fx2uj-=oFZ3gRRmyEvp=g@mail.gmail.com> <AB5BD5B8-1D82-451E-8F22-61DA8D02A3F3@gmail.com> <A10707A6-9E53-49AC-A33E-B90FEAD6E08A@authlete.com> <CAMtUnc4ajouz-a45Y+gLv8hffnABBb0TwgdDkUCO5HqRZOQK0g@mail.gmail.com> <BE1P281MB20975E312A88C8E888F6C0ACED772@BE1P281MB2097.DEUP281.PROD.OUTLOOK.COM>
X-Spamd-Bar: --
Message-ID-Hash: GN22XPHMI3VHGIYKVJVELYO2DQ4TOVMN
X-Message-ID-Hash: GN22XPHMI3VHGIYKVJVELYO2DQ4TOVMN
X-MailFrom: david@alkaline-solutions.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: oauth@ietf.org, nat@sakimura.org
X-Mailman-Version: 3.3.9rc4
Precedence: list
Subject: [OAUTH-WG] Re: PKCE RFC 7636 and registered URLs
List-Id: OAUTH WG <oauth.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/SjlrMHjPH1zDr_gJyk3MV4fXwJ0>
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>


> On Oct 1, 2024, at 3:44 AM, axel.nennker@telekom.de wrote:
> 
> Hi,
>  
> is this sentence in the introduction of RFC 7636 <https://datatracker.ietf.org/doc/html/rfc7636> still true?
> “The Redirection Endpoint URI in this case typically uses a custom URI
>    scheme.”

I would say this is still true in the market, although it does not constitute advice or best practices.

The mechanism to support terminating an ASWebAuthenticationSession via host-and-path rather than via custom scheme was added in 17.4 (March). I believe the tab created by this API does not dispatch Custom URI nor universal links to the OS for resolution, so there is not the same risk profile from malicious apps.

On the Android side, play services support for Lollipop (the last release without app link support) ended in July.  I don’t think you have the same expectations around protections from URI scheme hijacking with custom tabs, however.

I would expect on both platforms, client best practice would be to support both Custom URI and claimed https URI, with apps choosing one or the other dependent on the system they are running on. If I were to look at metrics there however, I would expect both platforms to drop below 10% usage of the Custom URI endpoint over the next 12 months - Android is probably close if not there already.

> Is the word “typically” still true nine years after rfc7636 was written?

I don’t personally think it matters. The description of using Custom URI scheme in the introduction doesn’t serve as a recommendation to do so, but rather to illustrate the potential attacks that the document is attempting to alleviate.  It is there to justify need.

PKCE usage has increased with draft-ietf-oauth-security-topics - it is now considered to be appropriate for an AS to require for all clients and not just certain native clients. I would expect an update/replacement for 7636 to emphasize appropriateness for these other applications.

>  
> I suggest removing the word “typically” in the introduction and adding a security section that recommends registering the mobile app for an URL.
>  
> 7.6 Registering the mobile app for an URL
> Major operating systems and app store management systems allow the registration of an URL to a mobile app.
> With an URL registered to the mobile app an attacker cannot register their malicious app for the same URL as the mobile app.
> It is RECOMMENDED that the developer of the mobile app binds the app to an URL.

I think this would instead belong in a document aiming to update/obsolete 8252 - but I believe that document already has plenty of text around claimed HTTP URI and Custom URI schemes.

> Also, I am wondering why this mechanism is not mentioned in https://datatracker.ietf.org/doc/draft-parecki-oauth-first-party-apps/

First party apps is primarily proposed as a way to do authentication with native UI rather than through an external user-agent. So think of it as a third option for a percentage of clients which are trusted by the AS.

-DW