Skip to main content
QUICK REVIEW

[Paper Review] A Comprehensive Formal Security Analysis of OAuth 2.0

Daniel Fett, R. Kuesters|arXiv (Cornell University)|Jan 6, 2016
Web Application Security VulnerabilitiesComputer Science21 references35 citations
TL;DR

This paper presents the first comprehensive formal security analysis of OAuth 2.0 using an expressive web model that captures real-world web interactions. It identifies four previously unknown attacks—307 Redirect, IdP Mix-Up, State Leak, and Naïve RP Session Integrity attacks—proposes fixes, and formally proves that the patched protocol achieves strong authorization, authentication, and session integrity under standard security best practices.

ABSTRACT

The OAuth 2.0 protocol is one of the most widely deployed authorization/single sign-on (SSO) protocols and also serves as the foundation for the new SSO standard OpenID Connect. Despite the popularity of OAuth, so far analysis efforts were mostly targeted at finding bugs in specific implementations and were based on formal models which abstract from many web features or did not provide a formal treatment at all. In this paper, we carry out the first extensive formal analysis of the OAuth 2.0 standard in an expressive web model. Our analysis aims at establishing strong authorization, authentication, and session integrity guarantees, for which we provide formal definitions. In our formal analysis, all four OAuth grant types (authorization code grant, implicit grant, resource owner password credentials grant, and the client credentials grant) are covered. They may even run simultaneously in the same and different relying parties and identity providers, where malicious relying parties, identity providers, and browsers are considered as well. Our modeling and analysis of the OAuth 2.0 standard assumes that security recommendations and best practices are followed, in order to avoid obvious and known attacks. When proving the security of OAuth in our model, we discovered four attacks which break the security of OAuth. The vulnerabilities can be exploited in practice and are present also in OpenID Connect. We propose fixes for the identified vulnerabilities, and then, for the first time, actually prove the security of OAuth in an expressive web model. In particular, we show that the fixed version of OAuth (with security recommendations and best practices in place) provides the authorization, authentication, and session integrity properties we specify.

Motivation & Objective

  • To provide a formal, comprehensive security analysis of the OAuth 2.0 standard in a realistic web model.
  • To define and formally verify strong security properties: authorization, authentication, and session integrity.
  • To identify and analyze previously unknown attacks in OAuth 2.0 and its derivative OpenID Connect.
  • To propose practical fixes for the discovered vulnerabilities and formally prove their effectiveness.
  • To establish that OAuth 2.0, when combined with security best practices, achieves strong security guarantees in a realistic threat model.

Proposed method

  • Developed the FKS web model to formally represent OAuth 2.0 interactions, including browsers, relying parties, identity providers, and network attackers.
  • Modeled all four OAuth 2.0 grant types (authorization code, implicit, resource owner password, client credentials) within the same formal framework.
  • Defined formal security properties: authorization (only authorized users access resources), authentication (users are correctly identified), and session integrity (session state is protected from tampering).
  • Formalized attacker capabilities to include malicious relying parties, identity providers, browsers, and network-level manipulation (e.g., DNS spoofing, 307 redirects).
  • Used symbolic execution and model checking techniques to verify that the fixed OAuth 2.0 protocol satisfies all defined security properties.
  • Proved security theorems using a structured proof outline, leveraging lemmas on event sequences, token handling, and state consistency across components.

Experimental results

Research questions

  • RQ1Can a formal model capture the full complexity of OAuth 2.0 interactions in a realistic web environment?
  • RQ2What are the formal definitions of strong authorization, authentication, and session integrity in the context of OAuth 2.0?
  • RQ3Which vulnerabilities in OAuth 2.0 and OpenID Connect can be formally identified and exploited under realistic threat models?
  • RQ4Do the proposed fixes for the identified vulnerabilities restore the intended security guarantees?
  • RQ5Is the patched version of OAuth 2.0 formally provably secure under the defined security properties and attacker model?

Key findings

  • Four new attacks were formally discovered: 307 Redirect, IdP Mix-Up, State Leak, and Naïve RP Session Integrity, all exploitable in practice and present in OpenID Connect.
  • The 307 Redirect attack allows an attacker to redirect a user’s authorization flow to a malicious identity provider by manipulating HTTP 307 redirects.
  • The IdP Mix-Up attack enables an attacker to impersonate a user by tricking the relying party into accepting a token from a different identity provider.
  • The State Leak attack arises when the state parameter is not properly validated, allowing session fixation and request forgery.
  • The Naïve RP Session Integrity attack occurs when a relying party fails to authenticate the origin of an access token, leading to session hijacking.
  • After applying the proposed fixes, the formal proof confirms that the enhanced OAuth 2.0 protocol satisfies all defined security properties: authorization, authentication, and session integrity.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.