Skip to content
Info disclosure Disclosed report Intermediate

Third party app could steal access token as well as protected files using inAppBrowser

The Reddit Android app's deep link handler did not validate the scheme or host of incoming URLs and passed them to an in-app browser that could read the app's private files. A malicious third-party app could therefore open a local file path and expose the stored session token and other protected data.

Rahul Kankrale Follow

Originally disclosed on HackerOne

  • Triaged in 19 days
  • Fixed in 36 days
  • Paid in 36 days
  • Disclosed after 8 months

Summary:

Reddit android app version : 2021.8.0 OS: Android 11

This app uses com.reddit.frontpage.RedditDeepLinkActivity class to route app links including deeplink and reddit.com links while this class does not check for scheme, host and it opens given url in InAppBrowser and IAB have access to apps private/protected files.

So any third party app could steal session token from "data/data/com.reddit.frontpage/shared_prefs/com.reddit.auth_active.UserName.xml" files as well as rest of sensitive files like DB, Cookies etc.

Impact:

Third party app could steal access token as well as protected files using inAppBrowser

Steps To Reproduce:

To reproduce this issue I have created basic poc:

  1. Create third-party app using snippet (Replace UserName to victims username i.e. file:///data/data/com.reddit.frontpage/shared_prefs/com.reddit.auth_active.Strong-Sun628.xml) :
Java
        Intent intent = new Intent();
        intent.setClassName("com.reddit.frontpage", "com.reddit.frontpage.RedditDeepLinkActivity");
        intent.setData(Uri.parse("file:///data/data/com.reddit.frontpage/shared_prefs/com.reddit.auth_active.UserName.xml"));
        startActivity(intent);
  1. Once open third-party app, Reddit app opens InAppBrowser with auth_active file and its data contained token.
  2. We could also reproduce this quickly using adb:
Shell
adb shell am start -n "com.reddit.frontpage/com.reddit.frontpage.RedditDeepLinkActivity" -d "file:///data/data/com.reddit.frontpage/shared_prefs/com.reddit.frontpage_preferences.xml"

Supporting Material/References:

Video : Proof of concept

  • F1225199

if required I can submit complete POC to show how third-party app could save this files and send to attackers server.

Thanks Rahul

Impact

Third party app could steal access token as well as protected files using inAppBrowser

Attachments

reddit.mp4 From the original on HackerOne

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

Likely the deep link activity trusted the incoming intent data without validating the URI scheme and host, and the in-app browser was allowed to load local file:// paths.

What the attacker needed

Malicious app installed on the device; Reddit app version 2021.8.0 on Android 11

How it was found

  1. Build a small third-party app that sends an intent to the Reddit deep link activity with a file path to the auth preferences file.
  2. Launch the third-party app so the Reddit app opens its in-app browser showing that file and its token.
  3. Alternatively run an adb command that starts the same activity with a file path to the preferences 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 can be started by other apps through messages called intents. This app accepted such a message and opened whatever address it contained, including a path to its own private storage, so another app could make it display secret files.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More by Rahul Kankrale

View all

1 more disclosed report, best first.

More from Reddit

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.