Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8715931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:57:44+00:00 2026-06-13T05:57:44+00:00

From the OAuth 2.0 Threat Model and Security Considerations draft : 4.4.1.13. Threat: Code

  • 0

From the OAuth 2.0 Threat Model and Security Considerations draft:

4.4.1.13. Threat: Code substitution (OAuth Login)

An attacker could attempt to login to an application or web site
using a victim’s identity. Applications relying on identity data
provided by an OAuth protected service API to login users are
vulnerable to this threat. This pattern can be found in so-called
"social login" scenarios.

As a pre-requisite, a resource server offers an API to obtain
personal information about a user which could be interpreted as
having obtained a user identity. In this sense the client is
treating the resource server API as an "identity" API. A client
utilizes OAuth to obtain an access token for the identity API. It
then queries the identity API for an identifier and uses it to look
up its internal user account data (login). The client asssumes that
because it was able to obtain information about the user, that the
user has been authenticated.

If the client uses the grant type "code", the attacker needs to
gather a valid authorization code of the respective victim from the
same identity provider used by the target client application. The
attacker tricks the victim into login into a malicious app (which may
appear to be legitimate to the Identity Provider) using the same
identity provider as the target application. This results in the
Identity Provider’s authorization server issuing an authorization
code for the respective identity API. The malicious app then sends
this code to the attacker, which in turn triggers a login process
within the target application. The attacker now manipulates the
authorization response and substitutes their code (bound to their
identity) for the victim’s code. This code is then exchanged by the
client for an access token, which in turn is accepted by the identity
API since the audience, with respect to the resource server, is
correct. But since the identifier returned by the identity API is
determined by the identity in the access token (issued based on the
victim’s code), the attacker is logged into the target application
under the victim’s identity.

Impact: the attacker gains access to an application and user-specific
data within the application.

Countermeasures:

  • All clients must indicate their client id with every request to
    exchange an authorization code for an access token. The
    authorization server must validate whether the particular
    authorization code has been issued to the particular client. If
    possible, the client shall be authenticated beforehand.

  • Clients should use appropriate protocol, such as OpenID (cf.
    [openid]) or SAML (cf. [OASIS.sstc-saml-bindings-1.1]) to
    implement user login. Both support audience restrictions on
    clients.

This is rather confusing to me: «the attacker needs to gather a valid authorization code of the respective victim from the same identity provider used by the target client application». What’s "the respective victim" and what does "identity provider" mean in this and subsequent uses?

The whole attack description is obscure. I came to understand it as "one shouldn’t use OAuth 2.0 to implement user login", but wouldn’t that mean that major platforms such as Facebook are vulnerable? And vulnerable to what, exactly?

I probably only need a clarification of some of the terms used in this paragraph.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:57:45+00:00Added an answer on June 13, 2026 at 5:57 am

    I found the answer by myself. The wording in this section is a bit confusing, but the attack is quite simple. “Identity provider” is the name for the resource server used to verify the identity of an user.

    Basically it’s a case of using an authentication code issued for a client application to obtain an access token by a different application. I try to outline the steps in a clearer way.

    1. Attacker registers a malicious client (e.g. an app registered to Facebook).
    2. Victim user is tricked into logging into the malicious client using a “Login with third party” button (e.g. “Login into Facebook”) triggering OAuth 2.0 authorization_code flow.
    3. The malicious client gets the authorization_code.
    4. The attacker uses the just obtained authorization_code with another app and obtains access to that app as the victim user.

    Step 4 is only possible if authorization_codes aren’t bound to a specific client. Auth codes issued to a client can only be used by that same client to obtain an access token.

    Of course Facebook is not vulnerable, as this requires only a basic check from the authorization server to defeat.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On my MVC application I'm using some security features (OAuth) from WebMatrix. However, I
When I was redirected from the OAuth Dialog, my application URL looks like this.
I'm trying to get mail(imap) from google by oauth authorization . I have got
I'd like to do OAuth for Twitter from an iPhone app. But doing so
I'm using MPOAuthConnection for Cocoa oauth. I've updated the latest from SVN, built the
I'm using Oauth from sparks which is derived from kohana's Oauth implementation. I'm suceesfully
I'm storing the oauth info from Twitter in a Flash Cookie after the user
This is my code to take a photo from gallery or camera. I've implemented
Where should the token be saved after they are retrieved from a OAuth flow?
I need to connect to another web application using webservice. That web application uses

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.