1 Click Account Takeover | XSS | CORS Misconfiguration | JWT F
A CORS misconfiguration on an authentication API reflected the session cookie and allowed any origin, and an XSS on a subdomain could steal that cookie. Combined with a mass assignment flaw in a widget API, an attacker could forge a JWT and take over a victim's account.
Published on infosecwriteups.com
This finding was reported to a bug bounty program and is redacted because of the NDA.
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 authentication API reflected the session cookie and any Origin header without validation, and a widget API allowed mass assignment of a region field that bypassed duplicate-user checks, making JWT forgery possible.
Impact
An attacker could take over a victim's account by stealing their session cookie and forging a JWT, though the attack required a victim to visit a malicious site and an XSS on a subdomain.
What the attacker needed
Victim visits a malicious site; XSS on a subdomain; attacker can host a malicious site
The fix
The report recommends an origin allow-list, not reflecting session cookies, WAF protection for the XSS subdomain, sanitising or removing the vulnerable endpoint, and validating region and JTI attributes in JWTs.
How it was found
- Victim visits the attacker's malicious site.
- Victim is redirected to the subdomain vulnerable to XSS with the payload.
- The payload executes, fetches the victim's session cookie from the main API, and sends it to the attacker's server.
- The attacker creates a duplicate user in region EU using the mass assignment vulnerability.
- The attacker uses the stolen UUID and JWT to update the victim's email.
- The attacker uses the reset password endpoint to update the victim's password and take over the 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.
A website's login cookie is normally hidden from scripts to stop theft. Here, one API sent the cookie back in its response and also told browsers that any website was allowed to read it, so a malicious page could read the cookie. Separately, a script injection bug on a subdomain let an attacker run code in the victim's browser and send the cookie to their own server.
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.