AllAboutBugBounty/OAuth Misconfiguration.md

25 lines
1.5 KiB
Markdown
Raw Normal View History

2021-07-21 15:38:57 +00:00
# OAuth Misconfiguration
2022-06-15 10:38:42 +00:00
## Introduction
The most infamous OAuth-based vulnerability is when the configuration of the OAuth service itself enables attackers to steal authorization codes or access tokens associated with other users accounts. By stealing a valid code or token, the attacker may be able to access the victim's account.
## Where to find
In the SSO feature. For example `Log in with google` or `Log in with facebook`.
## How to exploit
2022-06-15 10:38:42 +00:00
1. OAuth token stealing: Changing redirect_uri to attacker.com(Use IDN Homograph or common bypasses).
2. Change Referral header to attacker.com while requesting OAuth.
3. Create an account with victim@gmail.com with normal functionality. Create account with victim@gmail.com using OAuth functionality. Now try to login using previous credentials.
2021-07-21 15:38:57 +00:00
4. OAuth Token Re-use.
5. Missing or broken state parameter.
6. Lack of origin check.
7. Open Redirection on another endpoint > Use it in redirect_uri
8. If there is an email parameter after signin then try to change the email parameter to victim's one.
9. Try to remove email from the scope and add victim's email manually.
2022-06-15 10:38:42 +00:00
10. Only company's email is allowed? > Try to replace hd=company.com to hd=gmail.com
11. Check if its leaking client_secret parameter.
12. Go to the browser history and check if the token is there.
2021-07-21 15:43:05 +00:00
2022-06-15 10:38:42 +00:00
## References
* [tuhin1729_](https://twitter.com/tuhin1729_/status/1417843523177484292)
* [c0d3x27](https://infosecwriteups.com/the-oauth-misconfiguration-15e66dd19a6e)