Live data from Hacker News

A proposal to restrict sites from accessing a users’ local network

github.com

241–250 of 392 posts

Re: A proposal to restrict sites from accessing a users’ local network

#241
post #15

Earlier quoted context omitted.

[flagged]

> Googlers present a solution no one is asking for, I'm asking for it. Random web sites have no business poking around my internal network.

>I'm asking for it.

Proof? Link to issue? Mailing list? Anything?

I think you just made that up.

Re: A proposal to restrict sites from accessing a users’ local network

#242

Earlier quoted context omitted.

If it is truly static site/page, download it and open from local disk. And nudge vendor to release it as archive which can be downloaded and unpacked locally. It has a multitude of benefits comparing opening it from vendor site each time: 1) It works offline. 2) It works if vendor site is down. 3) It works if vendor restrict access to it due to acquisition, making it subscription-based, discontinuation of feature "be…

> If it is truly static site/page, download it and open from local disk. And nudge vendor to release it as archive which can be downloaded and unpacked locally. Depending on the browser, file:/// is severely limited in what CORS requests are allowed. And then there's products like Plex, where it's not a static site, but you still want a central dashboard that connects to your local Plex server directly via CORS.

> Depending on the browser, file:/// is severely limited in what CORS requests are allowed.

And it is strange to me too. Local (on-disk) site is like local Electron app without bundling Chrome inside. Why it should be restricted when Electron app can do everything? It looks illogical.

Re: A proposal to restrict sites from accessing a users’ local network

#243
post #152

Earlier quoted context omitted.

I think this can be circumvented by DNS rebinding, though your requests won't have the authentication cookies for the target, so you would still need some kind of exploit (or a completely unprotected target).

How? The browser would still have to resolve it to a final IP right?

I'm not sure what you mean but this explains it: https://github.blog/security/application-security/localhost-...

Re: A proposal to restrict sites from accessing a users’ local network

#244
post #110

Earlier quoted context omitted.

People accept permission prompts from apps because they conciously downloaded the app and generally have an idea about the developer and what the app does. If a social media app asks for permission to your photos it's easy to understand why, same with a music streamer wanting to connect to your smart speaker. A random website someone linked me to wanting to access my local network is a very different case. I'm absolu…

"Please accept the [tech word salad] popup to verify your identity" Maybe this won't fool you, but it would trick 90% of internet users. (And even if it was 20% instead of 90%, that's still way too much.)

I have seen it posed as 'This site has bot protection. Confirm that you are not a bot by clicking yes', trying to mimic the modern Cloudflare / Google captchas.

Re: A proposal to restrict sites from accessing a users’ local network

#245
post #138
post #99

Earlier quoted context omitted.

I'm surprised you've never seen this before. Especially for universities it's very common to have the same hostname resolve to different servers, and provide different results, depending on whether you're inside the university network or not. Some sites may require login if you're accessing them from the internet, but are freely accessible from the intranet. Others may provide read-write access from inside, but limit…

No I haven't seen this before. I have seen however the behavior where login is required from the Internet but not on the university network; I had assumed this is based on checking the source IP of the request. Similarly the use case of read-write access from inside, but limited read-only access from the outside is also achievable by checking the source IP.

But how do you check the source IP if everyone is behind NAT?

Take the following example (all IPs are examples):

1. University uses 10./8 internally, with 10.1./16 and 10.2./16 being students, 10.3./16 being admin, 10.4. being natsci institute, 10.5. being tech institute, etc.

2. You use radius to assign users to IP ranges depending on their group membership

3. If you access the website from one of these IP ranges, group membership is implied, otherwise you'll have to log in.

4. The website is accessible at 10.200.1.123 internally, and 205.123.123.123 externally with a CDN.

Without NAT, this would just work, and many universities still don't use NAT.

But with NAT, the website wont see my internal IP, just the gateway's IP, so it can't verify group membership.

In some situations I can push routes to end devices so they know 205.123.123.123 is available locally, but that's not always an option.

In this example the site is available externally through Cloudflare, with many other sites on the same IP.

So I'll have to use split horizon DNS instead.

Re: A proposal to restrict sites from accessing a users’ local network

#246

Earlier quoted context omitted.

> If it is truly static site/page, download it and open from local disk. And nudge vendor to release it as archive which can be downloaded and unpacked locally. Depending on the browser, file:/// is severely limited in what CORS requests are allowed. And then there's products like Plex, where it's not a static site, but you still want a central dashboard that connects to your local Plex server directly via CORS.

Why local Plex which you need to install & run (it is already Server) cannot provide its own UI to browser, without 3rd party sites? It is absurd design, IMHO. I'll never allow this in my network. It looks security nightmare. Today it shows me dashboard (of what? Several my Plex servers?), tomorrow it is forced to report pirated movies to police. No, thanx.

> of what? Several my Plex servers?

People commonly use this to browse the collections of their own servers, and the servers of their friends, in a unified interface.

Media from friends is accessed externally, media from your own server is accessed locally for better performance.

Re: A proposal to restrict sites from accessing a users’ local network

#247

Earlier quoted context omitted.

> If it is truly static site/page, download it and open from local disk. And nudge vendor to release it as archive which can be downloaded and unpacked locally. Depending on the browser, file:/// is severely limited in what CORS requests are allowed. And then there's products like Plex, where it's not a static site, but you still want a central dashboard that connects to your local Plex server directly via CORS.

> Depending on the browser, file:/// is severely limited in what CORS requests are allowed. And it is strange to me too. Local (on-disk) site is like local Electron app without bundling Chrome inside. Why it should be restricted when Electron app can do everything? It looks illogical.

I agree that the current situation sucks, but that doesn't mean breaking the existing solutions is any better.

Re: A proposal to restrict sites from accessing a users’ local network

#248

I wish they'd (Apple/Micrsoft/Google/...) would do similar things for USB and Bluetooth. Lately, every app I install, wants bluetooth access to scan all my bluetooth devices. I don't want that. At most, I want the app to have to declare in their manifest some specific device IDs (short list) that their app is allowed to connect to and have the OS limit their connections to only those devices. For for example the Bose…

Like the github 3rd party application integration. "ABC would like to see your repositories, which ones do you want to share?"

Does that UI actually let you choose? IME it just tells me what orgs & repos will be shared, with no option to choose.

Re: A proposal to restrict sites from accessing a users’ local network

#249
post #50

While this will help to block many websites that have no business making local connections at all, it's still very coarse-grained. Most websites that need this permission only need to access one local server. Granting them access to everything violates the principle of least privilege. Most users don't know what's running on localhost or on their local network, so they won't understand the risk.

A comprehensive implementation would be a firewall. Which CIDRs, which ports, etc. I wish there were an API to build such a firewall, e.g. as a part of a browser extension, but also a simple default UI allowing to give access to a particular machine (e.g. router), to the LAN, to a VPN, based on the routing table, or to "private networks" in general, in the sense Windows ascribes to that. Also access to localhost sepa…

> I wish there were an API to build such a firewall, e.g. as a part of a browser extension,

There was in Manifest V2, and it still exists in Firefox.

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/Web...

That's the API Chrome removed with Manifest V3. You can still log all web requests, but you can't block them dynamically anymore.

Re: A proposal to restrict sites from accessing a users’ local network

#250
post #70
post #64

Earlier quoted context omitted.

Doesn't CORS just restrict whether the webpage JS context gets to see the response of the target request? The request itself happens anyway, right? So the attack vector that I can imagine is that JS on the browser can issue a specially crafted request to a vulnerable printer or whatever that triggers arbitrary code execution on that other device. That code might be sufficient to cause the printer to carry out your ev…

Or simply perform a timing attack as a way of exploring the local network, though I'm not sure if the browser implementation immediately returns after the request is made (ex fetch API is called) but before the response is received. Presumably it doesn't, which would expose it to timing attacks as a way of exploring the network.

eBay, for one, has been (was?) fingerprinting users like this for years.

https://security.stackexchange.com/questions/232345/ebay-web...

Post reply on HN