Re: [OAUTH-WG] Report an authentication issue

Lewis Adam-CAL022 <> Mon, 25 June 2012 16:55 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 3486E21F8562 for <>; Mon, 25 Jun 2012 09:55:18 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -3.466
X-Spam-Status: No, score=-3.466 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-4, UNRESOLVED_TEMPLATE=3.132]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id UC9rnwj7v6Vq for <>; Mon, 25 Jun 2012 09:55:04 -0700 (PDT)
Received: from ( []) by (Postfix) with ESMTP id 4BA6521F855B for <>; Mon, 25 Jun 2012 09:55:02 -0700 (PDT)
Received: from ( by ( with Microsoft SMTP Server id; Mon, 25 Jun 2012 16:53:23 +0000
Received: from mail51-tx2 (localhost []) by (Postfix) with ESMTP id D537C8031E for <>; Mon, 25 Jun 2012 16:53:23 +0000 (UTC)
X-Forefront-Antispam-Report: CIP:; KIP:(null); UIP:(null); IPV:NLI;;; EFVD:NLI
X-SpamScore: -18
X-BigFish: VPS-18(zzbb2dI98dI9371Ic85fh1418Ib457nzz1202hzz1033IL8275bh8275dhz2fh2a8h683h839hd25hf0ah)
Received-SPF: pass (mail51-tx2: domain of designates as permitted sender) client-ip=;; ; ;
X-Forefront-Antispam-Report-Untrusted: CIP:; KIP:(null); UIP:(null); (null);; R:internal; EFV:INT
Received: from mail51-tx2 (localhost.localdomain []) by mail51-tx2 (MessageSwitch) id 1340643198953523_6865; Mon, 25 Jun 2012 16:53:18 +0000 (UTC)
Received: from (unknown []) by (Postfix) with ESMTP id E4D45160046 for <>; Mon, 25 Jun 2012 16:53:18 +0000 (UTC)
Received: from ( by ( with Microsoft SMTP Server (TLS) id; Mon, 25 Jun 2012 16:53:17 +0000
Received: from ( []) by (8.14.3/8.14.3) with ESMTP id q5PGwPSm016792 for <>; Mon, 25 Jun 2012 12:58:25 -0400 (EDT)
Received: from ( []) by (8.14.3/8.14.3) with ESMTP id q5PGwOHE016784 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL) for <>; Mon, 25 Jun 2012 12:58:24 -0400 (EDT)
Received: from ( by ( with Microsoft SMTP Server id; Mon, 25 Jun 2012 16:53:15 +0000
Received: from mail9-va3 (localhost []) by (Postfix) with ESMTP id 195362A00B7 for <>; Mon, 25 Jun 2012 16:53:15 +0000 (UTC)
Received: from mail9-va3 (localhost.localdomain []) by mail9-va3 (MessageSwitch) id 1340643191160507_7914; Mon, 25 Jun 2012 16:53:11 +0000 (UTC)
Received: from (unknown []) by (Postfix) with ESMTP id 2153D260047; Mon, 25 Jun 2012 16:53:11 +0000 (UTC)
Received: from ( by ( with Microsoft SMTP Server (TLS) id; Mon, 25 Jun 2012 16:53:09 +0000
Received: from ([]) by ([]) with mapi id 14.16.0164.004; Mon, 25 Jun 2012 16:54:45 +0000
From: Lewis Adam-CAL022 <>
To: Nat Sakimura <>, Paul Madsen <>
Thread-Topic: [OAUTH-WG] Report an authentication issue
Thread-Index: AQHNUg1aQ6l+bX+OSkGiyy7VSGUjQZcLPjvA
Date: Mon, 25 Jun 2012 16:54:45 +0000
Message-ID: <>
References: <> <> <> <> <> <> <> <> <> <> <> <> <> <>
In-Reply-To: <>
Accept-Language: en-US
Content-Language: en-US
x-originating-ip: []
Content-Type: multipart/alternative; boundary="_000_59E470B10C4630419ED717AC79FCF9A91A2C8949CH1PRD0410MB369_"
MIME-Version: 1.0
X-CFilter-Loop: Reflected
Cc: "" <>
Subject: Re: [OAUTH-WG] Report an authentication issue
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, 25 Jun 2012 16:55:18 -0000

Okay :-)

I've gotten lot of feedback ... consider a few snippets below, all part of this thread and in response to my question:

Igor said: OAuth was not designed for this purpose; it was designed for delegating access.  In your use case,  there is no delegation. The only legitimate users are police officers and they "must logon to the video server in order to access video content."  And so the server must authenticate them. There is no need for OAuth in this scenario.

Nat said: Yes, OAuth can be profiled to enable authentication. In fact, initial draft of OpenID Connect was just like you described.

Phil said: I see elements of improper use of OAuth flows as well as improper use of bearer tokens. We have to keep it a simple comment in both specs.

Nat said: "I think you are way beyond what OAuth provides."

Paul said: Nothing prevents you today from using OAuth as is to issue a token to the officer on the tablet, having the app use that token on API calls, and the API making an authz decision based solely on enterprise policy, with no consent figuring in. ... This doesnt sound like a Connect Use Case to me - rather a pretty standard OAuth use case - albeit with no need to get user's consent (so actually simpler).

Chuck said: This is basically describing how our OAuth deployment works, with the exception that our token format is opaque.

Patreek said: My impression is that the fully specified OAuth flows to date focus on certain key consumer-centred use-cases and that important enterprise flows such as the one you have described are yet to be profiled.

I think the above just really drives home the fact that if OAuth is to be used for securing enterprise API calls in a post-SOAP world, something needs to be stated more explicitly.  OAuth was not designed to provide authentication of the user to the RS.  But it seems we all agree that it can be profiled to do so.  Connect is supposed to address authentication, but only from the view of the client, and not the RS.  Only the access token goes to the RS, so if we want to authenticate a user to the RS, then we're back to OAuth, since Connect doesn't intend to send the id_token to the RS.  Nat mentioned that it "could," but I haven't seen that as part of the Connect specs thus far.

There is *clearly* confusion around whether OAuth is to be used as authentication or not, and I think this thread has shown that.  If I'm going to deploy OAuth for Authentication, then I really need a spec to point to (when my customers ask) that says it can be used that way, especially with all the "OAuth is NOT authentication" blog posts floating around in cyberspace these days.

I'm thinking two things:

1)      it would at least be worthwhile to document this use case, and maybe the OAuth use cases draft would be a good place to capture it.

2)      maybe a stand alone, informational draft would also be a good idea, especially if we all agree that it's only a profile of OAuth, and does not require any technical changes to the core draft.  Something that talks outright about an enterprise-centric world, rather than the user RO-centric world that OAuth was really written around.  This might give future generation of Enterprise folks like myself an easier time.


From: Nat Sakimura []
Sent: Sunday, June 24, 2012 8:29 AM
To: Paul Madsen
Cc: Lewis Adam-CAL022;
Subject: Re: [OAUTH-WG] Report an authentication issue

On Fri, Jun 22, 2012 at 4:59 AM, Paul Madsen <<>> wrote:
Lewis, I think you are perhaps conflating the token model (whether it has inherent structure or is merely a pointer to user info) and who the RO owner is - user or enterprise.

Nothing prevents you today from using OAuth as is to issue a token to the officer on the tablet, having the app use that token on API calls, and the API making an authz decision based solely on enterprise policy, with no consent figuring in.

Indeed, though I usually envisage that there is invisible consent authority a.k.a. corporate policy engine.

Neither do you need a structured token (like id_token). The token issued can merely be a pointer/artifact to the officer's actual roles, these obtained by the API/RS by sending the tokens for 'validation' or 'introspection'

If RS can reach AS through network, yes, the access token can act as an artifact that you do artifact resolve. That would have a nice property of audit logging at the AS. It is not always true though. In one of my use case, RS was not able to directly talk to AS, in which case, you need a structured token.

This doesnt sound like a Connect Use Case to me - rather a pretty standard OAuth use case - albeit with no need to get user's consent (so actually simpler).

If authentication and the identity of the accessor matters, yes.
If it does not, maybe not.


On 6/21/12 12:01 PM, Lewis Adam-CAL022 wrote:
Hi Nat,

I'm beginning to wonder what it would take to add a new profile of sorts to either OAuth or Connect.

In the beginning there was SOAP, and the preferred method to secure SOAP API calls was WS-Trust.

Now the world is moving toward RESTful APIs ... and the preferred means to secure RESTful APIs is OAuth.

Except that OAuth is clearly written with the idea that the protected resources belong to the end user.

My use cases - and I imagine the use cases of many other enterprises - is that the Owner of the resources is the Enterprise.  An employee is trying to access a database or video resources.  The enterprise RS needs to be able to 1) identify the user, and 2) make authorization decisions based on what roles that user has within the enterprise.  So in my scenario, when a police officer attempts to access a criminal records database, the database needs to know who that officer is, and then decide if they have privilege to access the database, and at what level (e.g. CRUD).

WS-Trust fits this model well.  The user performs primary authentication to the enterprise STS, which then grants the application client a SAML assertion.  When the user attempts to access a records database, the SAML assertion is included in the SOAP message.  The records server authenticates the user based on the SAML assertion and makes its authorization decisions.

This is the world I'm trying to migrate from, and it really seems like I'm sometimes trying to make a square peg fit in a round hole.  I'm looking for OAuth/Connect to do for REST what WS-TRUST did for SOAP.  I would like a native client talking to a RS to be able to ask for an id_token, and then pass that id_token to the RS when making its RESTful API calls, to enable the RS to authenticate the user.  I think that this would be really useful for a lot of people besides me.  I keep hearing that there is nothing "preventing" me from doing this ... but it hardly seems within the spirit of what OAuth was meant to do.  The id_token was clearly meant to enable a user to authenticate to a confidential client  / web server ... but was not meant for a native client to identity / authenticate the user to a RS.

Would there be any interest in exploring this further?

From: Nat Sakimura []
Sent: Wednesday, June 20, 2012 8:09 PM
To: Lewis Adam-CAL022
Subject: Re: [OAUTH-WG] Report an authentication issue

Yes, OAuth can be profiled to enable authentication.
In fact, initial draft of OpenID Connect was just like you described.
Essentially, we were using structured access_token.
Later, we decided to separate the access token and id_token for several reasons such as:

  1.  Better interop with existing OAuth implementations: by introducing id_token, they do not need to touch the supposedly opaque (which means AS-RS may be doing some proprietary thing inside it) access token.
  2.  Mixing up the audience (for id_token aka authn = client, and for access_token aka authz = resource server) probably is expanding the attack surface for security and privacy.
Although we separated them out, a signed id_token includes the left hash of access_token so access_token is also protected.



On Thu, Jun 21, 2012 at 5:21 AM, Lewis Adam-CAL022 <<>> wrote:
Hi Igor,

As Justin just pointed out, consider the case where the video server is hosted by the state (e.g. California) and is accessed by police agencies in Los Angeles, San Francisco, and San Diego.  The State of California's video server is the RS.  Each local police agency (LA/SF/SD) hosts an AS.  So when a police officer from LAPD launches the video client app on the iPhone, the client makes an OAuth request to the LAPD's AS, which authenticates the police officer using agency level credentials.  The access token issued to the video client app on the iPhone is a JWT, signed by the agency AS, which might look something like this:


The JWT might be optionally encrypted using JWE.

I think what is becoming clear (and this is what I'm trying to vet) is that while there is nothing in OAuth that specifies authentication, it *can* be used for Authentication, if done in the way that I describe.  If I'm wrong about this, I really need to know.  I've vetted this idea of mine with quite of few people now - both within context of the list and off-line - and I think I'm okay. If you see any holes in what I describe, please point them out as I would prefer to uncover them now rather than after implementation or deployment!

Essentially I'm using OAuth as a RESTful version of WS-Trust, where my client can exchange primary credentials for a token (JWT) and present that token to a server as secondary authentication.  It's just that it's RESTful instead of SOAP :-)

As Justin as pointed out ... I've basically made the access-token look like the id_token of Connect.  I was actually hoping to lay a path to Connect, and use the id_token ... until it was also pointed out that the id_token is really meant for the consumption of the client, not the RS :-(

From:<> [<>] On Behalf Of Igor Faynberg
Sent: Wednesday, June 20, 2012 2:39 PM

Subject: Re: [OAUTH-WG] Report an authentication issue

But this use case  does need OAuth, period:

The video server is under the control of a police agency, and police officers must logon to the video server in order to access video content.

There is no delegation here, and there is no need to use third party for authentication.


On 6/20/2012 3:26 PM, Justin Richer wrote:
In case it wasn't clear, I want to restate the original problem as best as I understand it in a way that hopefully clears it up:

App A and app B are both valid registered OAuth clients to an OAuth protected service.

The problem starts when app A gets handed a token that was issued for app B and uses it to call an identity API on the OAuth service. Since app B can get tokens just fine, they're bearer tokens, this is a fairly basic api call, this function works just fine and returns the user info. This makes sense, since anyone who holds A's tokens can do whatever A can do on behalf of that user. The issues start when app B then decides that since they can make a call to the identity API with a token then the user *must* be present. In other words, app B is confusing authorization to call an API with authentication of the session.

OpenID Connect fixes this missed assumption by binding the ID Token to the session and sending it along side the access token, but as you pointed out, it's meant for consumption at the client, not the resource server, in general. That doesn't mean you can't send it to a resource server for your own purposes, of course. That's actually how the session management endpoint works in Connect.

This isn't the only way to handle this problem -- if you put some structure in your tokens, such as with JWT or SAML, then app A can tell that this isn't a token issued to app A, but to app B, so it can call shenanigans and reject it then and there.

 -- Justin

On 06/20/2012 10:03 AM, Lewis Adam-CAL022 wrote:
I am entirely confused.

I understand what everybody is saying for confidential clients, no problem here.

I fall apart when thinking of iPhone apps.  Consider the scenario where I deploy a video server, and write an iPhone app to talk to the video server.  The video server is under the control of a police agency, and police officers must logon to the video server in order to access video content.  So the police office launches their iPhone video client app.

If I wanted to solve authentication using "traditional" client-server authentication, the user enters their username / password into the client, and the client sends the username / password off to the server, which authenticates it, or possibly uses HTTP digest.

If I wanted to use OpenID, the client would attempt to reach the video server (RP), the server would redirect the client to the OP, OP authenticates user, and OP redirects client back to the server/RP with an assertion that primary authentication was successful.

If I wanted to use OAuth, the client would send an authorization request to the server's AS, which would authenticate the user of the client, and ultimately result in the client possessing an access-token.  My thinking is that this access token (let's assume it's a JWT) would contain the user's identity, a statement of what type of primary authentication was used (auth context), an expiration, and an audience claim.  This sounds a lot like authentication to me, and it's where I get confused.  Is it just because OAuth does not explicitly define this?  Is there a threat in using OAuth as I describe?

If I wanted to use Connect, well I'm not even sure how the id_token as defined by Connect helps this use case.  The id_token seems to make sense when the client is a confidential web server, but it's not clear what an iPhone app would do with the id_token ... it's the server in the backend that needs to authenticate the user, the iPhone app is just an interface to talk to the server.  And it seems as I learn more about connect that the id_token is not meant to be sent from the iPhone app to the server, just the access token.  So it's really not clear how Connect helps solve authentication for an iPhone client app talking to a video server.  If I'm sending access-tokens, it's just OAuth again.

What am I still missing?

From:<> [] On Behalf Of Kristofor Selden
Sent: Saturday, June 16, 2012 11:33 AM
To: nov matake; oauth
Cc: Yuchen Zhou; Luke Melia; Shuo Chen (MSR)
Subject: Re: [OAUTH-WG] Report an authentication issue

Nov demonstrated the problem to us at Yapp and we used solution 4 (because the solution is server side and our app was in the app store).

FB Connect is authentication and authorization, where OAuth 2 is concerned only with authorization - I'm not sure that app developers appreciate this subtlety.

With OAuth 2 you authorize an app to use a protected resource.  With FB Connect, you do that, but also authenticate with the app you are authorizing.

So the access_token protects not just the FB resources but the auth end point of the authorized app (very common with apps that use the iOS SDK).  So now the app needs a way to verify that it was the app that was authorized to FB.

Solution 4 explanation: on FB you can register a iPhone app and a server app with the same client_id and get a client_secret for use on the server.  The server side API posts the access_token, client_id, and client_secret to<> to verify that the bearer token actually belongs to the app that is being authenticated before assuming they are authorized to the app's protected resources.


On Jun 15, 2012, at 8:22 PM, nov matake wrote:

There are 4 ways to fix this issue.

1. Use response_type=token%20code (It's not in OAuth 2.0 Core, but seems best way for interoperability)
2. Use singed_request (or some signed token like JWT)
3. Use grant_type=fb_exchange_token (Facebook custom way)
4. Access to (Facebook custom way, moreover undocumented API)

Two iPhone app developers I reported this issue fixed it by using (4).

I also tried to use (1) for my own iPhone app implementation, but unfortunately it doesn't work when using authorization codes obtained via FB iOS SDK.
So I'm using (3) in my case.


On 2012/06/16, at 9:16, Nat Sakimura wrote:

As to how the fix was done, Nov can provide more detail, but ...

1. Properly verify the signature/HMAC of the "signed_request". This will essentially audience restricts the token.
2. There is an undocumented API for Facebook which returns to whom the token was issued. This also audience restricts the token.

The service that fixed took these measures. Note that none of the above is defined in OAuth.
The same facility was called "id_token" and "check ID endpoint" for OpenID Connect.

The scale of the impact is large, too large to disclose the actual names in the public list, though, eventually, we would publish them in a paper.

On Sat, Jun 16, 2012 at 5:34 AM, Francisco Corella <<>> wrote:
Hi Nat and Rui,

Rui, you say that the vulnerability that you found was due to a
"common misunderstanding among developers", but the attack you
describe can be carried out against any app that uses the OAuth
"implicit grant flow", which Facebook calls "client-side
authentication".  No misunderstanding seems necessary.  What
misunderstanding are you referring to?  I followed the link in your
message to the Sophos post, and from there the link to the article in
The Register.  The article in The Register says that Facebook had
"fixed the vulnerability promptly".  How did they fix it?  The
instructions that Facebook provides for implementing "Client-side
authentication without the JS SDK" at
still allows the attack.

Nat, I agree that the blog post by John Bradley that you link to
refers to the same vulnerability reported by Rui.  You say that some
apps have issued a patch to fix it.  Could you explain what the fix


From: Nat Sakimura <<>>
To: rui wang <<>>
Cc: matake nov <<>>; Yuchen Zhou <<>>; oauth <<>>; Shuo Chen (MSR) <<>>
Sent: Thursday, June 14, 2012 1:50 PM
Subject: Re: [OAUTH-WG] Report an authentication issue

This is a fairly well known (hopefully by now) issue. We, at the OpenID Foundation, call it "access_token phishing" attack these days. See:

Nov Matake has actually built the code on iPhone to verify the problem, and has notified bunch of parties back in February including Facebook and Apple. We have the code that actually runs on a phone, and we have successfully logged in to bunch of apps, including very well known ones. They were all informed of the issue. Some immediately issued a patch to fix it while others have not.

The problem is that even if these apps gets fixed, the problem does not go away. As long as the attacker has the vulnerable version of the app, he still can impersonate the victim. To stop it, the server side has to completely disable the older version, which means the service has to cut off many users pausing business problems.

On Fri, Jun 15, 2012 at 2:18 AM, rui wang <<>> wrote:
Dear Facebook Security Team and OAuth Standard group,
We are a research team in Microsoft Research. In January, 2011, we reported a vulnerability in Facebook Connect which allowed everyone to sign into Facebook-secured relying parties without password. It was promptly fixed after reporting. (
Recently, we found a common misunderstanding among developers of mobile/metro apps when using OAuth (including Facebook's OAuth) for authentication. The vulnerability resulted from this misunderstanding also allows an attacker to log into a victim user's account without password.
Let's take Soluto's metro app as an example to describe the problem. The app supports Facebook Login. As an attacker, we can write a regular Facebook app. Once the victim user allows our app to access her Facebook data, we receive an access_token from the traffic. Then, on our own machine (i.e., the "attacker" machine), we run the metro app of Soluto, and use a HTTP proxy to insert the victim's access_token into the traffic of Facebook login. Through this way, we are able to log into the victim's Soluto account from our machine. Other than Soluto, we also have confirmed the same issue on another Windows 8 metro-app Givit.
The Facebook SDK for Android apps ( seems to have the possibility to mislead developers too. At least, the issue that we found is not clearly mentioned. In the SDK, we ran the sample code called "Hackbook" using Android Emulator (imagine it is an attacker device). Note that we have already received the access token of the victim user from our regular Facebook app. We then inject the token to the traffic of Hackbook. Through this way, Hackbook app on our own machine recognizes us as the victim. Note that this is not a convincing security exploit yet, because this sample code does not include the server-side code. However, given that we have seen real server-side code having this problem, such as Soluto, Givit and others, we do believe that the sample code can mislead mobile/metro developers. We also suspect that this may be a general issue of many OAuth implementations on mobile platforms, so we send this message to OAuth Standard group as well.
We have contacted the vendors of the two vulnerable metro-apps, Soluto and Gavit.
Please kindly give us an ack when you receive this message. If you want to know more details, please let us know.
Best Regards,
Yuchen Zhou, Rui Wang, and Shuo Chen

OAuth mailing list<>

Nat Sakimura (=nat)
Chairman, OpenID Foundation

OAuth mailing list<>

Nat Sakimura (=nat)
Chairman, OpenID Foundation

OAuth mailing list<>

OAuth mailing list<>


OAuth mailing list<>


OAuth mailing list<>

OAuth mailing list<>

Nat Sakimura (=nat)
Chairman, OpenID Foundation


OAuth mailing list<>

Nat Sakimura (=nat)
Chairman, OpenID Foundation