In-depth lesson · OAuth state and CSRF
Tips for beginners
Every point the OAuth state and CSRF reports back under this heading, best-backed first, each with the reports it is seen in.
-
Start with account-linking settings pages and project import flows. These are the most common places in the evidence, and they are easy to reach with a normal account.
Seen in 3 reports
-
If state is present, look at what it stores. A redirect location, a user ID, or a decodable blob is not a CSRF token and should be reported as such.
Seen in 3 reports
-
First check whether a state parameter is present at all in the authorisation request. A missing state is the simplest finding and the easiest to demonstrate.
-
Compare state values across two logins or two accounts. If the value is the same within a time window, it is predictable and the protection is ineffective.
-
Test whether the server actually rejects a missing or modified state. Some servers check presence but accept requests where it is absent, and some comparisons stop at a null byte.
-
For linking flows, have the victim start the flow and abandon it, then send a callback containing your own code. If it completes, you have shown the impact directly.
-
Keep the code valid by dropping the request after capture, then deliver the callback from a page the victim visits. This is the standard way to show a cross-site completion.
Seen in 2 reports
-
On mobile, look at exported activities that handle OAuth or SSO redirects. If one republishes any received URI as a completed flow, that is a finding.
-
Show impact as account takeover or unwanted account linking, not just a missing parameter. A report with no demonstrated consequence is the most common mistake.
-
Stay in scope. Confirm the affected feature belongs to the target before testing, and avoid third-party provider infrastructure that the program does not cover.
-
Check redirect URI validation separately. Origin-only matching can be combined with an open redirect on the same domain to forward the code.
-
Capture a completed callback and try it in a second browser signed in to a different provider account. If the first browser ends up logged in as that account, the code is not bound to the session.
Seen in 1 report
-
$1,260
-
-
Check session cookie scope. Wildcard-domain cookies that any subdomain can set can undermine the OAuth check even when state exists.
Seen in 1 report
-
When a proof of concept fails because the SDK expects a postMessage or a language parameter, try initialising the SDK through a crafted URL first, then trigger the callback.
Seen in 1 report