Oauth - Attacks

Attack on Connect Request

Many sites let users connect to others (LinkedIn, Instagram, Twitter) via OAuth. Attackers can exploit this to link their fake accounts with a victim’s client account.

Steps

Attack on redirect_uri

Clients usually register specific redirect URIs. If an attacker finds an XSS flaw in a client domain, they can capture authorization codes.

Steps

CSRF on Authorization Response

An attacker can use CSRF to trick the victim into connecting the attacker’s fake provider account to the victim’s client account.

Steps

Access Token Reusage

OAuth requires unique access tokens, but some systems allow token reuse across clients, especially with implicit grants.

Steps

SSRF via Dynamic Client Registration

Some OAuth servers expose /register endpoints for dynamic client registration. Attackers can use this to trigger SSRF.

Example POST request

POST /connect/register HTTP/1.1
Content-Type: application/json
Host: server.certifiedhacker.com
Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJ...

{
 "application_type": "web app",
 "redirect_uris": ["https://client.certifiedhacker.com/callback"],
 "client_name": "Sample Test",
 "logo_uri": "https://client.certifiedhacker.com/logo.png",
 "subject_type": "pairwise",
 "sector_identifier_uri": "https://certifiedhacker.com/rdrct_uris.json",
 "token_endpoint_auth_method": "client_secret_basic",
 "jwks_uri": "https://client.certifiedhacker.com/public_keys.jwks",
 "contacts": ["[email protected]"],
 "request_uris": ["https://client.certifiedhacker.com/rf.txt"]
}

Vulnerable Parameters