Stealing cookies from subdomain leads to takeover user accounts at redacted.com
An authentication cookie was shared across all subdomains, and a subdomain's code playground allowed JavaScript injection. An attacker could steal the cookie via a crafted URL and use it to access the victim's dashboard account.
Published on web.archive.org
Hi , I’m Bijan (0xBijan) , today I’m gonna share one of my finding on ATO bugs .
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 cookie was scoped to the parent domain and a subdomain's code playground allowed script injection without adequate filtering.
Impact
An attacker could steal a logged-in user's authentication token and access their dashboard account, including API tokens; no CSP was implemented to block the attack.
What the attacker needed
Victim is logged into dashboard.redacted.com; victim clicks a crafted link; attacker has a server to receive data
How it was found
- Log in to dashboard.redacted.com and observe the auth token in the unifiedDashboardAuth cookie.
- Find a subdomain with a code component playground that allows JavaScript injection.
- Create a malicious code component that sends document.cookie to an attacker-controlled server.
- Copy the URL of the created component and send it to a logged-in victim.
- Receive the stolen cookie containing the victim's auth token.
- Use the token in the Authorization header to make requests and 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.
When you log in, the site gives your browser a secret token (a cookie) that proves who you are. This token was valid on every subdomain, and one subdomain let users run their own code. An attacker could make a link that runs code to copy the token and send it to themselves, then use it to log in as the victim.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.