Re: [OAUTH-WG] Call for Adoption: OAuth 2.0 Mix-Up Mitigation

John Bradley <ve7jtb@ve7jtb.com> Fri, 22 January 2016 00:58 UTC

Return-Path: <ve7jtb@ve7jtb.com>
X-Original-To: oauth@ietfa.amsl.com
Delivered-To: oauth@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 42D881B35A7 for <oauth@ietfa.amsl.com>; Thu, 21 Jan 2016 16:58:57 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, SPF_PASS=-0.001] autolearn=ham
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 QdzB8AdB9dDj for <oauth@ietfa.amsl.com>; Thu, 21 Jan 2016 16:58:50 -0800 (PST)
Received: from mail-qk0-x236.google.com (mail-qk0-x236.google.com [IPv6:2607:f8b0:400d:c09::236]) (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 2A1AC1B35A1 for <oauth@ietf.org>; Thu, 21 Jan 2016 16:58:50 -0800 (PST)
Received: by mail-qk0-x236.google.com with SMTP id s5so23281976qkd.0 for <oauth@ietf.org>; Thu, 21 Jan 2016 16:58:50 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ve7jtb-com.20150623.gappssmtp.com; s=20150623; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=A+4jCiFfiBpkwCoZfW+gCVcYsneGSf2soPtQZ5+jDT4=; b=bZ7vxVWA51Ces/WesO6h6AW0Wo3VaPdoNZWiCNCGGtpkuq5Na2WV+JG0GF/MRSuumK fSr5HkLxWNTTednNlv9GlTeIxiUdZGEBGA5PMt68OPNcMcunFnmK73eTe4nVG96oySBo 3Dw1nC9xGLr4LwUSoV5JyDYxi0XUbsrXZtiXnpuFpAlxAPoc1ixsEDfvTwPcLfrcvtBc GNJe3vQTLwep9l4peFYb1wSEoruZpIevmrfd+zK4o0mLza20x5g0O2sgWaT+05lbB8zw JFfhXgQ5CH/7HWHJTLJiRLV9fKE85h4H8NNtp/T332YLQL1XXAnAtCsEGQ9gLscf2C0w of5A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=A+4jCiFfiBpkwCoZfW+gCVcYsneGSf2soPtQZ5+jDT4=; b=EHReHRdjgCk7uuV3DyKyJBx10125RpPMhytI3tWUfepkfVfY98lrtRof75nKo5KR61 FzWYRxRN0n+El7L0P9Y1e4HpitbhF8LoKzpkR+ebK7zpIjBQvOW5qd4zTnKhDFA/S4NH A5n9nDMfM5Eo9Igr3VNxoNaizYm1G5U+Cao7VcCu3jATG6SWNDePCoFeLKjHcOCpsuub P/baz7uyQjhf8Z288a3SpA8ipr15ffZO7mnK9Lf51hmox9S5tNj7jZA8eME3VikS3zGH SLvrqNDGKpTFMBieIxbqYgPVvCqHDjjW4ai7tQTJBV73Hz5lhX1Nt8Y2+bsBAAmLgKLI SQZg==
X-Gm-Message-State: AG10YOS1kzDwXgWcKB9xP8+HmfUsTlrhoV8P11LtE9Tn14ZPCkH27FkKyo1870s+um4DXg==
X-Received: by 10.55.75.144 with SMTP id y138mr333133qka.96.1453424329161; Thu, 21 Jan 2016 16:58:49 -0800 (PST)
Received: from [192.168.8.101] ([181.202.192.227]) by smtp.gmail.com with ESMTPSA id t187sm1723854qht.39.2016.01.21.16.58.47 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 21 Jan 2016 16:58:48 -0800 (PST)
Content-Type: multipart/signed; boundary="Apple-Mail=_BF366EBF-2F81-45CC-AF9F-1938DD9A7296"; protocol="application/pkcs7-signature"; micalg="sha1"
Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\))
From: John Bradley <ve7jtb@ve7jtb.com>
In-Reply-To: <CAAP42hDyKbpiXNX1BJSBEi79UxE0_M1C4ZEJUi6SpgL4pFGr_w@mail.gmail.com>
Date: Thu, 21 Jan 2016 21:58:44 -0300
Message-Id: <617BF715-85E3-46F1-B928-68FC176BCDBC@ve7jtb.com>
References: <569E22E1.5010402@gmx.net> <CANSMLKHjAHr6rUZny5EkX0KBHnOcLuUOZBL0Wwf6V8Y3tt_kNw@mail.gmail.com> <CABzCy2C-_57dO5n6GN6wazA9ozuPivrQd95g_XvdkPWx6zDwAA@mail.gmail.com> <CANSMLKE98FVdDV-7bwW3wZ=-ao5=oXkn9LO5s_M1KmMAt7Drcw@mail.gmail.com> <537B9D13-1159-4B2D-9E1A-A245C9B3659C@ve7jtb.com> <CAAP42hDyKbpiXNX1BJSBEi79UxE0_M1C4ZEJUi6SpgL4pFGr_w@mail.gmail.com>
To: William Denniss <wdenniss@google.com>
X-Mailer: Apple Mail (2.3112)
Archived-At: <http://mailarchive.ietf.org/arch/msg/oauth/VA1pQcL183dzOPQySGptSG-0L20>
Cc: "oauth@ietf.org WG" <oauth@ietf.org>
Subject: Re: [OAUTH-WG] Call for Adoption: OAuth 2.0 Mix-Up Mitigation
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.15
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: Fri, 22 Jan 2016 00:58:57 -0000

I will point out for the benefit of the people on the the list who were not at the F2F in Germany, that Mike and I were asked to write up the consensus of the group.

We have done that. 

The work group is free to adopt it or modify it.   

Brian and others raised issues about how accurately we reflected the consensus in the first draft.  I think that is mostly resolved.   We should continue refining that if needed.

Separately the work group needs to consider other proposals do come to a Work Group consensus rather than a meeting consensus.

My main concern is coming to that consensus quickly.    We do have people who have implemented the mitigations in the spec Mike and I did.

Perhaps we should also document Nat’s proposal so it can be tested as well.

John B.

> On Jan 21, 2016, at 9:43 PM, William Denniss <wdenniss@google.com> wrote:
> 
> When I first heard Nat's proposal in Yokohama I thought it was pretty elegant. And remember that it was first proposed to add more RESTful behavior to OAuth and not just as a mix-up mitigation.
> 
> For the mix-up topic, I wonder if this comes down to: if you are already doing OpenID Connect, the issuer/discovery path feels natural, as that's what you're used to. But if you're pure OAuth, without those concepts then Nat's solution is more natural?
> 
> I do recall some contention in Yokohama around returning the same info twice (e.g. returning the token endpoint, and returning a discovery document URL which could potential reference a different token endpoint).
> 
> There's something quite nice about the possibility for the AS returning more detailed configuration like the relevant resource servers where the token can be used – something that discovery can't do as it doesn't have the context of the authorization grant.
> 
> On Fri, Jan 22, 2016 at 6:59 AM, John Bradley <ve7jtb@ve7jtb.com <mailto:ve7jtb@ve7jtb.com>> wrote:
> There have been a lot of discussions. I think Hannes posted some minutes of the F2F meeting we had with the security researchers.
> 
> The problem can’t be mitigated without some action on the client side.  It boils down to the client making a request to AS1 (From it’s perspective) and getting back a response from AS 2 (that it thinks is AS1)
> 
> This can be done if AS1 is a good AS but has it’s logs compromised so that an attacker can read them. Hans Zandbelt built a proof of concept for the attack. 
> 
> In some cases the attacker gets the code and the credential to use it at the good AS token endpoint and in others it just gets the code and can replay that at the client to extract information from the API through the client by binding the api access to a new account.
> 
> PKCE unfortunately mitigates a different attack, where the client is impersonated and trys to replay a intercepted code.  It however assumes the token endpoint is good, and is no help in the case of a compromised token endpoint.
> 
> The client in these attacks is vulnerable because it relies on some local state, or the value of the state parameter to know who the response is coming from.  This allows a authorization request that is intercepted to be used to create a new request in that browser to a different AS, or trick the client into using a Authorization endpoint for a different authorization server.
> 
> One problem is that OAuth doesn’t really have a unified concept of what a AS is.  Traditionally it is a Authorization endpoint URI, token end point URI and resource server URI that some one gives the client in some documentation.   
> 
> As ling as a client only talks to one AS then there is no problem.   However once a client is configured to talk to more than one AS, we have problems if one of those AS lies about it’s endpoints, or is compromised and used to attack another AS.   As a design goal you don’t want the overall  security to be limited by the weakest system.
> 
> One approach as Nat promotes is to have the authorization endpoint return the next hop, token endpoint for code or RS URI for token. The token endpoint must also return the RS URI or the client must push the RS URI to the token endpoint or the attacker just replaces the RS URI in the config and captures the token that way. 
> 
> The other way is to provide a name for each AS as part of registration and the client not allow duplicate registrations with the same name.  When the response comes back the client checks the name against the one it made the request to.  If the name dereferences to a discovery document then the client can check that name at registration or runtime to validate the net hops.
> 
> I think the two approaches mitigate the attack in similar ways.  Nat’s is more REST friendly and returns the next hop as a parameter of header.  
> 
> The one Mike and I wrote up based on the meeting in Germany provides identifiers (iss and client_id) that can be checked for validity in the simple case and be dereferenced via .well-known to get the information Nat’s proposal is providing.
> 
> Perhaps the main difference is Nat is using the token endpoint as the identifier for the AS and Mike’s is using location for a discovery document as the identifier.
> 
> I don’t recall the reasons using the token endpoint as the identifier was rejected at the meeting.  Perhaps others can post the reasons.
> 
> We need to close on this quickly, otherwise if we are indecisive fixes will not go into products for another year or so until this is a RFC.
> 
> That is my main concern.
> 
> John B.
> 
> 
> 
> 
> 
>> On Jan 21, 2016, at 11:50 AM, Josh Mandel <jmandel@gmail.com <mailto:jmandel@gmail.com>> wrote:
>> 
>> Thanks Nat - that's helpful. If both mitigations *can* work effectively, then I would like to see this group consider the decision between them carefully (if that hasn't happened yet). Again, don't hesitate to let me know if this is the wrong place/time for such discussion.
>> 
>> At a high level, I would rather ask server developers to do some "coding", for two reasons:
>> 
>> 1. Most OAuth servers talk to many, many clients. So consolidating the security critical work in one place (server) is a net savings of work (rather than asking each client to implement these checks.
>> 
>> 2. OAuth server developers are typically more sophisticated than client developers, and therefore more likely to understand the implications and more likely to get these critical details correct. Asking each client developer to do something right is likely to result in heterogenius implementation and persistent security holes. But if the server does the heavy lifting, and clients just have to pass along an extra parameter, this is more likely to see consistent implementation (for example, clients will fail to work if misconfigured, which will prompt developers to fix them).
>> 
>> On Jan 21, 2016 09:40, "Nat Sakimura" <sakimura@gmail.com <mailto:sakimura@gmail.com>> wrote:
>> Hi Josh, 
>> 
>> It is similar but slightly different IMHO. 
>> 
>> Section 4.6.4 of the RFC6819 is the access token phishing by a counterfeit resource server. 
>> The mix-up attack described here is the code phishing by a counterfeit token endpoint. 
>> 
>> In my view, both can be mitigated by the server returning the next step: i.e., authorization endpoint returning the legitimate token endpoint uri, and token endpoint returning legitimate resource endpoint uris. This involves no discovery endpoint, which is good. 
>> 
>> Your way also works. It is just the reverse of my proposal. The difference being that my proposal does not need any coding on the server but just configuration, and it can return more metadata if needed. 
>> 
>> Cheers, 
>> 
>> Nat
>> 
>> 2016年1月21日(木) 23:04 Josh Mandel <jmandel@gmail.com <mailto:jmandel@gmail.com>>:
>> Apologies if this is the wrong forum for my comment (and please direct me to the appropriate place in that case), but I have two questions about the propose mitigation (and the thinking behind it) that I think the write-up could address:
>> 
>> 1. Could the writeup clarify whether/how the primary "mixup" threat differs from what RFC6819 identifies as in section 4.6.4?
>> 
>> 2. Has the workgroup considered a mitigation that puts more responsibility on the authorization server, and less on the client? For example, if would be helpful for the writeup to clarify why having the client send an "audience field" (in the terminology of RFC6819) to the authorization endpoint would not mitigate the threat. (In that scenario, the authorization server can recognize that the audience does not correspond to a resource server it knows, rather than asking clients to make this check). I assume this approach has been considered and rejected as an incomplete mitigation, but I don't have visibility into where/how that discussion went.
>> 
>> Thanks,
>> 
>> Josh 
>> Hi all,
>> 
>> this is the call for adoption of OAuth 2.0 Mix-Up Mitigation, see
>> https://tools.ietf.org/html/draft-jones-oauth-mix-up-mitigation-00 <https://tools.ietf.org/html/draft-jones-oauth-mix-up-mitigation-00>
>> 
>> Please let us know by Feb 9th whether you accept / object to the
>> adoption of this document as a starting point for work in the OAuth
>> working group.
>> 
>> Note: This call is related to the announcement made on the list earlier
>> this month, see
>> http://www.ietf.org/mail-archive/web/oauth/current/msg15336.html <http://www.ietf.org/mail-archive/web/oauth/current/msg15336.html>. More
>> time for analysis is provided due to the complexity of the topic.
>> 
>> Ciao
>> Hannes & Derek
>> 
>> 
>> _______________________________________________
>> OAuth mailing list
>> OAuth@ietf.org <mailto:OAuth@ietf.org>
>> https://www.ietf.org/mailman/listinfo/oauth <https://www.ietf.org/mailman/listinfo/oauth>
>> 
>> _______________________________________________
>> OAuth mailing list
>> OAuth@ietf.org <mailto:OAuth@ietf.org>
>> https://www.ietf.org/mailman/listinfo/oauth <https://www.ietf.org/mailman/listinfo/oauth>
>> _______________________________________________
>> OAuth mailing list
>> OAuth@ietf.org <mailto:OAuth@ietf.org>
>> https://www.ietf.org/mailman/listinfo/oauth <https://www.ietf.org/mailman/listinfo/oauth>
> 
> 
> _______________________________________________
> OAuth mailing list
> OAuth@ietf.org <mailto:OAuth@ietf.org>
> https://www.ietf.org/mailman/listinfo/oauth <https://www.ietf.org/mailman/listinfo/oauth>
> 
>