How a messing Header Led to Account Takeover
The login page lacked framing protections, so it could be embedded invisibly in an attacker's page and a decoy button could trick a victim into clicking the Google sign-in button. The OAuth redirect handling also accepted an attacker-controlled redirect, so the completed login sent the victim's session token to the attacker's server, giving full account takeover.
medium.com
Published on medium.com
Modern web application are build on layer of authentication mechanism — Oauth, multi-factor authentication ( MFA ), CSRF protection, secure cookies etc.. with all these defence most compinies believe their login flow is secure.
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
Likely the login page sent no framing-protection headers and the OAuth callback did not strictly validate the redirect address, allowing a clickjacked login to deliver the session token to an attacker.
Impact
An attacker could take over a victim's account without a password or second factor, viewing personal details, addresses, order history, sessions, partial payment details and reward points.
What the attacker needed
Victim visits attacker page; victim clicks the decoy button; login page allows framing; OAuth redirect not strictly validated
How it was found
- Check the login page response headers and note that framing protections are absent.
- Build a page that loads the real login page in an invisible frame with a decoy button over the sign-in button.
- Test the OAuth parameters and find that the redirect address is not strictly validated.
- Have the victim visit the page and click the decoy, which triggers the hidden sign-in.
- After the flow completes, the victim is redirected to the attacker's server with the session token.
- Extract the session cookie from the logged request and use it to access the victim's account.
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.
Some sites can be loaded inside another site's page in a hidden frame. If the site does not forbid this, an attacker can put an invisible copy of the login page under a fake button, so a click lands on the real sign-in button. Separately, the sign-in flow accepted a redirect address chosen by the attacker, so after login the browser was sent to the attacker's site carrying the session token, which is the value that keeps you logged in.
What is UI spoofing?
The interface lies to the user: a framed page catches their clicks, or a browser shows the wrong address or a fake prompt. Paid when it leads to a sensitive action or convincing phishing.