[OAUTH-WG] Re: Httpdir last call review of draft-ietf-oauth-browser-based-apps-22
Philippe De Ryck <philippe@pragmaticwebsecurity.com> Sat, 26 April 2025 09:12 UTC
Return-Path: <philippe@pragmaticwebsecurity.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 55ED6217EE1F; Sat, 26 Apr 2025 02:12:02 -0700 (PDT)
X-Virus-Scanned: amavisd-new at ietf.org
X-Spam-Flag: NO
X-Spam-Score: -2.798
X-Spam-Level:
X-Spam-Status: No, score=-2.798 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_LOW=-0.7, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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=pragmaticwebsecurity.com header.b="gV02G3P2"; dkim=pass (2048-bit key) header.d=messagingengine.com header.b="E9Pz0/NQ"
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 WhwpOTginhFR; Sat, 26 Apr 2025 02:12:01 -0700 (PDT)
Received: from fout-a5-smtp.messagingengine.com (fout-a5-smtp.messagingengine.com [103.168.172.148]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-256)) (No client certificate requested) by mail2.ietf.org (Postfix) with ESMTPS id DEC91217EE18; Sat, 26 Apr 2025 02:11:57 -0700 (PDT)
Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfout.phl.internal (Postfix) with ESMTP id 32AD313803DB; Sat, 26 Apr 2025 05:11:57 -0400 (EDT)
Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Sat, 26 Apr 2025 05:11:57 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= pragmaticwebsecurity.com; h=cc:cc:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1745658717; x=1745745117; bh=yxdTEf+1KnnLycrot0rdEf2Q2x+IHEATR598hI4fgXw=; b= gV02G3P2zzVrc6dVHMbiupVueKNoHo5bQtkjNfzW+O7iJ6yF4Yl6sTZsB4q7gY34 SS/vtbGiLxI5koAhg1e8X0hBRB6qicl4yfT/3ADYnZ0xfnrhz1mNTnTPpAse2QlU EhvqXGstNUaXWa63GKjURSEfI8/bWxh9mCyAk1D2pgsuC2hGYZqyDZeTFxLpHDIr hLy6pK+C/ObBWFw/rfABtLxv+RMXPF6hYBOK4D06CySpwyAqenAO7cPlmB91DmeN viuTiR+XA1QfzvSNdAZwvZLpIPeVC2/XS/2htNkAlByui2qMwNI4r1uNvBPNb0Uv VRMPpr0o+9PyTBqgRFvTUQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1745658717; x=1745745117; bh=yxdTEf+1KnnLycrot0rdEf2Q2x+IHEATR59 8hI4fgXw=; b=E9Pz0/NQmqRjZdTiFhf9h9BzXUQUbCdTykzHnvnI2oUIKNqs/82 Jpr8CZbrxGBHUvLhJEY/eJZ9QC6hseWmroBNIHrdo4oSLeNd4an32e0P+NSRMDLC JNgl94LnuAaKvJFc0p595tBfgEa9MqWGT3Z1Ou7GbgutMOcvs54lYVN1EkhrHF5i rR14fIqHivC7XenKGBj3oAVoPWLTC6ZMeTmX17Fd0ca/zL80KjId2VlHJg8zb2tR H4iRvBHKUHYumeha9nIrlsOzoTK0KO2wcW5lSD34KDCb5r+K9TmQ2ty+f8d1xMvQ t+0gjbvg+wpNSY3LhYxXRExOvKvCTDRUdFA==
X-ME-Sender: <xms:XKMMaCSXislqKNuveWp572UC_h5OHu0110YWgVq3ka_MERnw7_KgIg> <xme:XKMMaHzO8ij8koGgN77S44PK6vqCq-4opZ8_VvjtRURigVK6r0iiJ08JdLtzM80xe TSyYUhIHwmMu_Ew5Q>
X-ME-Received: <xmr:XKMMaP2qlW4tQLiERUDagnP_YNWh1hc_K8q0Mo-LoV6LAaHz6xqelT2DbmisTJzMfc0axp0XcYDpUV7nQeaKT_bkerlWKJG0>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvheegkeduucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhephffktgggufffjgevvfhfofesrgdtmherhhdt jeenucfhrhhomheprfhhihhlihhpphgvucffvgcutfihtghkuceophhhihhlihhpphgvse hprhgrghhmrghtihgtfigvsghsvggtuhhrihhthidrtghomheqnecuggftrfgrthhtvghr nhepffekudegheevvdeuhedugfeifefgveelgeekleeigfejveetledvtdeghfdvjefgne cuffhomhgrihhnpehprhgrghhmrghtihgtfigvsghsvggtuhhrihhthidrtghomhenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehphhhilhhiph hpvgesphhrrghgmhgrthhitgifvggsshgvtghurhhithihrdgtohhmpdhnsggprhgtphht thhopeeipdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehmtheslhhofigvnhhtrh hophihrdhnvghtpdhrtghpthhtoheprggrrhhonhesphgrrhgvtghkihdrtghomhdprhgt phhtthhopehivghtfhdqhhhtthhpqdifghesfiefrdhorhhgpdhrtghpthhtohepughrrg hfthdqihgvthhfqdhorghuthhhqdgsrhhofihsvghrqdgsrghsvgguqdgrphhpshdrrghl lhesihgvthhfrdhorhhgpdhrtghpthhtoheplhgrshhtqdgtrghllhesihgvthhfrdhorh hgpdhrtghpthhtohepohgruhhthhesihgvthhfrdhorhhg
X-ME-Proxy: <xmx:XKMMaOCHeNkouiClmO8CdRWI1iVWgt2syA0DR6iBz0zPqmPfBgUgBA> <xmx:XKMMaLjeKKGH8Mp7NiuFb27tUO8iVkgFnVXur9RdkCktju-i_bZ4MQ> <xmx:XKMMaKrABrm3G7-vlTaAzDIsgwiOdb_dufbktQTWYIdnJoI_ikMWtQ> <xmx:XKMMaOhVTlR2jKlnWyEoMBXVWajDQScqLU6T3DlIyoEkrCSUlx3jDQ> <xmx:XaMMaHm1ibUuDzqxCdxK5JYM56Amjr8ZnR9vT9z2xfMQg_KQZxc5BZVw>
Feedback-ID: i21e1449f:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 26 Apr 2025 05:11:55 -0400 (EDT)
From: Philippe De Ryck <philippe@pragmaticwebsecurity.com>
Message-Id: <3070E99E-AA4A-4827-8C81-1061A8ED5678@pragmaticwebsecurity.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_730BBDBA-F3F6-483F-BA31-B38DCFE5A224"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.500.181.1.5\))
Date: Sat, 26 Apr 2025 11:11:53 +0200
In-Reply-To: <51d2f771-3008-4598-8ba9-d4572698ab2a@betaapp.fastmail.com>
To: Martin Thomson <mt@lowentropy.net>
References: <173821815695.1334117.13344663351104754650@dt-datatracker-5584d84fb4-tg2td> <CAGBSGjrv4T3SJNV7NjGc_xm+h_eEWk1o2FzfkQnbuyo+=4AFrA@mail.gmail.com> <51d2f771-3008-4598-8ba9-d4572698ab2a@betaapp.fastmail.com>
X-Mailer: Apple Mail (2.3826.500.181.1.5)
Message-ID-Hash: 2UN5SQ4YL2WRXBVG2N2A7YZGYW7KBMTM
X-Message-ID-Hash: 2UN5SQ4YL2WRXBVG2N2A7YZGYW7KBMTM
X-MailFrom: philippe@pragmaticwebsecurity.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: ietf-http-wg@w3.org, draft-ietf-oauth-browser-based-apps.all@ietf.org, last-call@ietf.org, oauth@ietf.org
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [OAUTH-WG] Re: Httpdir last call review of draft-ietf-oauth-browser-based-apps-22
List-Id: OAUTH WG <oauth.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/bAGc2BcYUGE_enwtBDB0RHT9OTQ>
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>
Hi Martin, I’ve picked in on a few of your comments. > The text is now: > >> A practical implementation pattern can use a Web Worker [WebWorker] to isolate the refresh token, and provide the application with the access token making requests to resource servers. This prevents an attacker from using the application's refresh token to obtain new tokens. > > This all seems to hinge on a web worker being "highly isolated" (see previous paragraph), which I think is overstating it a little. It might be easier to isolate a worker, but you have to acknowledge that compromised main thread JS can install or replace workers. At best, I would say "more isolated" or "more easily isolated". Seems fair, I have updated the text to “more isolated”. >> We've updated all mentions of "perfect storage" to phrases like >> "...even a token storage mechanism that completely isolates the tokens >> from the attacker..." Hopefully this is clearer. > > Indeed it is. Though I still think that "perfectly" and "completely" are a little more absolute than you can justify. None of this stuff is perfect. Just to clarify, the use of perfectly/completely in this context is purely hypothetical to indicate that even if such a mechanism were to exist, it would still not counter the other attack scenarios. The main reason this part is in there, is because a common reaction to hearing about the security limitations is for people to come up with ways to protect the tokens. This often leads to convoluted solutions that do not offer the protections people think they do (and as you point out). And even if they do exist, the attacker can simply request new tokens and completely ignore the tokens stored in the perfect storage solution. > >>> In Section 8.5, please consider de-emphasis of local storage. Browsers have >>> been trying to move people off the jank-inducing API for more than a decade >>> now. Anything that uses storage needs to be asynchronous, local storage isn't. >> >> I added a mention of localStorage being synchronous. > > That's not quite what I was angling for. Your central point is independent of technology/API. It is that if you stick a token in [a store] and you have compromised code running in the same origin anywhere, that code can access the store and get your token. So, rather than talking about specific types of stores (other than listing examples) I would trim the section down to the simpler statement. (sessionStore being somewhat ephemeral is not a useful distinction here, mostly because the idea of "session" is so vague as to be useless: many browsers restore sessions after a restart) In the context of this document, I believe the distinction between different types are needed, precisely for the point explained above. People will naturally go looking for “secure token storage” options, so listing them here ensures they will find an answer to their questions. I did further clarify that IndexedDB is asynchronous and preferred over localStorage. Thank you for taking the time to carefully review this document. Kind regards Philippe — Pragmatic Web Security Security for developers https://pragmaticwebsecurity.com
- [OAUTH-WG] Httpdir last call review of draft-ietf… Martin Thomson via Datatracker
- [OAUTH-WG] Re: Httpdir last call review of draft-… Aaron Parecki
- [OAUTH-WG] Re: Httpdir last call review of draft-… Martin Thomson
- [OAUTH-WG] Re: Httpdir last call review of draft-… Philippe De Ryck