Skip to content
Info disclosure Write-up Intermediate

Exploiting an Insecure Android Activity for Arbitrary File Theft

An exported Android activity accepted an unvalidated URL and loaded it into a WebView with file access enabled, allowing a local file to be displayed. An attacker could steal cleartext authentication tokens from the app's private storage and take over the account.

Yousef Elsheikh Follow

Published on medium.com

Hello folks, My name is Youssef Elsheikh, AKA NeM0x00. I’m interested in Android security apps.

Yousef Elsheikh, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the exported activity passed an untrusted URL directly to a WebView that had file access enabled, and sensitive tokens were stored in cleartext.

Impact

An attacker could steal authentication and refresh tokens, leading to full account takeover and access to personal and financial data.

What the attacker needed

Victim installs a malicious app; malicious app runs in background; target app has exported activity

The fix

The app should disable file access in the WebView, validate the URL against a trusted domain, avoid exporting the activity unnecessarily, and store tokens encrypted.

How it was found

  1. Use adb to launch the exported CheckoutActivity with an external URL to confirm the WebView can be controlled.
  2. Inspect the app's private data directory and find PersistedInstallation.json containing cleartext tokens.
  3. Create a test app that starts CheckoutActivity with a file:// URL pointing to that JSON file.
  4. The target app opens and renders the file contents in its WebView.
  5. The attacker app captures the displayed tokens using accessibility services or screenshots.

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 write-up has not been written yet. The Original tab links to the source.

An Android app can have parts called activities that other apps on the phone are allowed to start. This app had a checkout activity that took a web address from whoever started it and showed it in a built-in browser view. Because that view was allowed to open local files, another app could make it show a private file containing login tokens, which the attacker could then read.

What is Info disclosure?

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

More by Yousef Elsheikh

View all

2 more disclosed reports, best first.

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.