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

Torsten Lodderstedt <torsten@lodderstedt.net> Sat, 23 November 2019 17:50 UTC

Return-Path: <torsten@lodderstedt.net>
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 6F11E1201AA for <oauth@ietfa.amsl.com>; Sat, 23 Nov 2019 09:50:41 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 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] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=lodderstedt.net
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 KcVvOu86OKs0 for <oauth@ietfa.amsl.com>; Sat, 23 Nov 2019 09:50:37 -0800 (PST)
Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) (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 7D4D31200E0 for <oauth@ietf.org>; Sat, 23 Nov 2019 09:50:37 -0800 (PST)
Received: by mail-wr1-x42d.google.com with SMTP id t1so12471805wrv.4 for <oauth@ietf.org>; Sat, 23 Nov 2019 09:50:37 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lodderstedt.net; s=google; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=X+7+5zSlABc6C0a2w/X2uNnuLOxZG4DAAXtvYOAbw3s=; b=WJsAW/QTBrwzSKhkJjPNN0/Ns2yTdbhkyLUegYTneYSZ6HuLL6eH0MakPJvuWh1Lk2 nCn691ZaCdqAvcRq7n+P8+D5fdubcHT5znOc5ywPCzseF3VJwuGRR1sVRsbKQUivUTv2 erSfSs0+grTg0HvAfCKULaBp9j+ZdUh7eMwe/X+3bPzCT/fdCR49YP+V6fv8Ib0TFoVy hIhHfBvO1Kys6q6ToRtTaM0BAOTQFaQ1n7V3ctxD3+n7w4MAChiyU86I7I+e2omcZ4U7 EvvNvZEqQBLp9Sx5WUX5HcLtBtm1GVz/L8BM7RX1ebacj6i1aCu4WgcVO291ZiEktLf6 DZvA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=X+7+5zSlABc6C0a2w/X2uNnuLOxZG4DAAXtvYOAbw3s=; b=BPrG53IXUKKwgFruib3dvf7v93mqHlbOiva/zQvuctAfNEayepsJXvM1R3MMghbbpW 4PzELAaCU6vAJOI10A721NTuGJkPfb1aAbahpcZvv5WGNnGF8XrSbJRb9Hz3WqNVuAAh TLSuUwEGEQJsXzjLfJv02/WiHS9d2aE7TggfGb7AQTikO5HGCUY7eKspb5Wg+h3NS6gB hVWtRX8Ert/uQdwuUABPErFUlKJj8xiorJZfRbgWogh22bpNDvtsC7Khngyo3f+T3fgL 4BlHTLV1XuZGOeqh7HM59gLqZBsuDiHXC4ZMLrZhpCxRLUWGPfdmI4ijr5BAYGkhBPj3 3uTw==
X-Gm-Message-State: APjAAAX+6CmJRFeYYry2jMxTjbuWsHCYRn19nJ+JXUJWWT7BbQyR+W56 KqHpU1AxPBnKi+bH3g6I2sfscIvDDr3RNenP
X-Google-Smtp-Source: APXvYqzYzCrZs1kX8GjA6MzC79jInn/XUq37ac5Yz0QLejAJvLvFuUlPZZxC07nd59pbMwqxyxyfmQ==
X-Received: by 2002:adf:82cc:: with SMTP id 70mr22044637wrc.231.1574531435788; Sat, 23 Nov 2019 09:50:35 -0800 (PST)
Received: from [192.168.71.123] (p549EE7F4.dip0.t-ipconnect.de. [84.158.231.244]) by smtp.gmail.com with ESMTPSA id m1sm2980507wrv.37.2019.11.23.09.50.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Nov 2019 09:50:34 -0800 (PST)
From: Torsten Lodderstedt <torsten@lodderstedt.net>
Message-Id: <7C62B4D3-6708-442A-BFBC-87825D71CA57@lodderstedt.net>
Content-Type: multipart/signed; boundary="Apple-Mail=_09613664-D2DD-4654-AD8F-9FBBFD9FA062"; protocol="application/pkcs7-signature"; micalg="sha-256"
Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3601.0.10\))
Date: Sun, 24 Nov 2019 01:50:23 +0800
In-Reply-To: <0DBB5D3D-025C-4226-856F-C06907E28A6E@amazon.com>
Cc: "Richard Backman, Annabelle" <richanna=40amazon.com@dmarc.ietf.org>, oauth <oauth@ietf.org>
To: Annabelle Backman <richanna@amazon.com>
References: <2EF412B8-AF8C-4642-9BE0-1B528B0C63D5@amazon.com> <288343F2-ACF0-43E0-8577-26AF45330E5C@forgerock.com> <CAD9ie-u_SM+1hRuBWR7zBGSi4Ex59Ht0SzoVTeFuWTRc3cFJXw@mail.gmail.com> <6DECA422-AACC-4DAA-8CD2-FF57CE02DE3E@mit.edu> <0235F8A2-83C4-4804-8805-F50305E263BB@lodderstedt.net> <D43D3929-F1B7-4A2C-ABEC-1326F3F0926C@forgerock.com> <1FD6E2DF-013A-4F42-862B-ADEF45EAE689@lodderstedt.net> <D6F0034F-7F70-442C-8334-733359DE44A9@amazon.com> <36707A3C-788D-4ACF-AAEF-35582BFB89B7@lodderstedt.net> <8E53499A-C2E1-4FE6-AE9B-BE8C582BECD1@amazon.com> <542F255E-FE31-4905-9253-7296FC7BEE87@lodderstedt.net> <0DBB5D3D-025C-4226-856F-C06907E28A6E@amazon.com>
X-Mailer: Apple Mail (2.3601.0.10)
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/MFt6K1QDKwCsDMiBAQrZiC71avo>
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: Sat, 23 Nov 2019 17:50:41 -0000


> On 23. Nov 2019, at 00:34, Richard Backman, Annabelle <richanna@amazon.com> wrote:
> 
>> how are cookies protected from leakage, replay, injection in a setup like this?
> They aren’t.

Thats very interesting when compared to what we are discussing with respect to API security. 

It effectively means anyone able to capture a session cookie, e.g. between TLS termination point and application, by way of an HTML injection, or any other suitable attack is able to impersonate a legitimate user by injecting the cookie(s) in an arbitrary user agent. The impact of such an attack might be even worse than abusing an access token given the (typically) broad scope of a session.

TLS-based methods for sender constrained access tokens, in contrast, prevent this type of replay, even if the requests are protected between client and TLS terminating proxy, only. Ensuring the authenticity of the client certificate when forwarded from TLS terminating proxy to service, e.g. through another authenticated TLS connection, will even prevent injection within the data center/cloud environment. 

I come to the conclusion that we already have the mechanism at hand to implement APIs with a considerable higher security level than what is accepted today for web applications. So what problem do we want to solve?

> But my primary concern here isn't web browser traffic, it's calls from services/apps running inside a corporate network to services outside a corporate network (e.g., service-to-service API calls that pass through a corporate TLS gateway).

Can you please describe the challenges arising in these settings? I assume those proxies won’t support CONNECT style pass through otherwise we wouldn’t talk about them.

> 
>> That’s a totally valid point. But again, such a solution makes the life of client developers harder. 
>> I personally think, we as a community need to understand the pros and cons of both approaches. I also think we have not even come close to this point, which, in my option, is the prerequisite for making informed decisions.
> 
> Agreed. It's clear that there are a number of parties coming at this from a number of different directions, and that's coloring our perceptions. That's why I think we need to nail down the scope of what we're trying to solve with DPoP before we can have a productive conversation how it should work.

We will do so.

> 
> – 
> Annabelle Richard Backman
> AWS Identity
> 
> 
> On 11/22/19, 10:51 PM, "Torsten Lodderstedt" <torsten@lodderstedt.net> wrote:
> 
> 
> 
>> On 22. Nov 2019, at 22:12, Richard Backman, Annabelle <richanna=40amazon.com@dmarc.ietf.org> wrote:
>> 
>> The service provider doesn't own the entire connection. They have no control over corporate or government TLS gateways, or other terminators that might exist on the client's side. In larger organizations, or when cloud hosting is involved, the service team may not even own all the hops on their side.
> 
>    how are cookies protected from leakage, replay, injection in a setup like this?
> 
>> While presumably they have some trust in them, protection against leaked bearer tokens is an attractive defense-in-depth measure.
> 
>    That’s a totally valid point. But again, such a solution makes the life of client developers harder. 
> 
>    I personally think, we as a community need to understand the pros and cons of both approaches. I also think we have not even come close to this point, which, in my option, is the prerequisite for making informed decisions.
> 
>> 
>> – 
>> Annabelle Richard Backman
>> AWS Identity
>> 
>> 
>> On 11/22/19, 9:37 PM, "OAuth on behalf of Torsten Lodderstedt" <oauth-bounces@ietf.org on behalf of torsten=40lodderstedt.net@dmarc.ietf.org> wrote:
>> 
>> 
>> 
>>> On 22. Nov 2019, at 21:21, Richard Backman, Annabelle <richanna=40amazon.com@dmarc.ietf.org> wrote:
>>> 
>>> The dichotomy of "TLS working" and "TLS failed" only applies to a single TLS connection. In non-end-to-end TLS environments, each TLS terminator between client and RS introduces additional token leakage/exfiltration risk, irrespective of the quality of the TLS connections themselves. Each terminator also introduces complexity for implementing mTLS, Token Binding, or any other TLS-based sender constraint solution, which means developers with non-end-to-end TLS use cases will be more likely to turn to DPoP.
>> 
>>   The point is we are talking about different developers here. The client developer does not need to care about the connection between proxy and service. She relies on the service provider to get it right. So the developers (or DevOps or admins) of the service provider need to ensure end to end security. And if the path is secured once, it will work for all clients. 
>> 
>>> If DPoP is intended to address "cases where neither mTLS nor OAuth Token Binding are available" [1], then it should address this risk of token leakage between client and RS. If on the other hand DPoP is only intended to support the SPA use case and assumes the use of end-to-end TLS, then the document should be updated to reflect that.
>> 
>>   I agree. 
>> 
>>> 
>>> [1]: https://tools.ietf.org/html/draft-fett-oauth-dpop-03#section-1
>>> 
>>> – 
>>> Annabelle Richard Backman
>>> AWS Identity
>>> 
>>> 
>>> On 11/22/19, 8:17 PM, "OAuth on behalf of Torsten Lodderstedt" <oauth-bounces@ietf.org on behalf of torsten=40lodderstedt.net@dmarc.ietf.org> wrote:
>>> 
>>>  Hi Neil,
>>> 
>>>> On 22. Nov 2019, at 18:08, Neil Madden <neil.madden@forgerock.com> wrote:
>>>> 
>>>> On 22 Nov 2019, at 07:53, Torsten Lodderstedt <torsten=40lodderstedt.net@dmarc.ietf.org> wrote:
>>>>> 
>>>>> 
>>>>> 
>>>>>> On 22. Nov 2019, at 15:24, Justin Richer <jricher@mit.edu> wrote:
>>>>>> 
>>>>>> I’m going to +1 Dick and Annabelle’s question about the scope here. That was the one major thing that struck me during the DPoP discussions in Singapore yesterday: we don’t seem to agree on what DPoP is for. Some (including the authors, it seems) see it as a quick point-solution to a specific use case. Others see it as a general PoP mechanism. 
>>>>>> 
>>>>>> If it’s the former, then it should be explicitly tied to one specific set of things. If it’s the latter, then it needs to be expanded. 
>>>>> 
>>>>> as a co-author of the DPoP draft I state again what I said yesterday: DPoP is a mechanism for sender-constraining access tokens sent from SPAs only. The threat to be prevented is token replay.
>>>> 
>>>> 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. 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.
>>> 
>>>> 
>>>> 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).
>>> 
>>>> 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? 
>>> 
>>>> 
>>>> Protecting against the first kind of replay attacks only becomes an issue if we assume the protections in TLS have failed. But if DPoP is only intended for cases where mTLS can't be used, it shouldn't have to protect against a stronger threat model in which we assume that TLS security has been lost.
>>> 
>>>  I agree. 
>>> 
>>>  best regards,
>>>  Torsten. 
>>> 
>>>> 
>>>> -- Neil
>>> 
>>> 
>>> 
>> 
>> 
>> 
> 
> 
>