Skip to content
OAuth / SSO Write-up Intermediate

Hacking Twitter @Anywhere's authentication

The author found that Twitter @Anywhere's OAuth 2 implementation stores a short-lived access token in the browser's localStorage, and that this token alone can be used to read and write a user's Twitter data. An attacker who obtains the token could act as the victim on Twitter.

blog.abrah.am

Published on blog.abrah.am

September 01, 2010

The author, on blog.abrah.am

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 design stored a bearer access token in client-side localStorage and treated it as sufficient for full account access, without additional binding or protection.

Impact

An attacker who obtains the token could read and write the victim's Twitter data until the short-lived token expires.

What the attacker needed

Victim uses an @Anywhere enabled site; attacker obtains the access token

How it was found

  1. Visit an @Anywhere enabled site and click the follow button to open the authentication popup.
  2. Log into Twitter and connect the @Anywhere application.
  3. Retrieve the oauth_access_token from the browser's localStorage using the JavaScript console.
  4. Use the token to make HTTP requests to api.twitter.com over SSL.

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.

OAuth is a way for apps to access your account without your password. Here, the app kept a temporary key in the browser, and that key was enough to post and read as the user. If someone stole the key, they could use the account until it expired.

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.

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.