-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent sites from using external links like mailto. #285
Conversation
SvobodaJakub
commented
Apr 28, 2017
- Disable protocols like mailto from being handled by external applications, so that evil trap sites can't launch external applications.
@SvobodaJakub there are also Reference: this is what I use for convenience
|
… links, added protocols from Android.
…ording, added another type of blocking.
user.js
Outdated
// http://kb.mozillazine.org/Network.protocol-handler.warn-external-default | ||
// https://news.ycombinator.com/item?id=13047883 | ||
// https://bugzilla.mozilla.org/show_bug.cgi?id=167475 | ||
// NOTICE: Breaks mailto links on legit websites, user has to right-click and copy mail address from the link. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently NOTICE:
needs to be on the line just after PREF:
for the automatic doc generation to work properly :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be // NOTICE: Breaks opening third-party mail/messaging/torrent/... clients by clicking on links with custom protocols
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I generated the readme using gen-readme.sh and the NOTICEs, the PREFs and their URLs were all added correctly to README.md. Am I doing something wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry. You are correct. Reference links must go right under the PREF
. Everything is fine.
user.js
Outdated
|
||
// PREF: Disable nonessential protocols from being used altogether. | ||
// http://kb.mozillazine.org/Network.protocol-handler.expose.%28protocol%29 | ||
// NOTICE: Breaks all interactions and links using these protocols. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be // NOTICE: Breaks all interaction with custom protocols such as mailto: irc: magnet: ...
@nodiscc Thanks, you've inspired me to add a second block of .*expose.*==false which I'd like to discuss. The documentation seems to suggest that expose.(protocol)==false kills the protocol altogether. When testing with a mailto: link, that doesn't work and a popup opens under these conditions: FF 53.0 Some other combinations of the prefs behave the same and the common thing is that either value of network.protocol-handler.expose.mailto prevents nothing. Since user_pref("network.protocol-handler.expose-all", false); breaks javascript links, it seems that all the .*expose.* options are useless and I should remove them. Is that correct? |
user.js
Outdated
@@ -270,6 +270,53 @@ user_pref("general.buildID.override", "20100101"); | |||
// https://github.com/pyllyukko/user.js/issues/120 | |||
user_pref("browser.display.use_document_fonts", 0); | |||
|
|||
// PREF: Prevent sites from using links like mailto to launch external applications. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be // PREF: Prevent sites from using URLs such as mailto:, irc:, magnet: ... to launch external applications
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the wording suggestions.
user.js
Outdated
// http://kb.mozillazine.org/Network.protocol-handler.warn-external-default | ||
// https://news.ycombinator.com/item?id=13047883 | ||
// https://bugzilla.mozilla.org/show_bug.cgi?id=167475 | ||
// NOTICE: Breaks mailto links on legit websites, user has to right-click and copy mail address from the link. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be // NOTICE: Breaks opening third-party mail/messaging/torrent/... clients by clicking on links with custom protocols
user.js
Outdated
|
||
// PREF: Disable nonessential protocols from being used altogether. | ||
// http://kb.mozillazine.org/Network.protocol-handler.expose.%28protocol%29 | ||
// NOTICE: Breaks all interactions and links using these protocols. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be // NOTICE: Breaks all interaction with custom protocols such as mailto: irc: magnet: ...
… wording so that it makes sense in the generated readme.
Do I understand correctly, does |
I just tested it again (because the last time I did it was some time ago and I apparently made a mistake) and at least some javascript: links work but all a href links stopped working for me. |
Ideally what we want is:
Feel free to experiment and update your patch + pref descriptions, I will have a look soon. |
I made experiments and googled and it's a mess. network.protocol-handler.warn-external-default For protocol handlers that are set as external (described in the next section) and for which no default action has been set by the user, and a protocol-specific boolean Example: If http protocol is not exposed (described in a next section, basically disabled from being handled internally as usual), and FF settings are otherwise default, then if The example can be tried by setting default clean FF to This option collides with a "newer" functionality for determining default actions so that once the user selected a default way to handle the protocol, no warning is ever issued again - https://bugzilla.mozilla.org/show_bug.cgi?id=440892 network.protocol-handler.external-default For protocols for which a protocol-specific boolean Example: If http protocol is not exposed (described in a next section, basically disabled from being handled internally as usual), and FF settings are otherwise default, then if The example can be tried by setting default clean FF to The documentation at http://kb.mozillazine.org/Network.protocol-handler.external-default seems misleading or very unclear to me. network.protocol-handler.expose-all For protocols for which a protocol-specific boolean Example: If Conclusion
|
A matter of further research might be setting |
Maybe this could be of assistance: |
Thanks for the pointer to the urlhandlers project. To clarify:
|
So how complete is the blacklist? Of course the whitelisting would be better and we should try to get that working in the future. |
My first experiments with whitelisting:
Need to experiment more. Javascript seemed to work all the time. |
Sounds like there has been similar issues elsewhere also:
UPDATE: NoScript seems to remove |
This is a very welcome enhancement for the user.js, but I would like to see it as whitelisting. I think I'll start eating some dog food too with https://github.com/pyllyukko/user.js/tree/protocol-handler-whitelisting and see what happens. |
FYI: BeEF uses protocol handlers to fingerprint Firefox. My browser gets detected as "1+,10+" with |
This is weird (from
|
I merged the protocol-handler-whitelisting branch. |