Skip to content
Access control Disclosed report Intermediate

Read-only application can publish/delete fleets

The Fleet API endpoints for creating and deleting fleets did not check whether the calling application had write permission. A read-only third-party application could therefore publish or delete fleets on behalf of the user.

ryotak Follow

Originally disclosed on HackerOne

  • Triaged in 36 hours
  • Fixed in 5 days
  • Paid in 32 days
  • Disclosed after 53 days

Summary by the researcher

If you want to read my write-up in Japanese, you can visit my blog.

TL;DR

I found a flaw that allows a read-only application to publish/delete fleets while creating an unofficial API document for the Fleet API.

New feature - Fleet

Twitter released a feature named Fleet in Japan on November 10th. A day later, I got an update for my Twitter for Android. Since I was bored and trying to find something to do, I decided to reverse engineer it.

Try to analyze

Twitter for Android is written in Java like a normal Android app, and although it is obfuscated, it is not so difficult to analyze. Therefore, I decompiled it using [apktool] (https://ibotpeaches.github.io/Apktool/),[dex2jar] (https://github.com/pxb1988/dex2jar), and [CFR] (https://www.benf.org/other/cfr/) to make it somewhat readable state. (I won't go into the details of decompiling here, but if you google it, many resources will come out, so please refer to that.) We can't analyze the API without knowing the endpoint name, so I used grep to find the .java file that contains the string fleet, then I found a file that contains /fleets/v1/user_fleets. When I examined the files in the same directory, I found other strings that seemed to be other endpoints, so I analyzed them and wrote the documentation in Gist.

During verification...

After that, while checking the contents of Gist, I found that hitting the fleet-related API while authenticating as a third-party application worked fine. I thought "Isn't this good news for the creators of unofficial Twitter clients?", so I wrote more detailed API documentation. Before publishing, I was verifying that the contents of this Gist are correct, but when I sent a request to POST /fleets/v1/create as an application with only read permission, a fleet was created.

Is this a vulnerability?

At first, I thought that I had accidentally given write permission to my application, so I checked the permission, but apparently, only read permission was given. At this point, I started thinking "is this a vulnerability?", but I couldn't confirm it, so I decided to investigate a little deeper. As a result, in the normal Twitter API (POST /1.1/statuses/update.json, etc.), the permission of the application was checked before the API processing started (it is natural), but apparently, the fleet-related endpoint wasn't. It turns out that these APIs do not perform permission checks.

JSON
{
     "request": "\/1.1\/statuses\/update.json",
     "error": "Read-only application cannot POST."
}

Let's report it!

Since it turned out to be a vulnerability, I decided to postpone the release of the fleet-related API document and reported it to Twitter. The report was made on November 12th, and it was fixed on November 18th (I think it was actually a few days before the 18th), which was a very impressive remediation speed. Unfortunately, the fact that the fleet-related API could be used by a third-party application itself was a problem, and it was fixed by changing the fleet-related API so that it would not be hit by a third-party application anymore :(

After the report

Three days after Twitter fixed the vulnerability, there was a person who analyzed the fleet's API and tweeted that the fleet's image was not deleted from the CDN even after 24 hours. As it looks like the period that could be used to implement the fleet function was very short, I felt sorry for the developer inside Twitter.

Conclusion

This report shows the importance of constantly checking for new features and that even the large companies create vulnerabilities. If you have any questions, send a message to @ryotkak on Twitter.

The report

Summary:

Twitter released Fleet yesterday. This feature is working with few APIs, and these APIs are missing permission checks.

Description:

In /fleets/v1/create of https://api.twitter.com, there is no check to whether if the application has permission to write to the account. /fleets/v1/delete has also this issue.

Steps To Reproduce:

  1. Install twurl.
  2. Authenticate as a read-only application.
  3. Execute following command: twurl /fleets/v1/create -X POST --header 'Content-Type: application/json' -d '{"text":"Hey yo"}'
  4. A fleet with Hey yo text will be created.

Supporting Material/References:

2020-11-12_21-28-47.mp4 From the original on HackerOne

Impact

The read-only application can publish fleets without getting Write permission. This issue has a similar impact to #434763

The original report as published on HackerOne, by ryotak. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

The Fleet API endpoints lacked the application permission check that other write endpoints perform before processing the request.

Impact

A read-only application could publish fleets without write permission, and the delete endpoint had the same flaw, so it could also delete fleets.

What the attacker needed

A third-party app with read-only access; user authorises that app

The fix

Twitter fixed it by changing the Fleet API so that third-party applications can no longer call it at all.

How it was found

  1. Install the twurl command-line tool.
  2. Authenticate twurl as an application that has only read permission.
  3. Send a POST request to the fleet create endpoint with a JSON body containing text.
  4. Observe that a fleet with that text is created.

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.

When you let another app use your Twitter account, you choose what it can do, such as read only or read and write. Twitter is supposed to enforce that choice on its servers. Here, the new Fleet feature forgot to check, so a read-only app could still post and delete fleets.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by ryotak

View all

23 more disclosed reports, best first.

More from X / xAI

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.