Closed ShivanKaul closed 1 year ago
Hi are there plans to implement this?
Working on a PR right now. If folks have test websites that don't currently work on Brave, please drop them here, would help a lot with smoke testing.
@ShivanKaul if interested razroo.com x razroo vscode plugin(https://marketplace.visualstudio.com/items?itemName=Razroo.razroo-vscode-plugin) is a good example(will need to sign up/sign into razroo in order to use). We spin up a local server/localhost in the vscode plugin and pass information directly from web to local vscode plugin. It works on chrome, and edge, but not on brave for I believe this reason. If authentication works with vscode plugin, it means officially fixed.
Cool, that seems to work well on my local feature branch for this issue. This is the experience:
https://user-images.githubusercontent.com/5284154/220427702-b3cb09db-f848-4f02-905f-3a71ed1557b7.mov
cool that means it should be working as expected. Prior brave users were unable to authenticate. Thank you
Thanks for the use-case! Helps a lot. If others have ones too, that would help get this out faster because we'd be surer we're not breaking things.
Thanks for the use-case! Helps a lot. If others have ones too, that would help get this out faster because we'd be surer we're not breaking things.
Is there a dev branch I can check out? I am running into this issue presently, but the software is proprietary/beta...
@nacmonad just to confirm is that question directed to me or @ShivanKaul
🚀
This feature has been merged in for both Desktop and Android but is default-disabled while we work on a better way of shipping which websites should be allowed to request permission.
@ShivanKaul why not allow users to decide that on their own?
There is a very real danger of port-scanning attacks to fingerprint users which is why we'd blocked localhost connections in the first place. We want to prevent those websites from being able to spam users with permission prompts, which has an additional danger of training users to say yes to dangerous actions that they may not understand the significance of while they're just trying to get work done in the browser (which is why Brave disables Filesystem API, for instance).
@CharlieGreenman the razroo auth use-case you brought up seems legitimate. We will add that to the initial list when we roll it out.
Thank you. It goes without saying my thanks as always
default-disabled while we work on a better way of shipping which websites should be allowed to request permission.
I'm generally not a fan of a whitelist (which it sounds like you are suggesting), as that seems fairly antithetical to the idea of a "decentralized and permissionless internet". Could you solve the spam problem similar to how Firefox (and maybe Brave too) solves the alert popup and new tab spam problem with a dialog that asks if you want to let the site continue to prompt you?
It seems that the same technique as mic/camera/notification access could be used, where the page asks for permission to access other services running on your device and you can accept, reject, and reject with prejudice (never ask again for this site).
The issue is not one particular website doing it (Brave has finer-grained permission scope and lifetime than other browsers), but multiple websites prompting for the localhost permission. Port-scanning fingerprinting attacks are very common and easy [1], [2].
Our general stance has been that Web APIs too harmful for user privacy should be disabled without a permission prompt, because users cannot meaningfully consent to them. In the case of localhost connections, it seems like there are some benign use-cases, so we're experimenting with selectively allowing them.
Perhaps I'm misunderstanding. How would you selectively allow some use cases without doing specific website whitelisting? Are you thinking of allowing some subset of ports or protocols or something when communicating with localhost, while disallowing port scanning? Or perhaps constrain how many ports a given website can attempt to query locally before they get locked out from querying any additional ports?
We will be allowing only specific websites to ask for this permission.
I don't think that a permissioned/gatekept web is an appropriate solution for this. Even though I want this feature, I think permissioning it is a strictly worse solution than not having it at all because it allows large companies to create moats around their exclusive access to browser features and it reduces the impetus and pressure for the Brave team to find a solution that works for everyone.
As a user and a web/extension developer, Brave implementing a permissioned web in their browser is a huge turnoff for me. I generally like Brave's position on security, privacy, and censorship resistance, but if you all start permissioning/censoring the web it will result in massive negative marks in my internal browser scoring rubric.
Just to clarify, there will be a way for a user to override which websites get this permission by going to the permission setting page: brave://settings/content/localhostAccess. This is just how Chromium permissions work.
This is part of the enhancement we're exploring -- currently adblocking happens first, so requests are blocked before they get to the permissioning code, but we're working on changing that because we'd like to decouple localhost blocking from adblocking. Details TBD.
But there will be a default list of websites that can ask for this permission.
If users can add sites to the whitelist then I think that mitigates a lot of my concerns. I'm not a huge fan of having a built-in whitelist as it gives preferential treatment to "friends of Brave" (or people who can afford the registration costs, or people who KYC, or people who go through some bureaucratic process or whatever).
Will it be possible to have certain localhost resources made available to all websites? For example, if I am running a local Ethereum client or IPFS client, I would like any website to be able to probe for and access those. A website might first probe to see if I have IPFS running locally and if so use that (which I would prefer) then fallback to a central server (same for Ethereum client). I don't want to have to whitelist every website that wants to use these resources as they are intended to made available to web apps.
In this scenario, I would still be fine with getting a prompt "This website wants to access your Ethereum client: Allow, Deny", but I wouldn't want to have to add every single website to the whitelist by hand, and I also wouldn't necessarily want to give every website full unrestricted access to all localhost resources (only a couple that I have intended to make available as part of a suite of decentralized web tools).
PASSED
usingBrave | 1.52.86 Chromium: 113.0.5672.77 (Official Build) beta (x86_64) |
---|---|
Revision | c4236862955e005c2187105415ac4a2ecf86dff1-refs/branch-heads/5672_62@{#3} |
OS | macOS Version 13.4 (Build 22F5059b) |
PASSED
PASSED
PASSED
I'm not a huge fan of having a built-in whitelist as it gives preferential treatment to "friends of Brave" (or people who can afford the registration costs, or people who KYC, or people who go through some bureaucratic process or whatever).
I'm not sure what the point being made here is, but to give a closely-related example, Brave heavily contributes to adblock filter list development and maintenance and part of that work is figuring out what network requests are safe or otherwise in the interest of the user (across all adblockers, not just Brave), and which ones are not. We're going through open GitHub issues right now to collect use-cases we can now enable with this feature. We always offer a way for users to add their own lists/rules for adblock, and similarly here, we will offer a way for users to add which websites they consider safe to access localhost resources.
Will it be possible to have certain localhost resources made available to all websites?
Can you create a new issue for this? We can discuss it there.
I opened #30181 for discussing specific localhost resources being made globally available for permission requests.
I'm not sure what the point being made here is, but to give a closely-related example, Brave heavily contributes to adblock filter list development and maintenance and part of that work is figuring out what network requests are safe or otherwise in the interest of the user (across all adblockers, not just Brave), and which ones are not. We're going through open GitHub issues right now to collect use-cases we can now enable with this feature. We always offer a way for users to add their own lists/rules for adblock, and similarly here, we will offer a way for users to add which websites they consider safe to access localhost resources.
The broad point I think is that the failure mode of blacklists is quite different from the failure mode of whitelists. If Brave is unable to keep up with demand for adding things to a blacklist, then users are not protected as well but new websites aren't prevented from being able to do everything that existing websites do. If Brave is unable to keep up with demand for whitelist additions, then new websites will not be able to do everything that existing websites do.
IMO, this difference of failure modes is quite significant because a blacklist leaves the web open by default while a whitelist leaves the web closed by default. I believe that it is important that the web remain open and decentralized by default, with things like AdBlock adding exceptions to the "open by default" rule rather than the other way around.
Verification PASSED
using
Brave | 1.52.91 Chromium: 113.0.5672.77 (Official Build) beta (64-bit)
-- | --
Revision | c4236862955e005c2187105415ac4a2ecf86dff1-refs/branch-heads/5672_62@{#3}
OS | Windows 11 Version 22H2 (Build 22621.1555)
PASSED
PASSED
PASSED
PASSED
usingBrave 1.52.109 Chromium: 114.0.5735.26 (Official Build) beta (64-bit)
Revision 7075cbb66f0542ac3e01ddfde6b813e7d61118a5-refs/branch-heads/5735@{#454}
OS Linux
PASSED
PASSED
PASSED
I am having an issue with websites not being able to make localhost requests. The current situation I'm in is that I'm uploading to youtube from my terminal, but in order to do that, I need oauth2 consent screen, which sends the callback to https://localhost:8080/oauth2callback
. Every time I try to allow access to my account, it says something went wrong because it can't send to my localhost server that I need. I had to open google chrome just to get this to work, which I don't like.
I really like the idea of having a prompt whenever a website first tries to send a request to localhost, and it would be like asking for mic/camera access. This way, as a developer, I can let websites request to localhost whenever I need. Of course there would be an option in the settings to always not allow, prompt the user, or always allow. I think that would be better than just blocking them all the time, and not even warning the user (heck, even the console didn't even say localhost was blocked).
The current situation I'm in is that I'm uploading to youtube from my terminal, but in order to do that, I need oauth2 consent screen, which sends the callback to https://localhost:8080/oauth2callback
What's the website that tries to make the localhost connection? While we come up with something easier, you can selectively add the website to brave://settings/content/localhostAccess (Allowed to access localhost resources
). Make sure you have the feature flag turned on (brave://flags/#brave-localhost-access-permission).
What's the website that tries to make the localhost connection?
Google. I would think that you'd get that from me mentioning that I'm trying to upload to youtube, which uses google accounts for youtube channels.
What matters is that the specific content settings pattern you specify on the content settings page matches the site making the call to the localhost URL, whether that's https://youtube.com or a third-party or whatever.
Ah, ok.
Using Brave version 1.61.104 I can't see any localhost related settings in brave://settings/content. I'd like to allowlist localhost access for certain sites, how do I do that? Do I just need to wait for a newer version of the browser to roll out?
Using Brave version 1.61.104 I can't see any localhost related settings in brave://settings/content. I'd like to allowlist localhost access for certain sites, how do I do that? Do I just need to wait for a newer version of the browser to roll out?
You have to first go to brave://flags/#brave-localhost-access-permission and enable it (then restart the browser).
Similar to https://github.com/brave/brave-browser/issues/26273, we'd like to add a new site permission called Localhost connections. There are several legitimate use-cases that involve the website asking for access to localhost e.g. a localhost-based websocket.
Currently we block all localhost connections via Adblock, but allowlist some in brave-specific.txt.
We will be able to safely add exceptions to the localhost-blocking adblock rules, once we have this. NOTE: we still want adblock rules to apply before applying this permission. After this permission is added to Brave, in order for a site to have access to localhost resources, it still needs to do 2 things:
NOTE: we only permission/block requests based on the URL, not the resolved IP address. This will be addressed in a follow-up: https://github.com/brave/brave-browser/issues/30038
Functionality:
Localhost Access
.net:: ERR_ACCESS_DENIED
).net::OK
).net:: ERR_ACCESS_DENIED
), and show permission prompt.