Re: [OAUTH-WG] Token Mediating and session Information Backend For Frontend (TMI BFF)

Neil Madden <neil.madden@forgerock.com> Mon, 15 February 2021 10:50 UTC

Return-Path: <neil.madden@forgerock.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 58E713A1133 for <oauth@ietfa.amsl.com>; Mon, 15 Feb 2021 02:50:56 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.198
X-Spam-Level:
X-Spam-Status: No, score=-0.198 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=forgerock.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vrkrv1KIQDzq for <oauth@ietfa.amsl.com>; Mon, 15 Feb 2021 02:50:54 -0800 (PST)
Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 56E0C3A1137 for <oauth@ietf.org>; Mon, 15 Feb 2021 02:50:54 -0800 (PST)
Received: by mail-wm1-x331.google.com with SMTP id x4so8888534wmi.3 for <oauth@ietf.org>; Mon, 15 Feb 2021 02:50:54 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=forgerock.com; s=google; h=from:mime-version:subject:date:message-id:references:cc:in-reply-to :to:content-transfer-encoding; bh=uzg1Dg+pEpiYyoDgB0gGFEk2ibng8y2luzfIJ5GxG4o=; b=cBLYbR+aNisQosYrLk1bwRoAXxPol2RBEWirk2l4gmiME6WizsBTLRvUW20dN/M1Rv WUtytmg3bOVAc9Dai3kkrF6zYoNRYXRKIkL63/q2jhpg/Zq/K01+MTKP3szrvW3yFey9 B1DN32lBo9pGF6ecclgqOcSKCasjx+iCSJu8A=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to:content-transfer-encoding; bh=uzg1Dg+pEpiYyoDgB0gGFEk2ibng8y2luzfIJ5GxG4o=; b=fFEcq9BrS3Azb+2u0EdhduarDXcOkxAVdtXKv9VA/Cya2ha4oJPkmtcpz7jjljlQhi 2Ok67N/AtCWxk2EYw4UPu6eDNuH0/fU3R3Yk/TO/VG/NHiUjkoDflOy76Mkwu4uw4Gyv C8XgRO0RKWSAnj8Al4gub0DCcqDz8fQI78DHxrI0VGV0lzr/jRWUOJq++DfrJ3qWwLB2 OpSoPyNtQomFu6w5adPUJRq3GvEEe49IyaR35rCCvuRRu7otsT94J+WbyikSbGsjgCOk y1VwxWzM43HTlgmqism/pxqUHpyRRzJUlyqZN0ZbFHVPKynCLpWZXTA4+dNk4K9P87L3 LS1A==
X-Gm-Message-State: AOAM530kkfNTN5bbO6IfZQZVf3FLQw/N0f0+Z1rdWiTift32qQdyIcVQ lznwLAXxxha1dBZ5cCh7WIpVF0aYeQCW+xKB6ZKH8K/bwFEGZv+Ba5e1uSymOthL6xQOqPyz8w= =
X-Google-Smtp-Source: ABdhPJxar/8+ZwRfH4nUdT5ZndT8TvrAqepX4A6ZFTLRBXCZZtoSRi1Sr/i8SuUAhvCtxdxHyf83RA==
X-Received: by 2002:a1c:1dcc:: with SMTP id d195mr14200032wmd.42.1613386252528; Mon, 15 Feb 2021 02:50:52 -0800 (PST)
Received: from [10.0.0.2] (252.207.159.143.dyn.plus.net. [143.159.207.252]) by smtp.gmail.com with ESMTPSA id j14sm18779049wru.43.2021.02.15.02.50.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 Feb 2021 02:50:52 -0800 (PST)
From: Neil Madden <neil.madden@forgerock.com>
Mime-Version: 1.0 (1.0)
Date: Mon, 15 Feb 2021 10:50:51 +0000
Message-Id: <072DEFFF-134E-4946-9CAD-35EA12DEC802@forgerock.com>
References: <2FBBB341-B8FB-4CAA-B1F1-5CC16AB47857@pragmaticwebsecurity.com>
Cc: Vittorio Bertocci <vittorio.bertocci@auth0.com>, oauth@ietf.org
In-Reply-To: <2FBBB341-B8FB-4CAA-B1F1-5CC16AB47857@pragmaticwebsecurity.com>
To: Philippe De Ryck <philippe@pragmaticwebsecurity.com>
X-Mailer: iPhone Mail (18C66)
Content-Type: multipart/alternative; boundary="Apple-Mail-27C87F9C-9256-437F-AF8A-37DE54F8B732"
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/1VkLPRqpIxraUbDrKJ9uaThTCek>
Subject: Re: [OAUTH-WG] Token Mediating and session Information Backend For Frontend (TMI BFF)
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.29
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, 15 Feb 2021 10:50:56 -0000


> On 15 Feb 2021, at 10:26, Philippe De Ryck <philippe@pragmaticwebsecurity.com> wrote:
> 
> 
> 
>>> On 15 Feb 2021, at 11:14, Neil Madden <neil.madden@forgerock.com> wrote:
>>> 
>>>> On 15 Feb 2021, at 08:32, Philippe De Ryck <philippe@pragmaticwebsecurity.com> wrote:
>>>> 
>>> [...]
>>> 
>>> Compared to using a worker for handling RTs, I believe the TMI-BFF only adds a single security benefit: an attacker is no longer able to run a silent flow to obtain a fresh set of tokens (since the client is now a confidential client). 
>> 
>> But they can just call the bff-token endpoint to do the same. If there is a security advantage, IMO it is as a defence in depth against open redirects, unicode normalisation attacks (ie not validating the redirect_uri correctly at the AS), etc. 
> 
> A Web Worker and the TMI-BFF both encapsulate the RT and only expose the (short-lived) AT.

I don’t think this distinction matters at all from a security point of view. It’s the AT that attackers are after - why bother with a RT if I can just call the bff-token endpoint to get a new AT every time?

> 
> With the worker-based approach, the client is a public client that completes the code exchange without authentication. This allows an attacker to run an independent silent flow in an iframe within the legitimate application. This flow relies on the existing cookie-based session with the AS to obtain an AT and RT, independent of the tokens of the client application. A confidential client does not suffer from this problem (a stolen code cannot be exchanged without client authN, and when done through the BFF, the RT is not exposed). 
> 
> And as you state, there are other benefits as well.
> 
> Philipp
> 
> —
> Pragmatic Web Security
> Security for developers
> https://pragmaticwebsecurity.com/

-- 
ForgeRock values your Privacy <https://www.forgerock.com/your-privacy>