Skip to content

Bug class · Advanced

OAuth and single sign-on flaws

Mistakes in OAuth, OpenID Connect, SAML or token handling that leak codes and tokens or link an attacker's identity to a victim's account.

median public bounty
$3,375

Covers CWE 346, 601.

How it works

Full lesson

The pattern behind every report in this class.

OAuth and single sign-on (SSO) flaws are among the most impactful bugs in bug bounty programmes because they often lead directly to account takeover. When an authorisation server mishandles redirect URIs, tokens, or SAML assertions, an attacker can steal a victim's credentials or session and act as them. Programmes care deeply about these issues because a single flaw can compromise many users at once, and the affected systems are often central to authentication across an entire platform.

These flaws typically lead to unauthorised access to user accounts, data exposure, and in some cases full administrative control. Common outcomes include stealing OAuth tokens or authorisation codes, bypassing consent screens, forging SAML assertions to log in as arbitrary users, and persisting sessions after logout. The evidence shows reports ranging from token leakage through third-party integrations to complete authentication bypasses in SAML flows.

OAuth and SSO issues are most often found in features that involve third-party integrations, social login, and enterprise SSO. Specific areas include device authorisation pages, group-level OAuth application management, SAML login endpoints, session cookies tied to OAuth profiles, and redirect handling after authentication. Public-facing government sites and platforms that allow custom OAuth clients are also frequent targets.

OAuth flows rely on redirects to pass authorisation codes or tokens between the authorisation server and the client application. If the redirect URI validation is weak, an attacker can manipulate it to send the code or token to a domain they control. Common weaknesses include accepting any path on a whitelisted domain, allowing path traversal, or permitting wildcard subdomains. This enables token theft and subsequent account takeover.

Things to try

All 111

Each line worked in a disclosed report. Test only what a program's scope allows.

Third-party integrations and token leakage 30

  • Check whether a Facebook OAuth token can be leaked through a GitLab integration.
  • Check whether a Microsoft OAuth misconfiguration allows full account takeover.
  • Check whether a Facebook OAuth token can be leaked through a Twitter integration.
  • Check whether a Facebook OAuth token can be leaked through a Shopify integration.

Redirect URI validation and bypass 19

  • Test whether the OAuth redirect_uri accepts any path on the whitelisted domain rather than an exact URL.
  • Use path traversal segments inside the redirect_uri to escape the intended path and land the code on an attacker-controlled page.
  • Chain a permissive redirect_uri with an open redirect on a subdomain to carry the token to an attacker site.
  • Point the redirect_uri at a page that contains an external link and check whether the authorisation code leaks in the Referer header.

Authorisation code and token lifecycle 12

  • Change the response_type to token on the authorisation request and check whether the access token is returned to the redirect target.
  • Present a third-party OAuth token to the session-bridge endpoint and check whether it mints a full web session for the token's user.
  • After minting a session through the bridge, check whether account settings can be changed and whether the session persists.
  • Check whether a stolen UUID code can be used to impersonate a user in Keycloak.

OAuth client registration and consent 12

  • Check whether the OAuth flow issues authorisation codes to users with unverified email addresses.
  • Send a direct POST to the OAuth authorisation endpoint with an unverified email and check whether the verification prompt is bypassed.
  • Check whether the OAuth permission screen accurately reflects the scopes actually granted to the token.
  • Check whether the OAuth application creation form validates the scopes parameter against a whitelist.

SAML assertion and signature handling 11

  • Send a forged or manipulated SAML response to test whether the assertion or signature is validated at all.
  • Send a SAML response with the signature element omitted to the ACS endpoint and see whether it is accepted.
  • Modify the SAML assertion and supply a matching digest outside the signed region to see whether the signature check is bypassed.
  • Test whether the SAML library selects DigestValue and Reference elements from anywhere in the document rather than only within SignedInfo.

Typical fixes

  • Delete or mark the authorisation-code row on exchange and check the code's own expiry column rather than a client-supplied lifetime.
  • Ensure the validated signature covers the exact response or assertion elements used for authentication.
  • Require proof of ownership of redirect URIs at client registration and disable the implicit grant.

Tips for beginners

All 13
  • Start by mapping all OAuth and SSO flows in the target application. Look for social logins, third-party integrations, and enterprise SSO endpoints. Use a proxy to intercept requests and understand how redirect URIs, state parameters, and tokens are handled.
  • Test redirect URI validation thoroughly. Try adding paths, query parameters, fragments, and path traversal sequences to see if the server accepts them. Also test with different subdomains, including non-existent ones, and check if the authorisation code or token is sent to your controlled domain.
  • Check for missing or weak state parameters. If the state parameter is absent or not validated, you may be able to perform CSRF attacks to link your account to a victim's or replay a callback in another session.
  • Examine the authorisation code exchange process. Try replaying a code to see if it can be used more than once. Check if the code expires and if it is bound to the client. Also test if tokens issued for one client are accepted by another service.
  • For SAML, test for signature validation bypasses. Try removing the signature, wrapping assertions, or modifying the signed elements. Check if the application accepts unsigned assertions or if the signature is not bound to the correct elements.
  • Review consent screens and scopes. Ensure that all requested scopes are displayed and that the application does not grant more permissions than shown. Test if you can inject text into the scopes parameter or bypass consent entirely.

Start here: a reading path

Open the path

Clear reports in order, easiest first.

Guides and techniques

View all

The best explainers, cheat sheets and technique posts on OAuth / SSO, from around the web.

Newest reports

All 352

Most recently disclosed.

New OAuth / SSO reports by email

Follow OAuth / SSO and get each week's new disclosures in one short email.

Free. New reports for what you follow, weekly by default. One-click unsubscribe. Privacy