Re: [OAUTH-WG] Auth Code Swap Attack

Phil Hunt <> Mon, 22 August 2011 15:57 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id C500321F85EC for <>; Mon, 22 Aug 2011 08:57:01 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -3.174
X-Spam-Status: No, score=-3.174 tagged_above=-999 required=5 tests=[AWL=-0.575, BAYES_00=-2.599]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id ohHM2xLOFTIp for <>; Mon, 22 Aug 2011 08:57:00 -0700 (PDT)
Received: from ( []) by (Postfix) with ESMTP id CC08021F85C4 for <>; Mon, 22 Aug 2011 08:57:00 -0700 (PDT)
Received: from ( []) by (Switch-3.4.4/Switch-3.4.4) with ESMTP id p7MFw2IP014990 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 22 Aug 2011 15:58:04 GMT
Received: from ( []) by (8.14.4+Sun/8.14.4) with ESMTP id p7MFw0Yv000455 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 22 Aug 2011 15:58:01 GMT
Received: from ( []) by ( with ESMTP id p7MFvtmA008478; Mon, 22 Aug 2011 10:57:55 -0500
Received: from [] (/ by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 22 Aug 2011 08:57:55 -0700
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: text/plain; charset="us-ascii"
From: Phil Hunt <>
In-Reply-To: <90C41DD21FB7C64BB94121FBBC2E7234518A292F66@P3PW5EX1MB01.EX1.SECURESERVER.NET>
Date: Mon, 22 Aug 2011 08:57:54 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <>
References: <> <> <90C41DD21FB7C64BB94121FBBC2E7234502498CE8D@P3PW5EX1MB01.EX1.SECURESERVER.NET> <90C41DD21FB7C64BB94121FBBC2E72345029DFA961@P3PW5EX1MB01.EX1.SECURESERVER.NET> <> <90C41DD21FB7C64BB94121FBBC2E7234518A292F49@P3PW5EX1MB01.EX1.SECURESERVER.NET> <> <> <90C41DD21FB7C64BB94121FBBC2E7234518A292F66@P3PW5EX1MB01.EX1.SECURESERVER.NET>
To: Eran Hammer-Lahav <>
X-Mailer: Apple Mail (2.1084)
X-Source-IP: []
X-CT-RefId: str=0001.0A090202.4E527C8C.00CF,ss=1,re=0.000,fgs=0
Cc: "OAuth WG (" <>
Subject: Re: [OAUTH-WG] Auth Code Swap Attack
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: OAUTH WG <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Mon, 22 Aug 2011 15:57:01 -0000

Eran, to summarize,

1. The server cannot tell if the client did its job - so the server can't "require" the client to implement state
2. There are many ways to enforce CSRF

There is an important "network" effect  here (and in general with OAuth) - that client decisions affect the security of the resource server and vice-versa. One could argue, that many implementers will want a solution for #1 above -- some form of mutual state validation.  This may not be of interest to today's implementers, but I know this is critical for government and financial services where fraud (and phishing) become a much larger issue.

I am beginning to believe we can't fix this now. This will likely have to be an optional RFC for higher strength anti-CSRF which specifies a standard methodology that can be verified by the server (so it can enforce that it was done).  My belief is that a standard methodology would make things easier for developers since they would have clear instructions on how to do it. Hopefully this would address folks like Facebook who are concerned developers have a hard time getting this right.

Because of this, I re-checked RFC2119 regarding making state "RECOMMENDED".  Whereas "REQUIRED" is equivalent to "MUST", "RECOMMENDED" is equivalent to SHOULD and could be used as a parameter qualifier. Though I agree, traditionally this isn't done.  However, my feeling is that the developer needs to be alerted to the importance of "state". Deciding not to use it means they should have some other technique to counter CSRF.  This is what SHOULD is meant for.  Changing to RECOMMENDED makes the calls consistent with the security consideration requirement that anti-CSRF is a MUST.



On 2011-08-21, at 10:53 PM, Eran Hammer-Lahav wrote:

>> -----Original Message-----
>> From: Phil Hunt []
>> Sent: Sunday, August 21, 2011 10:39 PM
>> To: David Recordon
>> Cc: Eran Hammer-Lahav; OAuth WG (
>> Subject: Re: [OAUTH-WG] Auth Code Swap Attack
>> I think the complication here is that CSRF issues are multi-site issues where
>> the attacker cross connecting his client with a victims resource, or a victims
>> client with the attackers resource.
>> So while an individual site (e.g. Facebook) may presume little or no risk -
>> there is a network effect here. A CSRF attacker could be using facebook to
>> attack another site. See Yaron's original text about Plaxo/Live at the start of
>> this thread.
> It's still just a CSRF attack.
>> Would it be reasonable to assess whether a resource site could make it
>> mandatory based on a pre-registered client?  IOW, would Facebook want to
>> make state mandatory for Confidential clients, but not public clients?
> That's irrelevant. The authorization server has absolutely no way of verifying if the client is implementing a CSRF protection properly. Making 'state' required does not accomplish such an enforcement. A client can pass the proposed text requirement with "state=ni".
>> Would it be acceptable to change status from OPTIONAL to RECOMMENDED?
> Parameters are either required or optional. We can makes it optional and recommended for a particular purpose which is consistent with the existing text.
> It should be mandatory to implement CSRF protection. We agree on that and should add it to the text. We also agree that 'state' is a great way of implementing it and should recommend it. We already do that in the security consideration section and can enhance that when defining the 'state' parameter.