Skip to content

In-depth lesson · OAuth state and CSRF

Root causes

Every point the OAuth state and CSRF reports back under this heading, best-backed first, each with the reports it is seen in.

Back to the lesson 1 to 12 of 12
  1. The authorisation request was built without a state parameter, so no anti-CSRF token bound the callback to the user's session.

    Seen in 1 report
  2. No per-session state value tied the authorisation request to the browser that started it, so a completed callback could be replayed into another session.

    Seen in 1 report
  3. The state parameter was used to store a redirect location instead of a CSRF token, so it could be edited to send the token elsewhere after login.

    Seen in 1 report
  4. The state parameter was predictable, being identical for all users within a time frame.

    Seen in 1 report
  5. The authorisation code was not bound to the user's session, so an attacker's code could be injected into a victim's pending flow.

    Seen in 1 report
  6. The server checked that a state parameter was present but did not reject requests where it was missing.

    Seen in 1 report
  7. The module did not generate or validate a random state parameter and its callback endpoint was reachable by most authenticated users.

    Seen in 1 report
  8. The redirect-handling activity republished any received URI as a completed flow without checking state, PKCE verifier or caller identity.

    Seen in 1 report
  9. The state parameter was set to a predictable, persistent user ID instead of a random unguessable value.

    Seen in 1 report
  10. The state parameter was a client-controlled, decodable blob whose field told client-side JavaScript where to send the authorisation code, with no client allow-list.

    Seen in 1 report
  11. Session cookies scoped to the wildcard domain let any subdomain, including user-controlled ones, read and set them.

    Seen in 1 report
  12. The OAuth token was not invalidated or re-checked against the user's current permissions when the callback URL was used.

    Seen in 1 report