Skip to content
OAuth / SSO Write-up Intermediate

Stealing Facebook MailChimp Application OAuth 2.0 Access Token

The Facebook MailChimp OAuth 2.0 integration returned the access token in the URL fragment, and a crafted Facebook recovery URL could be used to carry that fragment to an attacker-controlled app. An attacker could trick a victim into authorising the app and capture the MailChimp access token, letting them read the victim's MailChimp data.

Meta

Published on medium.com

This post is about an bug that i found on Facebook MailChimp Application OAuth 2.0 which could have been used to steal Accesstoken. and The Source idea for this bug i got from prakharprasad blog post.

Lokesh Kumar, on medium.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 OAuth implicit flow returned the access token in the URL fragment, and a Facebook page that preserved and forwarded fragments allowed the token to reach an attacker-chosen destination.

Impact

A victim who clicked the crafted link and authorised the app could have their MailChimp access token stolen, giving the attacker access to the victim's MailChimp data.

What the attacker needed

Victim clicks a crafted link; victim logs in and authorises the app; attacker has a Facebook app

The fix

The fragment-based redirection was stopped on the recovery page so the token could no longer be forwarded to another path, and Facebook fixed it.

How it was found

  1. Open the MailChimp OAuth authorisation URL for the Facebook Custom Audiences app and note the token returned in the fragment.
  2. Try to change the redirect_uri and observe that it is rejected.
  3. Log out of Facebook and see that the flow is forced to the login page, where the fragment is dropped.
  4. Find a Facebook recovery URL that skips the default login page and still keeps the fragment.
  5. Build a MailChimp OAuth URL whose redirect_uri points at the attacker's Facebook app, shorten it, and wrap it in the recovery URL.
  6. Have the victim click the link, log in, and observe the access token arriving at the attacker's app URL.

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 let one website use your account on another site, it hands back a temporary pass (a token) that proves you said yes. Here that pass was placed in the part of the web address after a hash symbol, and a specially built Facebook link could carry it onward to a page the attacker controlled. Anyone who clicked the link and logged in could have their pass stolen.

What is OAuth / SSO?

Mistakes in OAuth, OpenID Connect, SAML or token handling that leak codes and tokens or link an attacker's identity to a victim's account.

More from Meta

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

OAuth and single sign-on flaws

The lesson behind this report.

Mistakes in OAuth, OpenID Connect, SAML or token handling that leak codes and tokens or link an attacker's identity to a victim's account.