Arbitrary File Corruption: End to End Encrypted Messaging Application
The messaging app failed to sanitise URIs returned from implicit intents such as PICK, allowing a malicious app to supply a file:// URI pointing to the app's private database. The attacker could then copy or send that database and sandbox files to public storage.
Published on nmochea.medium.com
In this write-up, I’ll tell you how I was able to Exfiltrate Database and Sandbox Files on End-to-End Encrypted Messaging Application.
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
The app did not validate or sanitise the URI returned by an implicit intent before using it to read files.
Impact
An attacker could steal the app's database and sandbox files by copying them to public storage or sending them elsewhere.
What the attacker needed
Malicious app installed on the device; victim uses the messaging app
The fix
The app should sanitise and validate URIs returned from intents before using them to access files; the report states the issue was patched.
How it was found
- The messaging app launches an implicit PICK intent and waits for a result.
- A malicious app receives the intent and returns a file:// URI pointing to the messaging app's private database.
- The messaging app receives the result in onActivityResult and reads the file from its own local file system.
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.
Android apps can ask other apps to pick a file for them using an 'intent'. The vulnerable app trusted whatever file location the other app sent back, without checking it. A malicious app could therefore hand back a location inside the messaging app's own private storage, and the messaging app would read and share its own secret database.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.