7 ms·
Feedback wanted: CORS for private networks (RFC1918)
- xg15 6y agoThe example feedback goes a bit in that direction, but how would that interact with mixed content? Say, I have a server running on 192.168.1.1. The box is only accessible through its IP address, so I can't get a public certificate for it and therefore can't enable https. I cannot access the box from a http site due to the new restriction. I cannot access the box from a https site due to mixed content. So I cannot access the box anymore at all?
- TimWolla 6y ago> So I cannot access the box anymore at all? My understanding is that you can access it directly. But you can't embed e.g. images or JavaScript from that server within a website running on a public IP address. I consider that a good thing.
- zeroimpl 6y agoYou cannot make an AJAX call from an HTTPS site to a HTTP site on a local IP address. One of the internal web applications I develop (which is hosted over HTTPS itself) has to workaround this by doing the connection from the browser to the local IP address over HTTPS, but upon detecting HTTPS cert errors it opens a popup and walks the user through the process of adding an exception to connect anyways. Once that popup closes, then the AJAX request gets retried and succeeds. While this works for an internal application, it would be unacceptable for any consumer product.
- xg15 6y agoYou cannot make an AJAX call from an HTTPS site to a HTTP site on a local IP address. This was sort of my point - because with the new rules in place, I cannot make an AJAX call from a HTTP site to an internal address either.
- zeroimpl 6y agoAgreed - this HTTPS everywhere madness needs to stop as there are still valid use-cases for HTTP and no user-friendly workaround for enabling access to local IP addresses via HTTPS.
- AntonyGarand 6y agoDepending on what interactions you want, only the origin host would require https. If you need passive mixed content, I believe it is and will remain supported by browsers for some time. If you need active mixed content though you probably will need a workaround via passive content instead.
- mikewest 6y agoCorrect. In the status quo, you will be best-served by looking at solutions similar to what Plex is shipping (https://blog.filippo.io/how-plex-is-doing-https-for-all-its-users/ https://blog.filippo.io/how-plex-is-doing-https-for-all-its-...). ACME's DNS-based challenges might even make this easier today than it was when that mechanism was designed. Longer-term, it seems clear that it would be valuable to come up with ways in which we can teach browsers how to trust devices on a local network. Thus far, this hasn't been a heavy area of investment. I can imagine it becoming more important if we're able to ship restrictions like the ones described here, as they do make the capability to authenticate and encrypt communication channels to local devices more important.
- politelemon 6y agoI am thinking of use cases and I think one would be folding@home. Their Web client is hosted on their public website and it makes http calls to a localhost:port running on a background service. Is that correct or have I misunderstood?
- mpeklar 6y agoYes, but since they control the background service too, they can just update the service to make it respond to CORS requests.
- mikewest 6y agoThe core assertion behind this proposal is that devices and services running on a local network can continue making themselves available to external networks if and only if they can update themselves to make that desired relationship explicit. If they can't update themselves, they also can't fix security bugs, and really must not be exposed to the web.
- pwdisswordfish4 6y agoFuck this. It increases the complexity of browsers and servers and erects yet another burden for makers. And for what? So orgs with broken infrastructure (and budgets for running it) and device manufacturers (with budgets of their own) can keep up their garbage practices instead of fixing them? And they can push their costs onto a deep-pocketed company like Google who's willing to subsidize them? Here's to hoping that WebKit and Mozilla say "No."
- cratermoon 6y agoIt's probably wrong to consider any 'private' network to be secure any more. With zero-trust principles in mind, you wouldn't necessarily believe every device or system on your network is trusted, so you ensure that what is able to send and receive traffic on your network has other mechanisms in place for trust and authenticity.
- xg15 6y agoI mean, you have to hand it to them that the point of this change is to strengthen the security of "everything in LAN is trusted" networks: Using the browser as a gateway to access internal services is one of the most important ways to break into local networks.
- duskwuff 6y agoHuh? I think you may have a very incorrect idea about who is being burdened here. A major effect of these changes is to make it simpler for anyone ("makers" included) to securely implement devices which expose web services, by making web browsers refuse to allow external web sites to send arbitrary requests to those devices. Most network devices have no need to receive such requests. No action is necessary on their part; these changes will make those devices stop receiving those requests. The few network devices that do need to receive those requests can opt in to receiving them by responding to a CORS probe (an OPTIONS HTTP request) with a specific HTTP header. This is not complicated to implement. Web browsers already implement complex CORS policies. Adding this is not a huge burden upon them, and may actually obviate the need for other more complex defenses.
- janci 6y agoI don't get it. What's wrong with normal CORS? They do work for private networks. Also I don't think browsers are the right place to do this kind of protection.
- cratermoon 6y agoIt says right there in the proposal > status quo CORS protections don’t protect against the kinds of attacks discussed here as they rely only on CORS-safelisted methods and CORS-safelisted request-headers. No preflight is triggered, and the attacker doesn’t actually care about reading the response, as the request itself is the CSRF attack.
- zeroimpl 6y agoBut what about those vulnerabilities is specific to being on a private network? If we can find a public website with the same vulnerability, will we start enforcing stricter CORS requirements everywhere?
- janci 6y agoOk, this will protect old unpatched vulnerable devices. But what will prevent a negligent manufacturer that uses HTTP GET without CSFR protection to apply configuration to the device from just adding the CORS opt-in header everywhere? I mean it would be the simplest solution for them.
- lilyball 6y agoRequiring HTTPS for services on the private network seems rather extreme. How do you even do HTTPS on a private network not attached to some publicly-resolvable external domain without installing the root certificate on all devices?
- cratermoon 6y agoZero-trust architecture would note that there's not really anything 'private', once the traffic is 'inside'. The old way of thinking with firewalls and DMZs falls apart now, so you have to treat all traffic, even what you think of as "inside" as potentially hostile or disruptive. Thus, TLS everywhere. How to do it? self-signed certs and distribute your own CA and install it across devices that are authorized to be on your network.
- toomuchtodo 6y ago> How to do it? self-signed certs and distribute your own CA and install it across devices that are authorized to be on your network. This is an unreasonable ask for the vast majority of users.
- cratermoon 6y agoThis is not a proposal for users, it's a tool for network administrators and programmers. "Yeah but I have a home LAN, too" isn't relevant here, unless your home network has high-value targets on it and all the other technologies this applies to, in which case maybe you're not in "the vast majority of users".
- bawolff 6y agoIf you are running a private intranet type thing, installing your own root certs seems fairly reasonable to me. You could also just have the dns be public. No reason why private networks can't be in public dns. If you are really paranoid use wildcard certs, and only have top domain be in the public dns.
- 6y ago
- bawolff 6y agoSo this protects local http(s) services that use network access as an auth layer and are bssically vulnerable to CSRF. I guess this still wouldn't protect against attacks on non http(s) services. So things like https://samy.pl/slipstream/ https://samy.pl/slipstream/ still work?
- djweis 6y agoAssuming I'm running malware.com, I would make 192-168-0-1.router.malware.com resolve to 192.168.0.1 so the origin matches and I can prod the router as much as I'd like without crossing the origin.
- xg15 6y agoThe proposal talks about sites resolving to private/local addresses, so presumably, the browser would still apply the checks to all requests to that domain. The only thing that would not trigger CORS is if you somehow loaded a top-level document from that domain. (The address is in the browser's address bar) - however, a malicious website can't do that as this server is not under their control.
- mikewest 6y agoCorrect. https://wicg.github.io/cors-rfc1918/#dns-rebinding https://wicg.github.io/cors-rfc1918/#dns-rebinding describes this reasoning.
- xg15 6y agoQuestion: This talks about public-to-private and private-to-local requests. Does the proposal also apply to private-to-private? E.g., if a page at 192.168.1.1 fetches a resource from 192.168.1.2, will that also trigger the new rules?
- mikewest 6y agoThat's an open question (https://wicg.github.io/cors-rfc1918/#issue-207ba0b9 https://wicg.github.io/cors-rfc1918/#issue-207ba0b9). Feedback welcome!
- janci 6y agoAlso I don't understand how this works with IPv6 initiative that wants every device have a public IP address. The same goes for IPv4 routers - on many of them you could use the public IP to do the drive-by attack.
- mikewest 6y agoIPv6 does indeed complicate things. I suspect we'll end up trying a few things before finding the right answer, starting with a) allowing network admins to configure IP ranges that correspond to the network they control, and b) examining the local network to infer a private range. Happily(?), IPv4 networks are still pervasive, and this proposal seems clearly valuable in those environments.
- soraminazuki 6y agoI can't fathom why anyone would be up in arms against preventing random websites from accessing servers running on localhost or inside home networks. This is not about "web bloat," as some people are suggesting, but rather closing a gaping security hole that should never have existed from the start.
- _qulr 6y agoThis change can't come soon enough. My only objection is that the rollout is way too slow, and the first step is only a baby step. What we have now is essential a 0day situation. Unfortunately a lot of commenters completely misunderstand the proposal, as well as the attacks it is designed to mitigate. Here's a good paper describing the issue, "Attacking the internal network from the public Internet using a browser as a proxy": https://www.forcepoint.com/sites/default/files/resources/files/report-attacking-internal-network-en_0.pdf https://www.forcepoint.com/sites/default/files/resources/fil... The "HTTPS" part of Google's proposal is a bit of a red herring, as I said, only a baby step. It does not mean that your local services have to be https. It just means that public http sites can't make requests to local IP addresses.
- duskwuff 6y ago> The "HTTPS" part of Google's proposal is a bit of a red herring, as I said, only a baby step. It's in there for the same reason that risky APIs like geolocation require HTTPS -- so that injecting content into an insecure HTTP transaction cannot allow an attacker to hijack a trusted HTTP site's permissions.
- _qulr 6y agoSure. But we've seen cases where so-called "trusted" https sites such as ebay are probing your LAN, so the fundamental problem remains. https://nullsweep.com/why-is-this-website-port-scanning-me/ https://nullsweep.com/why-is-this-website-port-scanning-me/
- pgt 6y agoCORS is security theatre - like taking your shoes off at the airport. I've been blocked on a CORS issue for 2 weeks now. Please avoid if possible.