Skip to content
Account takeover Write-up Intermediate

Flickr ATO Fix Bypass

The fix for a Flickr account takeover bug restricted the redirect_uri to a specific directory, but an attacker could bypass it by appending a hash fragment and chaining an open redirect to steal the user's access token. This allowed one-click account takeover.

ronchan Follow

Published on ngailong.wordpress.com

ronchan Uncategorized August 7, 2017August 7, 2017 2 Minutes

ronchan, on ngailong.wordpress.com

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 redirect_uri validation only checked the path prefix and did not account for URL fragments or a secondary open redirect, allowing the token to be smuggled to an attacker-controlled domain.

Impact

An attacker could steal a user's Flickr access token and take over their account with a single click (or no click if the payload is embedded in an image source).

What the attacker needed

Victim clicks a link or loads a page with the payload; attacker has an open redirect on Flickr; attacker controls a website to receive the token

The fix

The open redirect on Flickr was fixed, and the redirect_uri validation should be strengthened to properly handle fragments and prevent chaining.

How it was found

  1. Craft a Yahoo login URL with a done parameter pointing to Flickr's signin/yahoo path and a redir parameter containing an open redirect on Flickr.
  2. Append a hash fragment to the URL so that the access token gets appended after the hash.
  3. The open redirect on Flickr redirects to the attacker's site, carrying the token in the fragment.
  4. The attacker's site receives the token and can use it to 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.

When you log in with Yahoo, Flickr receives a secret token that proves who you are. The original bug let an attacker trick Yahoo into sending that token to the wrong place. Yahoo tried to fix it by only allowing redirects to a certain folder, but the attacker found a way around that by adding a special character and using another open redirect on Flickr to forward the token to their own 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.

More by ronchan

View all

3 more disclosed reports, best first.

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.