[OAUTH-WG] Re: Browser-Swapping
"Primbs, Jonas" <jonas.primbs@uni-tuebingen.de> Wed, 05 November 2025 15:50 UTC
Return-Path: <jonas.primbs@uni-tuebingen.de>
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 187198390453 for <oauth@mail2.ietf.org>; Wed, 5 Nov 2025 07:50:21 -0800 (PST)
X-Virus-Scanned: amavisd-new at ietf.org
X-Spam-Flag: NO
X-Spam-Score: -4.4
X-Spam-Level:
X-Spam-Status: No, score=-4.4 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_MED=-2.3, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: mail2.ietf.org (amavisd-new); dkim=pass (2048-bit key) header.d=uni-tuebingen.de
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 1iUpuE8NEWSg for <oauth@mail2.ietf.org>; Wed, 5 Nov 2025 07:50:20 -0800 (PST)
Received: from mx03.uni-tuebingen.de (mx03.uni-tuebingen.de [IPv6:2001:7c0:300c:3105::8602:5d5]) (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 mail2.ietf.org (Postfix) with ESMTPS id 4E78A838F59F for <oauth@ietf.org>; Wed, 5 Nov 2025 07:46:43 -0800 (PST)
Received: from exchange.uni-tuebingen.de (ex01.uni-tuebingen.de [134.2.21.161]) by mx03.uni-tuebingen.de (Postfix) with ESMTPS id E24B920BB59F; Wed, 5 Nov 2025 16:46:35 +0100 (CET)
DKIM-Filter: OpenDKIM Filter v2.11.0 mx03.uni-tuebingen.de E24B920BB59F
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uni-tuebingen.de; s=20211202prod; t=1762357595; bh=o3ynNlgM6RKgmt4FraUbviXJwFDEnNe7gtHqg5X1qo4=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=jyLYAiIybsmjXqciYbVXNgQk5qnHZJ9KpgIBbJ1q0Su3SF4gQ4maFJDbG+cOKU0Gm QjMNvQjUiPP2cD8mKa/BiDZNVV9p4ozpVXx9LPH8eTSEdpQd3wRlfo5w1GiXpP+WJp MF0lYZMkhFHL3kgj/tDttxEL56pF/C5SU+RTqyi3RaCI23lm+d85s2+i2ld9vvq4bH kp+8XwG7t3FapnE/JeTR+Hcrt6q5Ej/UfdKeU/MDXhmbkAJCeNHVWJnTNPtf8gP+ow NV2HT29M8CU8vhK7Vceh8puLgLG72ag3WDjDE+DGsHvS08mfJXWQRxSOND8v5bFGsl pUeR22lyA2B8w==
Received: from Ex02.uni-tuebingen.de (134.2.21.162) by EX01.uni-tuebingen.de (134.2.21.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.61; Wed, 5 Nov 2025 16:46:35 +0100
Received: from Ex02.uni-tuebingen.de ([fe80::5ddd:1152:31fc:6bd3]) by EX02.uni-tuebingen.de ([fe80::5ddd:1152:31fc:6bd3%7]) with mapi id 15.01.2507.061; Wed, 5 Nov 2025 16:46:35 +0100
From: "Primbs, Jonas" <jonas.primbs@uni-tuebingen.de>
To: Max Gerber <max=40stytch.com@dmarc.ietf.org>
Thread-Topic: [OAUTH-WG] Browser-Swapping
Thread-Index: AQHcTmtdA47qMeefjEuau0XXhQoMgg==
Date: Wed, 05 Nov 2025 15:46:35 +0000
Message-ID: <B3E27C85-0225-4F11-805A-87E4B9656C69@uni-tuebingen.de>
References: <F032F35A-D55E-40A7-8589-3DD64BF8F7A0@uni-tuebingen.de> <CAMQcq-ZF5QFBELsycQdyQeH8E2kaeCG4P2b=yNtwh=gJRja5hw@mail.gmail.com> <CAEayHEM2kdXNjo=OGUFVZptxzgS+Qv-1b+UK1CXALiKP5ZKF0w@mail.gmail.com> <CAMQcq-YNpBNMx7EhGiCeFGi_cJnS+e_rMwmxhcXeEr6aixS+Tg@mail.gmail.com> <CAEnJ2_XtJsU-XE8ZeKX-n94vz-kpFpWePz+5TFTKu48Znu7jew@mail.gmail.com>
In-Reply-To: <CAEnJ2_XtJsU-XE8ZeKX-n94vz-kpFpWePz+5TFTKu48Znu7jew@mail.gmail.com>
Accept-Language: de-DE, en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3864.200.81.1.6)
x-originating-ip: [134.2.21.181]
Content-Type: multipart/signed; boundary="Apple-Mail=_13381EC5-8E1F-4E8C-8664-5F602F420CAD"; protocol="application/pkcs7-signature"; micalg="sha-256"
MIME-Version: 1.0
Message-ID-Hash: PNJBBCMXOFI2OX444EGTOEARNQ4LJTOU
X-Message-ID-Hash: PNJBBCMXOFI2OX444EGTOEARNQ4LJTOU
X-MailFrom: jonas.primbs@uni-tuebingen.de
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: Frederik Krogsdal Jacobsen <frederik.krogsdal=40criipto.com@dmarc.ietf.org>, oauth <oauth@ietf.org>
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [OAUTH-WG] Re: Browser-Swapping
List-Id: OAUTH WG <oauth.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/EqiUsyEtTyxryc0XA6XvT_nKHrs>
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>
+1 to Max Enforcing a specific response_mode at the AS is much simpler for developers than having to handle query, fragment, and form_post callbacks just in case a downgrade attack happens. If I had seen form_post in the wild, I would assume that the GET endpoint for the redirect URI would not even have been implemented at all, leading to a successful URL sharing attack. PAR reduces this attack vector by shifting the downgrading attack to the backend. However, for frontend-clients this could still be an attack vector. > Am 05.11.2025 um 08:43 schrieb Max Gerber <max=40stytch.com@dmarc.ietf.org>: > > I am also a general fan of extending the revocation endpoint to support authorization codes. > > One snag with that approach - if the attacker downgrades or otherwise manipulates the response mode (e.g. changes it from form_post to query) then there is a significant chance the client will not properly parse out the authorization code, and will not be able to call the revocation endpoint. Clients need to implement redirect handlers for all possible response modes to properly detect the attack - or clients would additionally need to use PAR to prevent manipulation of the response mode by an attacker entirely. > > On Wed, Nov 5, 2025 at 3:38 AM Frederik Krogsdal Jacobsen <frederik.krogsdal=40criipto.com@dmarc.ietf.org <mailto:40criipto.com@dmarc.ietf.org>> wrote: >> On Wed, 5 Nov 2025 at 11:13, Thomas Broyer <t.broyer@gmail.com <mailto:t.broyer@gmail.com>> wrote: >>>> It seems to me that your suggestion 3 could be implemented by the client by simply exchanging the code and throwing away the token response when the initial CSRF is detected. >>> >>> That's what I was thinking as well, but also immediately revoking the token, not just throwing it away, to be extra-safe. >> >> Sure, if the AS implements RFC 7009, but otherwise I don't think this is possible for the client to do? >> >>>> I also know that in practice, some AS implementers allow multiple uses of the code, >>> >>> 😱 Do you have names? >> >> Quickly searching "authorization code reuse", I got several results on the first page. E.g. Azure AD B2C allowed this at least until the end of last year (and maybe still does) [1,2]. >> Usually the argument for allowing it is something along the lines of "keeping state in a distributed system is too hard," e.g. [3]. >> Sometimes the impact is mitigated by using e.g. the OIDC nonce value. >> >>>> so it may be interesting to look into defining a specific "cancel request" that uses up a code without returning a token. >>>> Defining such a request might also make the approach easier to explain. >>>> In fact, many OIDC providers already define custom "cancel" requests to mitigate phishing. A "cancel" request might also be useful for OpenID CIBA [1]. >>> >>> I see no reason why the revocation endpoint couldn't support revoking authorization codes as well (that would need to be spec'd, and then implemented, and deployed; so in the meantime: exchange the code for a token, and immediately revoke it, assuming –because that's how it MUST be– the authorization code is single-use) >> >> I agree that extending the revocation endpoint is probably the way forward when the client detects CSRF. >> In the meantime, exchanging the code and immediately revoking (if possible), then throwing away the token should be a quick way to mitigate the attack. >> It might be worth mentioning this approach in OAuth 2.1? >> >> Cheers, >> Frederik >> >> [1]: https://learn.microsoft.com/en-us/answers/questions/1179021/how-to-prevent-reuse-of-oauth-authorization-code >> [2]: https://learn.microsoft.com/en-sg/answers/questions/2131783/invalidate-authorization-code-after-use >> [3]: https://github.com/kanidm/kanidm/issues/2775 >> _______________________________________________ >> OAuth mailing list -- oauth@ietf.org <mailto:oauth@ietf.org> >> To unsubscribe send an email to oauth-leave@ietf.org <mailto:oauth-leave@ietf.org> > _______________________________________________ > OAuth mailing list -- oauth@ietf.org > To unsubscribe send an email to oauth-leave@ietf.org
- [OAUTH-WG] Browser-Swapping Primbs, Jonas
- [OAUTH-WG] Re: Browser-Swapping Neil Madden
- [OAUTH-WG] Re: Browser-Swapping Primbs, Jonas
- [OAUTH-WG] Re: Browser-Swapping Neil Madden
- [OAUTH-WG] Re: Browser-Swapping Primbs, Jonas
- [OAUTH-WG] Re: Browser-Swapping Dick Hardt
- [OAUTH-WG] Re: Browser-Swapping Primbs, Jonas
- [OAUTH-WG] Re: Browser-Swapping Filip Skokan
- [OAUTH-WG] Re: Browser-Swapping Primbs, Jonas
- [OAUTH-WG] Re: Browser-Swapping Filip Skokan
- [OAUTH-WG] Re: Browser-Swapping Primbs, Jonas
- [OAUTH-WG] Re: Browser-Swapping Warren Parad
- [OAUTH-WG] Re: Browser-Swapping Primbs, Jonas
- [OAUTH-WG] Re: Browser-Swapping Neil Madden
- [OAUTH-WG] Re: Browser-Swapping Warren Parad
- [OAUTH-WG] Re: Browser-Swapping Primbs, Jonas
- [OAUTH-WG] Re: Browser-Swapping Primbs, Jonas
- [OAUTH-WG] Re: Browser-Swapping Vladimir Dzhuvinov | Connect2id
- [OAUTH-WG] Re: Browser-Swapping Filip Skokan
- [OAUTH-WG] Re: Browser-Swapping Frederik Krogsdal Jacobsen
- [OAUTH-WG] Re: Browser-Swapping Thomas Broyer
- [OAUTH-WG] Re: Browser-Swapping Frederik Krogsdal Jacobsen
- [OAUTH-WG] Re: Browser-Swapping Max Gerber
- [OAUTH-WG] Re: Browser-Swapping Primbs, Jonas
- [OAUTH-WG] Re: Browser-Swapping Primbs, Jonas
- [OAUTH-WG] Re: Browser-Swapping Frederik Krogsdal Jacobsen
- [OAUTH-WG] Re: Browser-Swapping Primbs, Jonas
- [OAUTH-WG] Re: Browser-Swapping Philippe De Ryck
- [OAUTH-WG] Re: Browser-Swapping Warren Parad
- [OAUTH-WG] Re: Browser-Swapping Primbs, Jonas
- [OAUTH-WG] Re: Browser-Swapping Primbs, Jonas
- [OAUTH-WG] Re: Browser-Swapping Tim Würtele
- [OAUTH-WG] Re: Browser-Swapping Neil Madden
- [OAUTH-WG] Re: Browser-Swapping Max Gerber
- [OAUTH-WG] Re: Browser-Swapping Warren Parad
- [OAUTH-WG] Re: Browser-Swapping Primbs, Jonas
- [OAUTH-WG] Re: Browser-Swapping Aaron Parecki
- [OAUTH-WG] Re: Browser-Swapping Neil Madden
- [OAUTH-WG] Re: Browser-Swapping Aaron Parecki
- [OAUTH-WG] Re: Browser-Swapping Frederik Krogsdal Jacobsen
- [OAUTH-WG] Re: Browser-Swapping Warren Parad
- [OAUTH-WG] Re: Browser-Swapping Frederik Krogsdal Jacobsen
- [OAUTH-WG] Re: Browser-Swapping Warren Parad
- [OAUTH-WG] Re: Browser-Swapping Frederik Krogsdal Jacobsen
- [OAUTH-WG] Re: Browser-Swapping Warren Parad
- [OAUTH-WG] Re: Browser-Swapping Philippe De Ryck
- [OAUTH-WG] Re: Browser-Swapping Thomas Broyer
- [OAUTH-WG] Re: Browser-Swapping Primbs, Jonas
- [OAUTH-WG] Re: Browser-Swapping Thomas Broyer
- [OAUTH-WG] Re: Browser-Swapping Logan Widick
- [OAUTH-WG] Re: Browser-Swapping Primbs, Jonas
- [OAUTH-WG] Re: Browser-Swapping kcloud
- [OAUTH-WG] Re: Browser-Swapping Primbs, Jonas
- [OAUTH-WG] Re: Browser-Swapping Logan Widick
- [OAUTH-WG] Re: Browser-Swapping Primbs, Jonas
- [OAUTH-WG] Re: Browser-Swapping Primbs, Jonas
- [OAUTH-WG] Re: Browser-Swapping Warren Parad
- [OAUTH-WG] Re: Browser-Swapping Primbs, Jonas
- [OAUTH-WG] Re: Browser-Swapping Warren Parad
- [OAUTH-WG] Re: Browser-Swapping Aaron Parecki
- [OAUTH-WG] Re: Browser-Swapping Warren Parad
- [OAUTH-WG] Re: Browser-Swapping Primbs, Jonas
- [OAUTH-WG] Re: Browser-Swapping Warren Parad
- [OAUTH-WG] Re: Browser-Swapping Primbs, Jonas
- [OAUTH-WG] Re: Browser-Swapping Primbs, Jonas
- [OAUTH-WG] Re: Browser-Swapping Max Gerber
- [OAUTH-WG] Re: Browser-Swapping Primbs, Jonas
- [OAUTH-WG] Re: Browser-Swapping Will Bartlett
- [OAUTH-WG] Re: Browser-Swapping Primbs, Jonas