OAuth access_token stealing in Phabricator
The Facebook OAuth flow used by Phabricator allowed a crafted link to send the victim's Facebook access token to the attacker's server.
Originally disclosed on HackerOne
- Fixed in 2 days
- Paid in 2 days
- Disclosed after 32 days
Hi,
I found that an attacker is able to steal access_tokens of facebook users via Phabricator App (184510521580034).
when users login to phabricator, they can choose to login via Facebook (https://secure.phabricator.com/login/) attaching pic, In this case an attacker is able to exploit this behavior to steal facebook access_tokens via phabricator app.
Full Reproduce, Exploit:
- Create a blog on phabricator https://secure.phabricator.com/phame/blog/new/
and provide a custom domain, in this case: files.nirgoldshlager.com
- send a malicious link to the victim: https://www.facebook.com/dialog/oauth?client_id=184510521580034&response_type=token&redirect_uri=https://secure.phabricator.com/phame/live/47/ , Click Continue
when the victim will click continue, his access token will be send to my malicious server, saved in a log file under: http://files.nirgoldshlager.com
PoC Video:
https://drive.google.com/file/d/0B2-5ltUODX1LWHV6R3gxSFAwNzQ/edit?usp=sharing
Attachments

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the OAuth redirect_uri was not strictly validated against the registered callback, allowing a user-controlled custom blog domain to receive the token.
Impact
An attacker could steal a victim's Facebook access token.
What the attacker needed
Attacker can create a Phabricator blog; attacker controls a custom domain; victim clicks the crafted link and continues
How it was found
- Create a blog on Phabricator and give it a custom domain controlled by the attacker.
- Send the victim a Facebook OAuth link whose redirect_uri points to the Phabricator blog path.
- The victim clicks Continue and the access token is sent to the attacker's server and logged.
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 report has not been written yet. The Original tab links to the source.
The report shows the website let the token be sent to an address an attacker controlled, so the attacker received the secret.
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.