Skip to content
Path traversal Disclosed report Intermediate

Fenix allows opening file: URLs with bypassing scheme validation through SEND intent

Fenix blocks file: URLs from other apps using a case-sensitive check, so an attacker can bypass it with mixed-case variants like filE:. If a victim shares such a crafted URL, the app may open a malicious HTML file in the Download directory and steal its contents.

Muneaki Nishimura Follow

Originally disclosed on Mozilla

  • Fixed in 9 days
  • Paid in 18 days
  • Disclosed after 9 days
Text
Created attachment 9169027
filE_demo.gif

Fenix wholly doesn't allow to open `file:` URLs from other application.
Fenix can receives shared URL string by SEND intent, but `file:` URLs are certainly ignored by following validation.
https://github.com/mozilla-mobile/android-components/blob/d7bf1058f08144949b751903b32821e8cf7f52f3/components/support/utils/src/main/java/mozilla/components/support/utils/WebURLFinder.kt#L115

But the validation above is case-sensitive, so attacker can bypass it with `filE:`, `FiLe:` and something like that.

If victim wrongly share a crafted `filE:` URLs from other applications, like SNS or SMS, and if already malicious HTML file has been in Download dir., attacker can steal whole data in Download dir. as described in https://bugzilla.mozilla.org/show_bug.cgi?id=1656747#c2 .

You can reproduce this attack easily by executing following `adb` command.
'''
adb shell am start -a android.intent.action.SEND --es android.intent.extra.TEXT "filE:///sdcard/Download" -t text/plain
'''

The original report as published on Mozilla's Bugzilla, by Muneaki Nishimura. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

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

The scheme validation compares the URL scheme case-sensitively, but URL schemes are case-insensitive, so mixed-case variants bypass the block.

Impact

An attacker could steal all data in the Download directory if the victim shares a crafted URL and a malicious HTML file is already present.

What the attacker needed

Malicious HTML file already in Download dir; victim shares crafted URL from another app

How it was found

  1. Ensure a malicious HTML file is already in the Download directory.
  2. Send a SEND intent with a mixed-case file: URL as the text extra.
  3. The victim shares the crafted URL from another app such as a messaging app.
  4. Fenix opens the file URL and the malicious HTML can access the Download directory.

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.

Apps often check links to stop dangerous ones like file: URLs, which can open local files. Here the check only looked for lowercase 'file:', so writing 'filE:' slipped past. If someone shares that link, the app might open a harmful file already on the phone and leak private data.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

More by Muneaki Nishimura

View all

74 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.