267 points · by zdw · 5y ago · 269 comments
You should probably be mostly thrilled about this development.
CORS was basically ineffective in a lot of ways because it only works - by design - with newer servers that send those headers and with newer browsers that actually respect the headers and not simply ignore them. It was also ineffective for older servers from pre-CORS ages. The never break the web mentality didn't work out for this scenario.
Looking forward to this! Finally the LOIC and routersploit web implementations are ineffective. Now drop support for ftp in the web browser and we are good to go.
(̶F̶i̶r̶e̶f̶o̶x̶ ̶c̶a̶n̶ ̶s̶t̶i̶l̶l̶ ̶b̶e̶ ̶a̶b̶u̶s̶e̶d̶ ̶t̶o̶ ̶D̶D̶o̶S̶ ̶v̶i̶a̶ ̶f̶t̶p̶ ̶u̶r̶l̶s̶)̶
edit: correction: I was wrong: Firefox finally phased out ftp support this year in July.
How? They dropped FTP support a few versions ago (https://blog.mozilla.org/addons/2021/04/15/built-in-ftp-impl...).
Firefox deprecated FTP in 2015, and required it be manually re-enabled since April last year (FF88), and completely removed it in July (FF90), this year.
I was assuming that they will drop support by the end of this year, didn't follow it up recently so I missed the update in July about it.
Would you pass on that memo to the Chrome developers, please?
It gets annoying when a page I write loaded onto my table on my LAN's WiFi cannot talk to devices I own on my LAN just because I loaded the page from my server that is on the public Internet.
PS:
> The modern countermeasure for this is to require devices parked on private networks to opt-in to the ability mix public Internet requests with private network accesses, using CORS, which is what this is about
I predict that most IoT devices won't have a way to configure this.
If the manufacturer intended it to be controllable from some web app from their site, they will opt-in to control from everyone. If the manufacturer only wants it controlled from their mobile app, they will explicitly opt-out of web control if that is possible.
That doesn't necessarily mean you connect it to the open Internet, but it means you don't leave everything inside wide open because "oh there's a firewall." It also means buggy vulnerable IoT (Internet of Targets) stuff has to be dealt with.
Firewalls are almost security theater. They're just a basic precautionary thing. Same goes for virtual and zero trust networks. Systems must be secure, period.
It's always a challenge in browser design, but basically this is just another case of killing valid use cases because some servers don't follow the spec (i.e. GETs with side effects).
There are probably 25 IoT devices in my home, and more than half of them have a magic GET request with side effects. For example, just by clicking this link, my lights turn on http://lighting.londons_explorer/cm?POWER%20ON
A malicious web page could redirect me to that URL and force my lights on with no input from me. I bet some of the devices allow firmware updates with the same method.
> just by clicking this link, my lights turn on
Wasn't working for me, so I added an entry to my hosts file directing it to 127.0.0.1.Now I don't know what's happening with _your_ lights, but when I click that link my own lights come on.
Even this measure by Chrome is extremely limited, as it sounds like they're only blocking insecure (HTTP) sites from making requests to your private network. HTTPS sites are unaffected (for now).
Will this race to secure the internet mostly by applying ever more complex band aids end up in completely discouraging small entities from running their own public resources?
It's already next to impossible to run a public home server. Is it likely to become completely impossible?
As far as the rent extraction apparatus, it is enumerated almost entirely by a population that simply did not exist online back in the imagined halcyon days of "the independent internet". The masses didn't come online to tap through homespun webrings, they don't care about that stuff, these shiny hyper-optimized manipulation machines are what keep the masses online in the first place.
No chance at all of most people being able to do that today.
Why do you Open Source Evangelists not understand that most humans cannot do this stuff?
It's great that you know what a build system and github and dependencies are, but most people don't.
And IMO they shouldn't have to.
I agree, but I think people arguing over that would have expected to maintain the same ratio as the internet population grew. Frankly utopian IMO but one should dream, no?
The other thing to address is about being "independent online". Many of the things that make it so easy to create a website, for example, are made easy at a cost, i.e. vendor lock-in and rent for continued service. Or github will host your code but also use it for their own purposes, training your AI replacement. Those are ultimately good things to have around but do follow the trend of being cages-with-benefits --they increase dependence on central infrastructure.
TLS certificates used to cost a lot of money, now they're free. Pretty much all relevant web frameworks and technology stacks are published under FOSS licenses.
Nothing stops you from running your own web server with either whatever is the current state of the art web tech or whatever you prefer to build yourself.
But of course, the truth is that the web was never easy: it was just naive. Most (NOT ALL: some categorically only are protecting the interests of advertisers or rights holders) of these security bandaids and limitations are fixing actual problems with the web that were always there... developers just didn't know about them or didn't realize the ramifications. It would be better to have solved some of these things with solutions that are more elegant, and the lack of a definitive guide for "what all you should and should not do" sucks, but mostly the web is just banning stuff that never should have existed in the first place :(.
It might make some homelab setups slightly more annoying, though.
FWIW, I do the same as the article for my home network: I hijack all DNS requests from intranet devices and respond with corresponding intranet IPs. Externally on the internet trying to resolve those same (sub-)domains would lead to the public facing firewall.
This makes it so I can manage stuff like NASes and IoT stuff fairly easily regardless of where I'm connecting from.
Luckily none of my stuff really depends on making cross-boundary requests between intranet and internet services (it's always completely internal or external) so I should still be OK.
How so? I run a public HTTP server and a VPN server from a Raspberry Pi in my living room. It was pretty easy to set it up. Regarding the HTTP server, the only thing that was different from the last time I did this (around 2004) were SSL certificates.
1) Use public DNS to validate instead of HTTP. I do this for internal-only webservers. TXT records are updated during renewal using Hurricane Electric's DNS service at dns.he.net.
2) Run your own CA. This used to be a huge pain, until I found gnoMint. I use this to generate certificates for OpenVPN. If necessary, installing a root certificate is not difficult on most systems. You can set it to expire in, say, 10 years, so you won't need to update it so often.
[0] https://community.letsencrypt.org/t/does-lets-encrypt-offer-...
You can get a domain name for free from many non-profits (eg. eu.org). And chances are you have a public IP address, it's just dynamic not static, in which case dynamic DNS setup is fairly easy.
The only case you're screwed is in 4G/5G setup where you actually don't have a public IP at all, but only half/quarter IP (just a dedicated port range on a shared IP).
If you wanted to, having a public facing IP that uses challenge files, and just reverse proxying that specific URL-range to the private host might work.
But really, if you want SSL for a private network, self-signed certs or your own trusted CA cert is the way to go. That does mean changing your browser to accept those certs.
Alternatively, drop the SSL requirement, since everything is apparently on private networks.
Last time I tried it was a little annoying with dynamic IPs getting in the way, but possible with just a port forward or UPnP. Are ISPs making changes to prevent this?
The lack of IPv4 address space has started a trend of CGNAT which makes hosting from home nearly impossible. Luckily, IPv6 continues to be rolled out, but in many situations thst would lead to your services only being reachable through IPv6. There are still a great many outdated networks out there that can't reach IPv6, so you might run into trouble there.
If you can get a public IPv4 IP address, I see no reason why you'd run into issues. That's more of an ISP problem than a hosting problem, in my opinion.
If your IP is not dynamic, and you can configure the reverse DNS, there's not going to be problems :)
Except with Gmail and Outlook of course, but well these are the problems, not us.
Of course, the real solution to the problem is to find a decent ISP, like a non-profit from FFDN.org federation. Then you have "real" internet and no worries for selfhosting.
Why? I try to do this, it's an exercise that I wanted to do.
Now someone in the network could follow a link from a page served from a public IP to a domain with a private IP address—which this change would disallow unless the first page was served from a "secure context" (with TLS) and the internal server responds to a "preflight" OPTIONS request with the required CORS headers to allow following links from public networks.
\s
Sure. Just give me a week or two(or several months) to shut down whole network and reconfigure all the servers, devices, and services.
Also all our business partners and vendors who integrate with our services, will be glad to switch to our new setup, exactly when we need them to.
\s
If you are building new site/network ipv6 is way to go. Migrating existing ones is next to impossible due to all of the dependencies out of your control
Wouldn't this be as simple as an `Access-Control-Allow-Origin: *` (plus all the other junk mentioned in the opt-in section[1] of the draft spec).
I'm having a hard time of thinking what wouldn't be workable in the author's situation (assuming he gets all the people with webservers to add headers to them).
And yes... understanding CORS should absolutely be a requirement for writing local webservers that people can poke from the public internet; being able to stumble your way through writing a CORS policy is basic web security at this point.
[1] https://wicg.github.io/private-network-access/#example-opt-i...
Like rather than resolve to the device, resolve to a proxy that adds those headers.
Paper: https://crypto.stanford.edu/dns/dns-rebinding.pdf
Chrome: https://bugs.chromium.org/p/chromium/issues/detail?id=98357
Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=689835#c3
As an example: imagine I am developing my application locally, at http://localhost:8080/ , and this application supports an OpenID Connect identity flow with an identity provider, https://idp.corp.example . Today I can test the login flow by telling the IDP that localhost:8080 is a valid URL to redirect back to, so that I can click a "login" button in my application, log into the real IDP, and get a token posted back to something like http://localhost:8080/idp-callback . This makes it easy to develop a system locally that also communicates with various backend microservices which require authentication with a common IDP.
I can't imagine that this is a rare scenario: it seems pretty normal to me. But if I understand the proposal, it sounds like the long-term goal is to prevent this kind of environment for local development, and instead force you to either run your dev stack remotely (with a public IP!) or else run your entire IDP stack locally (so that it has a local IP). Neither of those seem like good ideas to me.
Of course, the other option would be to modify local dev servers to accept CORS preflight requests and respond correctly, but I'm always slightly uncomfortable adding code into a local dev stack that would be unsafe if enabled in production. At very least it makes it harder to debug when something inevitably goes wrong with this API flow.
There are probably ways to solve this by introducing more proxies into a local dev stack, but I worry that these kinds of little papercuts will just make development that much harder for microservices-architecture applications, which are already hard enough to develop and debug as it is.
But yeah, I think really, browsers should be able to allow self-signed certs for localhost.
The acme.sh script actually supports quite a few providers so you can cron it up and never even have to run an out-facing HTTP server. Useful for if say your ISP blocks port 80 or if you're behind a NAT you cannot control.
On the other hand I'm also not a huge fan of these measures because they address the issue from the wrong end. Servers should protect themselves from CSRF, it shouldn't be the job of browsers to do that. A server (think router or IoT device) shouldn't be like: Hey I'm getting an internal IP anyways so I'm going to be lax.
With this there's now no motivation to fix anything from the server/device side so you have failure modes where someone's using a weird/old browser that doesn't preflight and they're vulnerable but everyone still has a false sense of security...
Additionally, I'm worried that rather than adopt the whole preflight/headers thing, a lazy org might decide to just repurpose some reserved public IP space for their internal private addressing so things don't "cross-bounds" anymore...It basically becomes unusable security that's circumvented like writing your password on a sticky because it's forced to be really complex.
Never underestimate the ability for someone to blow through any and all security or safety measures if they prevent them from doing something that they could do before...
Note that Opera came with cross network protections a decade ago, cf https://web.archive.org/web/20121001002815/http://my.opera.c...
In fact, even CSRF is mostly due to the server misusing HTTP. Look at the example in the W3C doc, where the remote site has a hidden frame/resource that hits local servers. Well guess what, GET requests should not change state, so changing some DNS configuration via a GET request is already doing it wrong.
There's no inherent reason an intranet site should be treated any differently from an Internet site. At best the current argument is that "intranet sites are more likely to be hacky and poorly implemented", but that should reflect more on those devices/services on the intranet than anything else.
You use connection timing for that, cf https://nullsweep.com/why-is-this-website-port-scanning-me/
I personally strongly disagree with this point. I believe a web browser tab should only communicate with one network location, and 3rd party content/requests should be disabled overall. This way we would have a much saner and user-respecting web.
So sure i should be able to click a link to turn off my lights using a local address (although why the fuck would i have IoT in the first place? humanity would be better off if IoT just died), but a remote website should not be able to control what i do with other locations without my explicit consent.
You mean that servers are the ones supposed to protect themselves from 3rd parties commandeering the browser to act like the browser acts when you are using it?
I fail to see how that's the correct way to solve the problem. Doing it on the server just ensures that you'll get an ever growing pile of hacks and never really solve the problem.
The example in the W3C doc (https://wicg.github.io/private-network-access/) to justify this is an instance of a broken server implementation. It's using a GET request to set some value even when GET should not have side effects. It's a common vulnerability but its totally the server's fault here.
If you have your pants down at home and someone happens to see you naked through your window, it's on you. The solution should be to close your curtains, not "make everyone wear glasses that automatically blur any open windows".
Since there's still no mdns (resolution of .local domains) in android nor in chromium despite long standing feature requests, workaround I (a hobbyist) and likely other IoT devs chose chose was to host a small website that would brute-force check local ip ranges until the IoT device was found. At least for now I have another reason to transfer hypertext securely but I've honestly no idea for future workaround (other than a large banner saying "install firefox")
If you run your own DNS resolver for your local network, you can use a Discovery Proxy (RFC 8766) to allow unicast DNS resolution of multicast DNS records. I'm using mdns-discovery-proxy[0] (slightly modified to support a newer version of the zeroconf Python library) with a forward-only zone rule in bind9 so that xyz.local is mirrored in unicast DNS as xyz.home.arpa. The latter address will work for any program on the network regardless of mDNS support.
(IIRC, Magicjack does something like that to register your device from its public site? At least that's what I think it does since it's somehow magically grabbing a serial number during sign up despite the URL entry point not having any identifying parameters...)
Let's just hope this pushes support for better options like mdns further.
On one hand i'm sorry for you. On the other hand, the less IoT there is as a whole, the better humanity will fare. IoT is a disaster for security, for the environment, and repairability... I have yet to see a single useful application of IoT which does not bring major downsides.
If your router or IoT device isn’t secure any webpage online can embed a (for example)
<img src=“http://192.168.1.1/enable_remote_access.php”>
And it’s not as if consumer routers nor cheap Chinese IoT hardware have a proven track record for security.With home networked devices the average user doesn’t know how to hide and protect those devices so here again they need professionals to do that for them too.
Windows weren’t intended to be entry points for burglaries. It just so happens that some Windows, particularly in older houses, aren’t all that secure so need additional countermeasures. Like wise for some home networking hardware.
I show this crap to my friends who are jealous.
They buy this crap, then forget to install the aftermarket firmware I spend hours of my time installing so that it's a lot safer than it was.
How do I get them through the second step when half of the "normies" I know can barely pair their phone with their car without reading the manual?
...oh wait, google drive updated itself without me asking a few weeks ago, even though I haven't used it in ages, and now, randomly, every few days, I get a popup telling me I need to sign back into drive, even though I closed the system tray application. (is being annoying to the user just an inherent property of this kind of service? are they trying to compete with OneDrive for reluctant end-user obnoxiousness??) there's probably half a dozen ways to get rid of it but it's a nice periodic reminder that I really don't care for google anymore
I had the exact same experience with Epic's craptastic launcher a few years ago. Behind the scenes update followed by a sneaky autostart entry.
I hadn't used it in a while and only discovered what had happened by accident months later
No, we're not going to do let-everyone-access-everything. We believe in layered security. Locks on the front door, locks to get around the house.
It seems to me the issue with a DNS split-horizon is that google results return DNS names that are in your local intranet, and thus resolve to a local IP, but you clicked on that link from the outside world, and hence chrome would block that.
Fwiw, I think this is generally good. Network operators shouldn't be able to arbitrarily intercept traffic on their networks.
It's the kind of thing that I thought would be impossible because it seems like such a boundary crossing. Glad they are eventually fixing this...
Seriously, if you'd told me in the mid-90s we'd have connected locks and lightbulbs and surfing to a random website could alter physical properties of my surroundings and scan my local network for vulns without my consent, i would probably have given up on IT entirely as humanity's doom.
I had to live with a work VPN that routed all traffic for all RFC1918 addresses into the corporate network. Because we had acquired companies over the years with their own RFC1918 choices, and not all was integrated and renumbered.
Since I wanted to be able to reach my own home gear at times, I used 192.0.2.0/24 for my network. Not technically RFC1918, but not used in public, either.
I still remember the incredulity from one of my friends saying "but, but, you just took someone else's addresses?" and I said "sure, but whose? does it matter?" and then he looked it up on rwhois and started reading the company name... he got as far as 'Internet Corporation for Assigned...' and then he stopped and threw something at me. Ha!
There are a number of non-public but not commonly used address spaces out there, I suspect most of them would suffice for getting around Chrome's RFC1918 blocking. Though it's possible they have another heuristic for determine what constitutes a 'private' address that includes space other than the officially recognized RFC1918 subnets.
[1]: https://developer.chrome.com/blog/private-network-access-upd...
Yes, I'm sure I want to see the terms of use page, Chrome. No, I don't need to be an advanced user to know that. Actually I do since you only let me get redirected to it if I know to type an http site you haven't seen first instead of an https one...
I think this immediate change would be fine since that public instance is a secure context, but it sounds like the ultimate direction is to prevent web->local access altogether.
Hyperlinks are great, but random javascript crap making request on our behalf is just harming us users.
Why is it impossible to view the origins of resources in one simple interactive panel? That's simpler than the major browsers' dev tools' features, in fact. Except then, the user would have a dashboard of control, which they can not be trusted with.
I have a similar setup where I have something akin to "my-home.network" and manage a wildcard cert from Let's encrypt through a local cron job. My router intercepts all the DNS requests to the domain and returns local IPs on the local network. Machines that need HTTPS can get a copy of the wildcard key and do something like "hostname.my-home.network" and get HTTP.
1. Buy a domain name. Certificates can only be issued if you have a real domain name. You can't get a certificate for "localhost" or "blah.localhost". You don't actually need to point this domain at your dev machine, you just need to own it. Let's call this domain "my-domain.com"
2. Follow the instructions for setting up the DNS-01 challenge. As a part of this, you'll need to provide credentials to allow LE to change your DNS records so it can renew the certificate automatically. Most registrars you can buy domains from will provide free DNS service and many will also provide API access to change DNS records. If this is the case, there's probably already support in LE for setup so you can just follow the instructions [here](https://github.com/acmesh-official/acme.sh/wiki/dnsapi) to provide the needed credentials.
3. Once the setup is complete, you should have a certificate (public certificate chain + private key) issued by LE and it should also automatically renew. Edit your dev server's configuration to use to these issued files for HTTPS.
4. Add something in /etc/hosts (or equivalent in Windows) like: 127.0.0.1 my-domain.com
5. Now load your dev environment by visiting `https://my-domain.com` on your local machine. It should work now with no certificate errors (green padlock). Congrats! You now have HTTPS for local dev at no cost beyond owning a domain + you can still use this domain to serve a real website (say hosted with some cloud host). The domain _does not_ need to point to your dev environment. In fact your dev machine doesn't even need to be connected to the Internet (as long as you can handle the renewals).
Advanced:
Now, if you want `my-domain.com` to also be productive, say, to serve your blog hosted on say EC2 over HTTPS, you can just edit your renewal setup. Add a post-renewal script that copies (e.g. scp) the renewed keys over to your EC2. Now both your dev machine (local) and your "production" server (remote) have the same key.
When you visit the domain locally, the /etc/hosts record circumvents DNS so you end up just hitting your local dev server which has the key info it needs to serve you HTTPS. When you visit the domain from a different machine, it would do a DNS query and end up hitting the remote instance. But since that instance also has the key info, it can also serve HTTPS.
Now if you want your dev machine to also be able to hit production, you can (1) when you setup LE in step 2, set it up so that it issues "*.my-domain.com" instead. (2) In step 4, use `dev.my-domain.com` instead of `my-domain.com`. This way on your dev machine, hitting `dev.my-domain.com` gets you the local dev server with a green padlock, hitting `my-domain.com` gets you the remote server, also with a green padlock. Both servers are sharing a wildcard certificate. The interesting part about doing it like this is that you don't need "dev.my-domain.com" to actually be a real DNS record. From the internet, nobody would even know that that subdomain exists.
There are lots of split horizon setups in small to medium size businesses, schools, colleges etc.
Just another attempt to try and push a “cloud” rent model.
Some of those links are on my internal network, and are NOT https (seriously, for small things/apps you don't need it). If I understand this correctly, Chrome will now block me clicking on these links?
I'm all for improving browser security, but as an end user, I should have the option to turn settings off that cause me a problem.
Unless i missed something, you will still be able to click links. Chrome will block the original page from running queries without your consent to your local networks, eg. a javascript bit trying to find a vulnerable router/crapware on your local network.
I agree. I will want to configure a lot of things. However, allowing finer configuration can also be helpful; you might not want to turn off that feature entirely. (For example, maybe if you want to assign that dynamic page to the local zone (if such a thing is possible; the article says something else, though) even if it isn't local, then it will be able to work such links.)
Is anyone working on making CORS stricter? I have always been annoyed that you can do cross-origin GETs and form submissions without a preflight. Whenever I Google it I just find people talking about how the existing CORS restrictions ruin their lives. Personally, never had a problem, so I'm not sure what all the fuss is about.
What about IPv6, both public routable address space and ULA space?
> User Agents MAY allow certain IP address blocks' address space to be overridden through administrator or user configuration. This could prove useful to protect e.g. IPv6 intranets where most IP addresses are considered public per the algorithm above, by instead configuring user agents to treat the intranet as private.
https://wicg.github.io/private-network-access/#ip-address-sp...
So aside from loopback and link-local, the only effect this will have on IPv6 is what the browser decides to do. If that's a manual add/remove or a look into the routing table seems unspecified.
So I will have to wait to see what form this configuration takes.
Hang on a minute, this is suddenly sounding rather familiar--I'm suddenly reminded of the Internet control panel in Windows, which lets you assign web sites to different zones (internet, LAN, trusted, restricted)...
I mean not to long ago they put out a paper on why a distributed internet is bad and ways to stop it; the people running Firefox are completely out of touch
oh wait, I haven’t used Chrome in 2 years. whew. Never mind.
Every web page you visit can access that site.
I was imagining local caches of assets or large content, like a web proxy.
Of course one obvious workaround is to misconfigure your router to allocate from a non-private but unused/reserved address space. That way your internal network is also on the "outside".
I'm curious what it will do with the 10.0.0.0/8 network.