Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

[Bug] Cannot browse to file:// URIs #4049

Closed
emilio opened this issue Jul 14, 2019 · 46 comments
Closed

[Bug] Cannot browse to file:// URIs #4049

emilio opened this issue Jul 14, 2019 · 46 comments
Labels
🐞 bug Crashes, Something isn't working, ..

Comments

@emilio
Copy link
Contributor

emilio commented Jul 14, 2019

Steps to reproduce

Expected behavior

  • File is opened, and I can view it.

Actual behavior

  • Searches for file://your-file

┆Issue is synchronized with this Jira Task

@emilio emilio added the 🐞 bug Crashes, Something isn't working, .. label Jul 14, 2019
@kbrosnan
Copy link
Contributor

I doubt we want to fix this. Not having this feature stopped 1558299 from working in Fenix. I am removing that ability from Firefox for Android in 1563422.

@emilio
Copy link
Contributor Author

emilio commented Jul 15, 2019

Is this different from content:// urls? AIUI content:// urls resolve to file:// urls in Fennec. Will this stop all ability to open external HTML files in Fennec?

@robsmith11
Copy link

Why wouldn't you support opening local files on Android as you do on other platforms?

I use it frequently to play local media and load offline websites.

@NotWoods
Copy link
Contributor

Marking this as wontfix since we don't plan to support file:// URLs.

@robsmith11
Copy link

Is there a discussion somewhere explaining this decision?

Chrome on Android supports opening local files. Why wouldn't Firefox on Android support a useful feature that Firefox supports on all other platforms?

@emilio
Copy link
Contributor Author

emilio commented Aug 15, 2019

I'd also love to know the reasoning, and specially whether it affects content:// URIs, which Fennec uses translating to file:// URIs.

@buttercookie42
Copy link

(though for HTML documents using any kinds of subresources or local links, content://-URIs are mostly useless anyway because Google never really thought things through...)

@ildar
Copy link

ildar commented Oct 1, 2019

Please reopen.

@emilio
Copy link
Contributor Author

emilio commented Oct 1, 2019

I cannot reopen but it'd be nice to get an answer as for the why here... @snorp?

@snorp
Copy link

snorp commented Oct 1, 2019

I don't know the reason either, but I suspect it's in order to prevent a whole category of thorny security problems. Over the years, Fennec (and Chrome) have had several of these. @liuche do you know the full reasoning here?

@emilio
Copy link
Contributor Author

emilio commented Oct 1, 2019

Interestingly https://bugzilla.mozilla.org/show_bug.cgi?id=1563422 was just closed as WONTFIX.

@ghost
Copy link

ghost commented Oct 5, 2019

This is asinine. Why not stop Firefox from opening web sites as well, then? That would also prevent a whole lot of thorny security problems for sure.

If this is not fixed, how to open local files (text, images, etc), play local media, run local wikis, test web sites and coded web apps locally, open presentations, or work offline?

This certainly kills Firefox for me and my co-workers.

@kbrosnan
Copy link
Contributor

Bug 1563422 was wonfix'ed because we are limiting the amount of Firefox for Android work that is being done. It was not selected as the fix in 68 so changing the behavior in following ESR releases was not worth it.

@theres-waldo
Copy link

I find this really unfortunate. I use file:// URIs all the time in Fennec to load documents saved for offline viewing, as well as local testcases and such.

@kumarharsh
Copy link

kumarharsh commented Nov 29, 2019

Why is this issue being handwaved away as just a security issue - only for Fenix? Please provide a proper answer or a bugzilla bug link at the very least.

@Crandel
Copy link

Crandel commented Nov 30, 2019

Please reconsider. A lot of people have a terrible internet and save pages to open them later from file. Even in Germany very poor internet underground and I always save important pages to read them while going to work. SingleFile, recommended by Mozilla, is a very popular extension also make no sense with this decision.

@andreicristianpetcu
Copy link

andreicristianpetcu commented Nov 30, 2019

Maybe Fenix should implement screenshots like Firefox Lite to facilitate offline navigation. Opening local html files is a terrible idea. Lots of malware can spread like that.

I often see users not asking for a fix for a problem but asking for a specific fix in their specific way. This is not how software is built. People have problems: "I need to see offline sites" now that is a problem. "I need to open local html files". That is a solution.

Fennec can access offline bookmarks. That is another fix for the offline sites issue.
Screenshot_20191130-160349_Firefox_Nightly

Please tell your problems to devs and let them find solutions. Does their solution not fix your problem? Tell them but please do not propose solutions.

@lnicola
Copy link

lnicola commented Nov 30, 2019

Every browser, from lynx and Netscape to Chrome can open local files. There are plenty of reasons to do so, from learning HTML to reading web pages you saved as a backup, to opening pages sent with the wrong Content-Disposition. What you are saying is basically "why would you want to open pictures from your hard drive when there is Google Photos, that's crazy and dangerous".

@andreicristianpetcu
Copy link

"Everybody else is doing it" is rarely a good argument.

@lnicola
Copy link

lnicola commented Nov 30, 2019

Removing features that every browser has for security theater is a bad idea. Why not remove add-on support, there's plenty more malware on a.m.o than in local HTML files.

@Crandel
Copy link

Crandel commented Nov 30, 2019

@andreicristianpetcu I want to open local html files. I don`t need any screenshots or anything else. What security problems this feature creates? I create my German dictionary as an html page manually and want to open it on desktop and mobile. I saved a lot of pages locally and have a search and index on them. Most of these pages are gone and lost forever but I have this information. The main job for browser is to open html pages, no matter there they are coming.

@emilio
Copy link
Contributor Author

emilio commented Nov 30, 2019

I also think this should be fixed. If I receive an HTML file as an email attachment, which I do somewhat often, I still cannot open it using Fenix, which sucks.

@theres-waldo
Copy link

@kbrosnan Given the feedback in this thread, would you be willing to reconsider this?

Or, if not, to at least make access to file:// URIs available behind a setting or about:config flag?

@Crandel
Copy link

Crandel commented Dec 4, 2019

@lnicola I have no access to this page

@lnicola
Copy link

lnicola commented Dec 4, 2019

I imagine it's a sandbox escape -- I don't have access myself. But then again, there's been a lot of those, even in newer features like Activity Stream or pdf.js, and they didn't get removed to avoid security bugs. I can appreciate that removing local file access can prevent a whole class of issues, but this doesn't feel like the right decision.

@emilio
Copy link
Contributor Author

emilio commented Dec 4, 2019

It's not a sandbox escape of any sort.

@emilio
Copy link
Contributor Author

emilio commented Dec 5, 2019

In particular, it's really a version of https://bugzilla.mozilla.org/show_bug.cgi?id=1500453 / https://bugzilla.mozilla.org/show_bug.cgi?id=803143, which had a few more security implications in Android because paths are more predictable. But that's pretty much it AFAICS.

@andreicristianpetcu
Copy link

Reading the thread here makes me come to one conclusion:
Users clearly know more here on security than the devs!

@emilio
Copy link
Contributor Author

emilio commented Dec 5, 2019

(Well, I'm a Firefox dev too, just sayin' :))

@emilio
Copy link
Contributor Author

emilio commented Dec 5, 2019

And it's not about knowing more or not. I'm pretty sure the Fenix team is perfectly aware of the security implications here (and there may be some others that I'm missing), but as a user I think the trade-off here is not acceptable. People ought to be able to open HTML pages from their own file system.

@Crandel
Copy link

Crandel commented Dec 5, 2019

There is a very good addon SingleFile, that saves all page as single html file, so we do not need to load anything else from file system. What if sandbox will allow open only this file, without access to other files? Even such limited access to local file will be fine for me.

@buttercookie42
Copy link

There is a very good addon SingleFile, that saves all page as single html file

While that merges all the associated support files (images, CSS, JS, etc.) into the same file, it still only works for a single document at a time, so of limited value when you have a complete collection of multiple documents which all reference each other.

@kumarharsh
Copy link

In particular, it's really a version of bugzilla.mozilla.org/show_bug.cgi?id=1500453 / bugzilla.mozilla.org/show_bug.cgi?id=803143, which had a few more security implications in Android because paths are more predictable. But that's pretty much it AFAICS.

Thanks for the links @emilio. From the discussions in the links, I would conclude that in-case a change is needed, Firefox should just go with what Chrome is already doing. Banning file:// URIs altogether just gimps the browser.

@emilio
Copy link
Contributor Author

emilio commented Dec 5, 2019

My point in the comment above is that that bug is fixed on Firefox and Fennec since a while ago, so that particular bug/threat model shouldn't be a concern anymore, again unless I'm missing something.

@ghost
Copy link

ghost commented Dec 7, 2019

Opening local html files is a terrible idea.

I'm assuming you've never worked on developing a web page or web application, ever. It involves browsers opening local files. Many, many, many times. In our organization we use local wikis extensively, again, something you may not be familiar with.

And how is opening a local file made by the user herself (plenty of examples have been given, a bookmarks file, a preferences file, a dictionary, a wiki, a media file, an image, etc, etc, etc...) more dangerous (or at all) than opening an unknown site, loaded with running scripts, trackers, spyware, data mining suckers, geolocation, served by a stranger's computer somewhere?

This is akin to you saying, if the text editor crashes when typing the letter "A", don't type the letter "A", egad you fools! Why would you ever need to do that. There are plenty of letters other than "A".

If there is a security issue, then the security issue must be addressed, not a fundamental function taken away instead.

@rolfausohnder
Copy link

Bug 1563422 was wonfix'ed because we are limiting the amount of Firefox for Android work that is being done. It was not selected as the fix in 68 so changing the behavior in following ESR releases was not worth it.

Okay, so it's a trade-off. But is this really such an unimportant feature ? I mean, what would you use to open html-files if not a browser ?

@vegecurry
Copy link

Just a reminder for my future self and for those who are searching for the open-local-files feature in which browser.

I tried Firefox, Firefox Lite and Opera Mini on Android yesterday, and none of them seems to have this opening-local-files ability. I eventually tried Opera Browser for Android (NOT the Mini version), and it works. Cheers.

@pgorod
Copy link

pgorod commented Feb 25, 2021

Using local HTML is a common solution for storing static reference materials. Think teachers reading out their class notes, corporate salesmen out on the road with their tablets, people who work in places with poor Internet access, etc.

HTML is the presentation/markup format the world uses. There are tons of solutions out there that use it locally. The tool to do such browsing is called a browser, and I believe Firefox wants to be one.

It's understandable that some specific security concern might require restrictions, but the all-out cancellation of local browsing in the real-world, only brings less security with it. In our case, putting everyone on Firefox Android 68 which is the usable browser. How unsafe is that?

Some middle-ground solution needs to be achieved, and I'm sure it's possible.

Thanks for all the work done on this project.

@vitaly-zdanevich
Copy link

Please reconsider. A lot of people have a terrible internet and save pages to open them later from file. Even in Germany very poor internet underground and I always save important pages to read them while going to work. SingleFile, recommended by Mozilla, is a very popular extension also make no sense with this decision.

For saving of pages for offline you can try Pocket or Evernote.

@ildar
Copy link

ildar commented Mar 25, 2021 via email

@rolfausohnder
Copy link

Does anybody know the reasons why this is such a problematic issue in the first place ?

@gildas-lormeau
Copy link

For saving of pages for offline you can try Pocket or Evernote.

You can also run SingleFile in Kiwi or Yandex browsers.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐞 bug Crashes, Something isn't working, ..
Projects
None yet
Development

No branches or pull requests