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.
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:
- 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) :
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);
- Once open third-party app, Reddit app opens InAppBrowser with auth_active file and its data contained token.
- We could also reproduce this quickly using adb:
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
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
- 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.
- Launch the third-party app so the Reddit app opens its in-app browser showing that file and its token.
- 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.