I Didn’t Hack OAuth -I Just Clicked ‘Login’ Eight Times.
The OAuth state cookie grew without bound because each new login request nested the previous cookie inside a 'previous' field, eventually exceeding the browser's 4KB limit and being silently discarded. An attacker could force a victim's browser to make eight requests to the login endpoint, causing the cookie to be dropped and breaking subsequent OAuth logins.
Published on medium.com
It’s a normal afternoon. My coffee has gone cold.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The server stored the entire previous state cookie inside a new 'previous' field on each login request, causing unbounded growth instead of replacing the cookie.
Impact
An attacker could cause a victim's OAuth state cookie to be discarded, leading to silent authentication failures and preventing the victim from logging in via OAuth.
What the attacker needed
Victim visits attacker-controlled page; attacker can host a webpage; no authentication required
The fix
The server should replace the state cookie on each request instead of nesting previous states, and set a short expiry (e.g., max_age=600).
How it was found
- Visit the OAuth login endpoint repeatedly without completing the flow.
- Observe the Set-Cookie header growing with each request as previous states are nested.
- After eight requests, the cookie exceeds 4096 bytes and the browser discards it.
- The victim then attempts to log in via OAuth and receives a state mismatch error.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
When you log in with Google, the website gives your browser a small piece of data called a cookie to remember that you started the login. This website kept adding to that cookie every time you clicked login, making it bigger and bigger. Eventually the cookie got so big that the browser threw it away, and then you couldn't log in anymore because the website couldn't find the cookie it needed.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.