Re: [OAUTH-WG] New Version Notification for draft-fett-oauth-dpop-03.txt

Neil Madden <neil.madden@forgerock.com> Sun, 24 November 2019 07:40 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 9E2E8120121 for <oauth@ietfa.amsl.com>; Sat, 23 Nov 2019 23:40:56 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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 aVEQEhD2zZkz for <oauth@ietfa.amsl.com>; Sat, 23 Nov 2019 23:40:53 -0800 (PST)
Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) (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 7BF5C1200B8 for <oauth@ietf.org>; Sat, 23 Nov 2019 23:40:53 -0800 (PST)
Received: by mail-wm1-x32e.google.com with SMTP id n5so2144962wmc.0 for <oauth@ietf.org>; Sat, 23 Nov 2019 23:40:53 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=forgerock.com; s=google; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=upPrEufNSOeSG1OR0aNjUGS85O3ieqwc+zmC9Ezo5GU=; b=h0YHul2Fe3A6KGiXbQ+0wrsU+ZKKLHeQRTGQwhsUwA4fQFnzO2lzQ+iNdmOx+SFqxE UFf9kAkdBEmoK1W3pfe8Bttt4AsO8eAhhou3ANRyTUbPxecFvJrAYZzoCO2WwKCGtGOS TjmMzEYSs7Y08zxmoebl5yOEILNMx3BOeTZkc=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=upPrEufNSOeSG1OR0aNjUGS85O3ieqwc+zmC9Ezo5GU=; b=aB7vmDLKK9UZ0qztVIQjV7WIVa5CGbm72VVwYqFBatIKUXH7iudAJI8NnPoTmcJtQt bN692IRcF8qtzARzS8LkZBLuras2pGWHHdtmJ2AjaNyrYkKdu5RH0In5NhNLJ8jBiWy8 BDRQdYHrw/RTH7PriqihJ5EEmHQY8S+qjUUNuq30tStONvK08gvg5jlJL346zx+Jqkw2 BFjm5xOLcRWapwTR3pKiyXdwoRGTvZGcKLW2nsJQVUME1FA3ps1kznIVc73JzBuJz0eM JBAuTL2U+XUhHSg3ihpuxIBDTRjoGzRKsURxkiqHJE8IeGh/Zi3GI9ihELlr+MHFxE70 pMoQ==
X-Gm-Message-State: APjAAAVCwl2f/WG1BF6GtNnQIjncEQn3grEKYx50eMZ8YVKgb5DDRt5M uGAVjONrxmFSYDiYGsDIFDj+jw==
X-Google-Smtp-Source: APXvYqzcv76lnXXt/K0whq1w+tjuaw55qhg06VvuCwnWV0Y6MGv+friuEcFdeQwubqMS3XPYFhDUTg==
X-Received: by 2002:a1c:41c2:: with SMTP id o185mr22488455wma.34.1574581251589; Sat, 23 Nov 2019 23:40:51 -0800 (PST)
Received: from ?IPv6:2a01:4c8:1e:a0cd:ec52:ae7:a130:6e65? ([2a01:4c8:1e:a0cd:ec52:ae7:a130:6e65]) by smtp.gmail.com with ESMTPSA id e19sm3900422wme.6.2019.11.23.23.40.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 23 Nov 2019 23:40:50 -0800 (PST)
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
From: Neil Madden <neil.madden@forgerock.com>
Mime-Version: 1.0 (1.0)
Date: Sun, 24 Nov 2019 07:40:49 +0000
Message-Id: <4183FBCD-5511-49FF-BE59-25EE16A34CB7@forgerock.com>
References: <5C0676D0-B8AB-48DC-9265-3BB38B442815@lodderstedt.net>
Cc: Justin Richer <jricher@mit.edu>, oauth <oauth@ietf.org>
In-Reply-To: <5C0676D0-B8AB-48DC-9265-3BB38B442815@lodderstedt.net>
To: Torsten Lodderstedt <torsten@lodderstedt.net>
X-Mailer: iPhone Mail (17A878)
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/nT-lii2E4_aKhmwrL2xd_RsvL-8>
Subject: Re: [OAUTH-WG] New Version Notification for draft-fett-oauth-dpop-03.txt
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: Sun, 24 Nov 2019 07:41:00 -0000

On 22 Nov 2019, at 13:33, Torsten Lodderstedt <torsten@lodderstedt.net> wrote:
> 
> Hi Neil,
> 
>> On 22. Nov 2019, at 20:50, Neil Madden <neil.madden@forgerock.com> wrote:
>> 
>> Hi Torsten,
>> 
>>> On 22 Nov 2019, at 12:15, Torsten Lodderstedt <torsten@lodderstedt.net> wrote:
>>> 
>>> Hi Neil,
>>> 
>>>> On 22. Nov 2019, at 18:08, Neil Madden <neil.madden@forgerock.com> wrote:
>>>> 
>>>> I think the phrase "token replay" is ambiguous. Traditionally it refers to an attacker being able to capture a token (or whole requests) in use and then replay it against the same RS. This is already protected against by the use of normal TLS on the connection between the client and the RS. I think instead you are referring to a malicious/compromised RS replaying the token to a different RS - which has more of the flavour of a man in the middle attack (of the phishing kind).
>>> 
>>> I would argue TLS basically prevents leakage and not replay.
>> 
>> It also protects against replay. If you capture TLS-encrypted packets with Wireshark you not only cannot decipher them but also cannot replay them because they include specific anti-replay measures at the record level in the form of unique session keys and record sequence numbers included in the MAC calculations. This is essential to the security of TLS.
> 
> I understand. I was looking onto TLS from an application perspective, that might explain differing perception.
> 
>> 
>>> The threats we try to cope with can be found in the Security BCP. There are multiple ways access tokens can leak, including referrer headers, mix-up, open redirection, browser history, and all sorts of access token leakage at the resource server
>>> 
>>> Please have a look at https://tools.ietf.org/html/draft-ietf-oauth-security-topics-13#section-4.
>>> 
>>> https://tools.ietf.org/html/draft-ietf-oauth-security-topics-13#section-4.8 also has an extensive discussion of potential counter measures, including audience restricted access tokens and a conclusion to recommend sender constrained access tokens over other mechanisms.
>> 
>> OK, good - these are threats beyond token replay (at least as I understand that term). It would be good to explicitly add them to the DPoP document motivation.
>> 
>> Note that most of these ways that an access token can leak also apply equally to leak of the DPoP JWT, so the protection afforded by DPoP boils down to how well the restrictions encoded into the JWT prevent it from being reused in this case - e.g., restricting the expiry time, audience, scope, linking it to a specific request (htm/htu) etc. 
>> 
>> Every single one of those restrictions can be equally well encoded as caveats on a macaroon access token without any need for public key signatures or additional tokens and headers.
>> 
>>>> But if that's the case then there are much simpler defences than those proposed in the current draft:
>>>> 
>>>> 1. Get separate access tokens for each RS with correct audience and scopes. The consensus appears to be that this is hard to do in some cases, hence the draft.
>>> 
>>> How many deployments do you know that today are able to issue RS-specific access tokens?
>>> BTW: how would you identify the RS?
>>> 
>>> I agree that would be an alternative and I’m a great fan of such tokens (and used them a lot at Deutsche Telekom) but in my perception this pattern needs still to be established in the market. Moreover, they basically protect from a rough RS (if the URL is used as audience) replaying the token someplace else, but they do not protect from all other kinds of leakage/replay (e.g. log files).
>> 
>> Many services already do this. For example, Google encodes the intended RS into the scopes on GCP (https://developers.google.com/identity/protocols/googlescopes). A client can do a single authorization flow to authorize all the scopes it needs and then use repeated calls to the refresh token endpoint to obtain individual access tokens with subsets of the authorized scopes for each endpoint.
> 
> And that works at google? How does the client indicate the RS it wants to use the first access token (that is obtains in the course of the code exchange)?

It doesn’t. The initial access token would be for all scopes and the client simply discards that one (or revokes it if the AS supports revoking individual tokens). 

>> (I think Brian also mentioned this pattern at OSW, but it might have been somebody else).
> 
> I know the pattern and we used this at Deutsche Telekom, but I don’t know any other deployment utilising this pattern. In my observation, most people treat access tokens as cookies and use them across RSs. Another reason might be that, before resource indicators, there was no interoperable way to ask for a token for a certain RS.

I don’t know anybody using DPoP either. The point is that you can do this kind of thing right now, so DPoP needs to have a stronger justification for why this isn’t sufficient.

>>>> 2. Make the DPoP token be a simple JWT with an "iat" and the origin of the RS. This stops the token being reused elsewhere but the client can reuse it (replay it) for many requests.
>>>> 3. Issue a macaroon-based access token and the client can add a correct audience and scope restrictions at the point of use.
>>> 
>>> Why is this needed if the access token is already audience restricted? Or do you propose this as alternative? 
>> 
>> These are all alternatives. Any one of them prevents the specific attack of replay by the RS to another RS.
> 
> And which does for replay with the same RS?

TLS. 

— Neil