Re: [OAUTH-WG] Auth Code Swap Attack

John Kemp <john@jkemp.net> Sun, 14 August 2011 13:19 UTC

Return-Path: <john@jkemp.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 E3E0A21F876F for <oauth@ietfa.amsl.com>; Sun, 14 Aug 2011 06:19:00 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.161
X-Spam-Level:
X-Spam-Status: No, score=-0.161 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FH_RELAY_NODNS=1.451, HELO_MISMATCH_COM=0.553, IP_NOT_FRIENDLY=0.334, RDNS_NONE=0.1]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 857H4Y-sTJCK for <oauth@ietfa.amsl.com>; Sun, 14 Aug 2011 06:19:00 -0700 (PDT)
Received: from oproxy1-pub.bluehost.com (oproxy1.bluehost.com [IPv6:2605:dc00:100:2::a1]) by ietfa.amsl.com (Postfix) with SMTP id F33B621F8760 for <oauth@ietf.org>; Sun, 14 Aug 2011 06:18:59 -0700 (PDT)
Received: (qmail 5557 invoked by uid 0); 14 Aug 2011 13:19:41 -0000
Received: from unknown (HELO box320.bluehost.com) (69.89.31.120) by oproxy1.bluehost.com with SMTP; 14 Aug 2011 13:19:41 -0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=jkemp.net; s=default; h=To:References:Message-Id:Content-Transfer-Encoding:Cc:Date:In-Reply-To:From:Content-Type:Mime-Version:Subject; bh=Rriojx68VCH0YNHCOpl/wgCsYwr7hyucxHbOqJ8IzVE=; b=HKqfKa2f9jPLyALk7Lq7i7ujVdpMiZg7OcD+AkmyhZGf8clez6ClZ+j+VXbBJTrKdXAbVtbhK9WRq/b8E1HkwKM+0nlt3xqe+JuAQ4lC8dfMMW+cAPo1Qinr9BtADraI;
Received: from cpe-74-67-30-101.nycap.res.rr.com ([74.67.30.101] helo=[192.168.1.108]) by box320.bluehost.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.76) (envelope-from <john@jkemp.net>) id 1QsabN-0006l2-6S; Sun, 14 Aug 2011 07:19:41 -0600
Mime-Version: 1.0 (Apple Message framework v1244.3)
Content-Type: text/plain; charset="us-ascii"
From: John Kemp <john@jkemp.net>
In-Reply-To: <4DE6F907-E45B-4F70-9CE7-FF58ABE13BF6@oracle.com>
Date: Sun, 14 Aug 2011 09:19:39 -0400
Content-Transfer-Encoding: quoted-printable
Message-Id: <FE7241D3-789E-462F-8597-5D11988A26EF@jkemp.net>
References: <CA6BD818.17E81%eran@hueniverse.com> <B478E5DF-6B05-4BAA-ACF3-B5C7C7B1F1AA@oracle.com> <1313295383.69882.YahooMailNeo@web31808.mail.mud.yahoo.com> <4DE6F907-E45B-4F70-9CE7-FF58ABE13BF6@oracle.com>
To: Phillip Hunt <phil.hunt@oracle.com>
X-Mailer: Apple Mail (2.1244.3)
X-Identified-User: {1122:box320.bluehost.com:jkempnet:jkemp.net} {sentby:smtp auth 74.67.30.101 authed with john+jkemp.net}
Cc: "OAuth WG (oauth@ietf.org)" <oauth@ietf.org>
Subject: Re: [OAUTH-WG] Auth Code Swap Attack
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.12
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: <http://www.ietf.org/mail-archive/web/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, 14 Aug 2011 13:19:01 -0000

On Aug 14, 2011, at 1:55 AM, Phillip Hunt wrote:

> No. I don't think so. In the new variant the client has to check the returned state to confirm it has not changed or associated with a different user.  
> 
> Previously the authz server had to do the checks. 

In a CSRF attack, either of the two web servers (one is the OAuth "client" in this case) may be attacked with a CSRF. The defense against a CSRF is always for the recipient of the request to authenticate the requester in one way or another. One way to do that is with a CSRF token (see https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet). 

In OAuth, I think it's fair to say that an "OAuth CSRF attack" might be a special-case of a CSRF attack, but the typical defenses apply to both the OAuth "client" and the OAuth "resource server".

- John

> 
> Phil
> 
> On 2011-08-13, at 21:16, "William J. Mills" <wmills@yahoo-inc.com> wrote:
> 
>> The defense is the same though, correct?
>> 
>> From: Phil Hunt <phil.hunt@oracle.com>
>> To: Eran Hammer-Lahav <eran@hueniverse.com>
>> Cc: "OAuth WG (oauth@ietf.org)" <oauth@ietf.org>
>> Sent: Saturday, August 13, 2011 4:41 PM
>> Subject: Re: [OAUTH-WG] Auth Code Swap Attack
>> 
>> There are two CSRF variations scenarios that I see.
>> 
>> I can attack you and give my client access to your resources (original attack on the "resource").
>> 
>> I can attack you and give your client access to my resource (new attack on the "client").
>> 
>> Attack on the client vs. attack on the resource may be misleading here.  Draft 20 only referred to attacks on the "resource" in its original CSRF description.
>> 
>> Phil
>> 
>> @independentid
>> www.independentid.com
>> phil.hunt@oracle.com
>> 
>> 
>> 
>> 
>> 
>> On 2011-08-13, at 7:30 AM, Eran Hammer-Lahav wrote:
>> 
>>> All OAuth CSRF attacks are on the client.
>>> 
>>> EHL
>>> 
>>> From: Phil Hunt <phil.hunt@oracle.com>
>>> Date: Sat, 13 Aug 2011 00:21:50 -0700
>>> To: Torsten Lodderstedt <torsten@lodderstedt.net>
>>> Cc: Eran Hammer-lahav <eran@hueniverse.com>, "OAuth WG (oauth@ietf.org)" <oauth@ietf.org>
>>> Subject: Re: [OAUTH-WG] Auth Code Swap Attack
>>> 
>>>> +1 (to putting more detail in the Threat Model document)
>>>> 
>>>> Yes, this is another CSRF attack (hence the change to 10.2). 
>>>> 
>>>> What is *new* is this is an attack on the client application rather than the resource server. As such, I agree this new attack vector is well deserving of wider review and discussion before finalizing the draft.
>>>> 
>>>> Phil
>>>> 
>>>> @independentid
>>>> www.independentid.com
>>>> phil.hunt@oracle.com
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> On 2011-08-12, at 11:58 PM, Torsten Lodderstedt wrote:
>>>> 
>>>>> 
>>>>> 
>>>>> Am 12.08.2011 23:52, schrieb Eran Hammer-Lahav:
>>>>>> This is really just a flavor of CSRF attacks. I have no objections to better documenting it (though I feel the current text is already sufficient), but we can't realistically expect to identify and close every possible browser-based attack. A new one is invented every other week.
>>>>>> 
>>>>>> The problem with this text is that developers who do no understand CSRF attacks are not likely to implement it correctly with this information. Those who understand it do not need the extra verbiage which is more confusing than helpful.
>>>>> 
>>>>> We are constantly facing the fact that a comprehensive description of security threats needs more space than we have in the core draft. That's the reason why the security document has 63 pages and that's also the reason why we decided to let the core spec refer to this document for in-depth explanations. This holds true for this threat as well.
>>>>> 
>>>>> regards,
>>>>> Torsten. 
>>>>> 
>>>>>> 
>>>>>> As for the new requirements, they are insufficient to actually accomplish what the authors propose without additional requirements on state local storage and verification to complete the flow. Also, the proposed text needs clarifications as noted below.
>>>>>> 
>>>>>> 
>>>>>> From: Anthony Nadalin <tonynad@microsoft.com>
>>>>>> Date: Fri, 12 Aug 2011 12:06:36 -0700
>>>>>> To: "OAuth WG (oauth@ietf.org)" <oauth@ietf.org>
>>>>>> Subject: [OAUTH-WG] Auth Code Swap Attack
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>>> Recommended Changes to draft-ietf-oauth-v2
>>>>>>>  
>>>>>>> In section 4, request options (e.g. 4.1.1) featuring "state" should change from:
>>>>>>>  
>>>>>>> state
>>>>>>> OPTIONAL. An opaque value used by the client to maintain state between the request and callback. The authorization server includes this value when redirecting the user-agent back to the client.
>>>>>>>  
>>>>>>> to:
>>>>>>>  
>>>>>>> state
>>>>>>> REQUIRED. An opaque value used by the client to maintain state between the request and callback. The authorization server includes this value when redirecting the user-agent back to the client. The encoded value SHOULD enable the client application to determine the user-context that was active at the time of the  request (see section 10.12). The value MUST NOT be guessable or predictable, and MUST be kept                     confidential.
>>>>>>>  
> _______________________________________________
> OAuth mailing list
> OAuth@ietf.org
> https://www.ietf.org/mailman/listinfo/oauth