One Endpoint, Two Account Takeovers
A TV login-by-QR-code flow let an attacker verify their own login token by making a logged-in victim load a hidden iframe, giving the attacker the victim's session. After a confirmation button was added, the same endpoint still accepted cross-site form posts with a null Origin, so the takeover was possible again.
Published on web.archive.org
Posted onAugust 24, 2021August 27, 2021 by YShahinzadeh
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-by-code flow confirmed a token without any action or proof tied to the victim, and the later confirmation endpoint relied on custom headers and Origin checks that could be dropped or spoofed with a null value.
Impact
An attacker could take over the account of any logged-in user who visited the attacker's page; the first version needed no interaction beyond loading the page, and the bypass needed the victim to load a crafted page while logged in.
What the attacker needed
Victim logged in to the main site; victim visits attacker's page; attacker has an account
The fix
The flow should require a genuine user confirmation tied to the session, with a CSRF token, mandatory custom headers, strict content-type handling and a properly whitelisted Origin that rejects null; the text says the first issue was patched but the patch was incomplete.
How it was found
- Attacker opens the site and clicks the login-by-code button to get a QR code and token.
- Attacker scans the QR code and extracts the login link containing the token.
- Attacker puts the login link in a hidden iframe on their own page.
- Victim, logged in to the main site, visits the attacker's page, the token becomes verified and the attacker gains the account.
- After the patch, attacker removes the custom headers and switches the content type to a simple form type.
- Attacker sends the confirmation from a page with a null Origin, which the server accepts.
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.
A website let you log in on a TV by scanning a code with your phone. The attacker made their own code and hid the confirmation link in a page; when a logged-in victim opened that page, the victim's browser confirmed the attacker's code, so the attacker ended up logged in as the victim. The fix added a button to confirm, but the server still accepted the confirmation from other websites, so the trick worked again.
What is Account takeover?
Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.