Skip to content
Account takeover Write-up Intermediate

Careful when hosting 3rd party apps on subdomains, or how I hacked Facebook

A third-party service allowed an attacker to claim a previously used subdomain without verification, and the service's session cookies were not scoped to individual subdomains. An attacker could set the document domain to the parent domain and hijack a victim's session on the main site.

gdeglin.blogspot.com

Published on gdeglin.blogspot.com

The original lives on gdeglin.blogspot.com

We do not hold its text, 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 third-party service did not verify domain ownership and used session cookies that were valid across all subdomains, allowing a malicious subdomain to access the parent domain's cookies.

Impact

An attacker could hijack a victim's session on the main site, potentially taking over their account.

What the attacker needed

A paid UserVoice account; victim visits the malicious subdomain

How it was found

  1. Signed up for a UserVoice account.
  2. Purchased the most expensive plan with a trial.
  3. Configured the account to use the previously active feedback.developers.facebook.com domain.
  4. Wrote a proof of concept that set document.domain to facebook.com and hijacked the user's session.

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 people host feedback pages on its own subdomains. The attacker signed up for a paid account and took over an old subdomain that still belonged to Facebook. Because the login cookie worked across all subdomains, the attacker could steal a visitor's session on the main Facebook site.

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.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.