OAuth account hijacking via redirect_uri
Date: 04, August, 2021
Author: Dhilip Sanjay S
Task
This lab uses an OAuth service to allow users to log in with their social media account.
A misconfiguration by the OAuth provider makes it possible for an attacker to steal authorization codes associated with other users' accounts.
To solve the lab, steal an authorization code associated with the admin user, then use it to access their account and delete Carlos.
The admin user will open anything you send from the exploit server and they always have an active session with the OAuth service.
You can log in with your own social media account using the following credentials:
wiener:peter
.
Solution
Understand the OAuth flow.
There is no validation on the
redirect_uri
.Create an iframe with the
redirect_uri
pointing to exploit server in the exploit server:
Open the Access log after delivering the exploit to victim.
You must have received the
/outh-callback
with the authorization code:
Copy the code.
Intercept the
/outh-callback
request and replace the code.Now you'll get access to admin panel:
Delete the
carlos
user to finish the lab!!
Last updated