Authentication bypass via OAuth implicit flow
This lab uses an
OAuth service to allow users to log in with their social media account. Flawed validation by the client application makes it possible for an attacker to log in to other users’ accounts without knowing their password.
Reproduction and proof of concept
While proxying traffic through Burp, click My account and complete the OAuth login process with
wiener:peter. Afterwards, you will be redirected back to the blog website.
In Burp, go to Proxy -> HTTP history and study the requests and responses that make up the OAuth flow. This starts from the authorisation request
Notice that the client application (the blog website) receives some basic information about the user from the OAuth service. It then logs the user in by sending a POST request containing this information to its own
/authenticateendpoint, along with the access token.
POST /authenticaterequest to Burp Repeater. In Repeater, change the email address to
firstname.lastname@example.org send the request. Observe that you do not encounter an error.
Right-click on the
POSTrequest and select Request in browser -> In original session. Copy this URL and visit it in your browser. You are logged in as Carlos and the lab is solved.
An attacker will need to log in; know carlos’ email address (
email@example.com) and abuse the vulnerability to log in to Carlos’s account.