Firefox for Android - Directory Traversal can lead to network hijacking
Firefox for Android accepted Intents from third-party apps and used a ContentProvider URI to fetch files, allowing writes into the app's private directory. By overwriting the profiles configuration and adding a user.js file, an attacker could change browser settings and hijack network traffic.
Originally disclosed on Mozilla
- Fixed in 20 days
- Paid in 20 days
- Disclosed after 20 days
Created attachment 9128841
poc.zip
It has been found the firefox android application accepts Intents from third-parties. When a crafted Intent containing a URI pointing to a custom-defined ContentProvider is sent, the application queries the ContentProvider to fetch files. This allows overwriting files under the private application folder.
By exploiting this vulnerability, it is possible to overwrite /data/data/org.mozilla.firefox/files/mozilla/profiles.ini and put a user.js file into the user's directory which can lead to network hijacking.
Vulnerability in this method:
org.mozilla.gecko.util.ContentUriUtils.getTempFilePathFromContentUri
Firefox Version: 68.5.0
Steps to reproduce:
1) see the screen record
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 app trusted a caller-supplied content URI and derived a destination path from it without validating that the resolved path stayed inside the intended temporary directory, allowing traversal into private storage.
Impact
An attacker could overwrite the browser's profile configuration and inject settings that lead to network hijacking; the report does not demonstrate the hijacking itself.
What the attacker needed
Malicious app installed on the device; Firefox for Android 68.5.0
How it was found
- Send a crafted Intent to Firefox for Android that points to an attacker-controlled ContentProvider.
- Firefox queries the ContentProvider and fetches the supplied file.
- The fetched file is written into the app's private directory, overwriting profiles.ini.
- Place a user.js file in the user's profile directory to alter browser settings.
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 receive messages called Intents from other apps. Firefox for Android trusted a file location supplied in such a message and copied files from it into its own private storage. Because of that, a malicious app could replace Firefox's settings files and redirect the user's browsing traffic.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.