Re: [OAUTH-WG] Auth Code Swap Attack

Eran Hammer-Lahav <> Sun, 14 August 2011 13:30 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 4390F21F87D3 for <>; Sun, 14 Aug 2011 06:30:20 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.561
X-Spam-Status: No, score=-2.561 tagged_above=-999 required=5 tests=[AWL=0.037, BAYES_00=-2.599, HTML_MESSAGE=0.001]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id hdCxM6NDXY3u for <>; Sun, 14 Aug 2011 06:30:19 -0700 (PDT)
Received: from ( []) by (Postfix) with SMTP id F0A5821F87C2 for <>; Sun, 14 Aug 2011 06:30:18 -0700 (PDT)
Received: (qmail 5875 invoked from network); 14 Aug 2011 13:31:01 -0000
Received: from unknown (HELO ( by with SMTP; 14 Aug 2011 13:31:01 -0000
Received: from P3PW5EX1MB01.EX1.SECURESERVER.NET ([]) by P3PW5EX1HT001.EX1.SECURESERVER.NET ([]) with mapi; Sun, 14 Aug 2011 06:31:00 -0700
From: Eran Hammer-Lahav <>
To: Phillip Hunt <>
Date: Sun, 14 Aug 2011 06:30:40 -0700
Thread-Topic: [OAUTH-WG] Auth Code Swap Attack
Thread-Index: AcxahmgKd0Cu2rpDQea13tQwoVJjrQ==
Message-ID: <>
References: <> <> <> <>
In-Reply-To: <>
Accept-Language: en-US
Content-Language: en-US
acceptlanguage: en-US
Content-Type: multipart/alternative; boundary="_000_0DB326FFDBE446B3B59309FAF49E2DC6hueniversecom_"
MIME-Version: 1.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: Sun, 14 Aug 2011 13:30:20 -0000

Not true. It is the same.


On Aug 14, 2011, at 1:55, "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.


On 2011-08-13, at 21:16, "William J. Mills" <<><>> wrote:

The defense is the same though, correct?

From: Phil Hunt <<><>>
To: Eran Hammer-Lahav <<><>>
Cc: "OAuth WG (<><>)" <<><>>
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.



On 2011-08-13, at 7:30 AM, Eran Hammer-Lahav wrote:

All OAuth CSRF attacks are on the client.


From: Phil Hunt <<><><>>
Date: Sat, 13 Aug 2011 00:21:50 -0700
To: Torsten Lodderstedt <<><><>>
Cc: Eran Hammer-lahav <<><><>>, "OAuth WG (<><><>)" <<><><>>
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.



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.


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 <<><><>>
Date: Fri, 12 Aug 2011 12:06:36 -0700
To: "OAuth WG (<><><>)" <<><><>>
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:

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.


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.