Closing web browser windows doesn't close connections
lapcatsoftware.com
lapcatsoftware.com
Incidentally, there actually is some work being done to reduce the need to hold on to these connections. 0-RTT (zero round-trip-time) session resumption with QUIC (HTTP/3) should allow the browser to instantly pick back up a previous communication without needing to hold a socket open in the meantime.
Responding to OP's "whether or not the connection remains open". IFF it remains open, then it's no longer a matter of correlating.
Imagine this scenario:
1. User visits a site in normal mode. Browser opens connection A. Browser uses connection A to fetch the site. Browser leaves connection A open.
2. User opens private mode. User visits the same site. Browser opens connection B to fetch the site.
How does it matter that connection A was left open if some other connection was used to fetch the site in private mode? If that's not the case, then its a big deal - but that requires some sort of evidence and not just wild hand waving that it could be the case.
There are other ways of correlating those connections (like browser fingerprinting), but the connection pool isn't a problem.
That gulf is readily filled with a garden-variety VPN, which works if you're doing the kind of thing where you don't want the web site keeping tabs on you but figure the VPN's reputation is enough to keep them logging your connection and doing something nefarious with that information.
https://www.theguardian.com/world/2013/oct/04/tor-attacks-ns...
Not everyone is the five eyes, and Tor is useful in some limited cases against them, too.
In fact, I'd go one step further and recommend that if your freedom or life is at risk, then don't use computers or phones to do things that states might execute or imprison you for at all.
Additionally, lots of analytics services do TCP fingerprinting.
So they likely know it was you, if you didn't change TCP window sizes, TTLs and options (which I assume due to web browsers reusing the native OS's tcp stack).
Also if you didn't use ublock0, they will get an even better footprint via fingerprintjs (most common) that's probably as unique as it gets across your commune without having to know your exact IP.
How so?
Not that that's particularly useful info. But technically it's more info revealed.
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/s...
Imagine a phone system that didn't make an audible noise when the other person on the line hung up. At some point you realize that they've chosen to stop listening and you've been talking into to the void, but you don't know for how long.
you could usually hear the phone rattling into the cradle if it was that type of phone, and if so you would not if they just used thier finger to push down the disconnect/hangup switch..
I seem to remember you would get a dial tone when someone hung up on you too.. not immediately, that might take 8 seconds? and if you just left the phone off the hook listening to the dialtone after a while it would go to that super annoying loud beep beep beep thing..
Kind of like a warning that your phone was 'off the hook' and doing nothing - which meant you should hang it up if you wanted to be able to get a call or call out.
It's very dependant on where in the world you were. The dial-tone on hang-up thing that you get all the time in (older) movies and TV shows for example is because that's what happened in California (at least parts of, I forget the details) where movies were made. This didn't generally happen in other places.
Where I'm from IIRC you got a rapid beep. And the whole thing about the caller having to hang up was never a thing there either. Different places, different equipment.
But back in the 80s if the other side hung up, they could pick up the handset again in a few seconds and keep talking to you, since it was a physically switched connection. But it didn't take too many seconds (maybe 10?) for the phone company switches to disconnect and throw a busy tone.
But are there any packets still flowing? What if you close a site, then an attacker starts passively sniffing your traffic. If browsers didn't keep the connection open, the attacker wouldn't be able to know what sites you visited. By keeping the connection open, I think it allows the attacker to know the IPs of the sites you visited (and thus maybe know the sites).
No (except TCP keepalives and a FIN when your browser finally decides to close the connection).
> What if you close a site, then an attacker starts passively sniffing your traffic. [...] By keeping the connection open, I think it allows the attacker to know the IPs of the sites you visited
Huh? Each TCP socket only connects your computer to a single host, and will only be reused if your browser needs to send more traffic to that same host. Your computer isn’t going to randomly send packets to the wrong website, whether or not you have an open connection to that website.
These could reveal to future eavesdroppers what sites you visited in the past.
>Huh? Each TCP socket only connects your computer to a single host, and will only be reused if your browser needs to send more traffic to that same host. Your computer isn’t going to randomly send packets to the wrong website, whether or not you have an open connection to that website.
I'm talking about an attacker that is passively sniffing your traffic. For example someone on the same wifi network as you who is listening to your traffic. Not some random website.
What is creepy here is that a random website which I closed ten minutes ago get to know when I unplug my ethernet cable. I am happy to tell a website when I close it - that is its purview. But when I close a website I want it to be closed. Now I know it lingers.
No it isn't. As far as I'm concerned a well behaved website/page isn't even going to have a live connection once everything is loaded. Provided it's not a video stream or something. If data the user requested isn't actively being transferred there shouldn't be a connection.
there are lots of "or something" out there to require live connections.
Not sure if a human could even notice it, when I load HN over SSL it is virtually instant.
HTTP 1.1 specified the “Connection: Keep-Alive” header two decades ago, and it has been in widespread use ever since. It’s a fairly critical performance optimization.
Not really, since the connections aren't kept around forever[1], and can be closed for a variety of other reasons (eg. closing the browser), so it's a really poor indicator of "ethernet unplugged". If anything, since nothing's being sent over the connection, it's impossible to distinguish between "ethernet unplugged", "computer going to sleep/hiberate", or "middlebox killing idle connection".
Also as much attention as privacy gets, those users are far outnumbered by the performance oriented users. So it would be a mistake to kill a performance improvement for an imagined privacy improvement to satisfy (the even smaller segment of) privacy paranoid users.
If it can be used for nefarious purposes, it will eventually be... so it should be considered a bug.
I'm not sure what world you live in...
But the linked post is talking about a Mac, where the expectation is explicitly that the application keeps running even if it has no windows at present; if you want the process to go away then tell it to quit.
This is not true:
- Firefox keeps it for ~2 minutes and Chrome for ~5 minutes [1].
- Note there's nothing special about closing a browser window. It's the same as closing a tab, from browser's perspective. Many things are kept for a while in memory as well.
[1] https://fastmail.blog/2011/06/28/http-keep-alive-connection-... (blog post is 10 year old but the values were the same last time I checked)
This is definitely a non-obvious behavior. Browsers historically were tied to their windows - if you closed them all, there was no browser process running anymore. This seems to have changed some time ago, and doesn't seem to be well-communicated to the users.
Window is just a different UI for a tab. Closing a tab drops some resources from memory, but not all / not immediately.
When you close last window, then you close the whole browser, and the story is different. Closing whole browser = dropping all memory, connections etc.
Note in particular: when you have n>1 incognito windows, they share in-memory cache, cookies etc. (Incognito tabs put more restrictions on certain things than normal tabs, for example no disk writes, but unless you close all incognito windows, stuff still lives there in memory).
I know that Opera does stuff like that (some "speed launcher") though.
Maybe in Windows, but as long as OS X has been around, and maybe in classic MacOS (Not sure, wasn't a user) applications have been uncoupled from their windows. Closing the last windows has never closed the application. This isn't surprising, and while it's not obvious, it's not like browser are doing something different than any other application.
In my opinion, this has always been a feature of MacOS. I can close the last window of an application without quitting the application (requiring startup again if I want to open another one).
It keeps the connection open but it's not like the connection is being actively used to pass data, so surely the only information for the server is simply that the user is still there (and thus you could infer they haven't turned their computer off). That might be deeply interesting in some obscure edge cases but it's not sounding like anything that would keep me up at night. Or am I missing something?
I am not too worried about the described behavior.
1) uMatrix can block these.
2) about:serviceworkers lets you manage/remove individual ones.
3) about:config key dom.serviceWorkers.enabled lets you disable the whole thing altogether.
edit: fixed #3
I've got some bad news here.
delete Object.getPrototypeOf(window.navigator).serviceWorker
delete window.ServiceWorker
delete window.ServiceWorkerRegistration
delete window.ServiceWorkerContainer(edit: the other comments here overwhelmingly agree with me. How did this get so many upvotes to get on the front page I wonder?)
There's buttons there to close sockets and flush socket pools. I imagine this also means there's an API somewhere you could call from an extension.
Browsers maintain active connections for a number of reasons, the main two these days being notifications and service workers.
If you want to kill the connections then terminate the application via Cmd+Q or the App menu.
That's just a bit too much in my book. Nevermind that it randomly breaks TLS client certificates selection, because pre-existing TLS session may have been started with a different SNI, and you don't get a chance to re-negotiate TLS session parameters based on SNI. Some websites just randomly break depending on time passed from last visiting another hostname/website served on the same multi-host/load balancer.
Hopefully someone will find a way to abuse this, so that they stop doing it. I had enough of the misdirected request 421 errors from nginx already, due to this.
Because it's so simple, it is possible for any programmer to make their own client. Unike with web browsers which require you to basically implement an entire operating system. That means if you don't like something a client is doing, it's not a problem finding another good one.
Same goes for any number of terrible parts of the modern web: the fact that Gemini doesn't have them now is a function of its niche status and community, not some fundamental restriction. That's how HTTP 1.0 started as well.
[1]: https://gemini.circumlunar.space/docs/specification.html
I'm not sure I understand -- what's stopping me from adding one? One of Gemini's design goals seems to be client diversity and allowing clients to interpret responses on their own terms.
Edit: To be even more explicit about it: the Gemini specification doesn't include any language that says that clients and servers MUST not use the "meta" field or their response bodies to negotiate additional functionality. The observation that nobody in the Gemini ecosystem currently does is tantamount to the observation that nobody has bothered to yet, just like with HTTP 1.0.
No, the design goal is the exact opposite of that. The protocol is intentionally designed to be non-extensible so that other features that go against its spirit are not added.
You can of course add a content-length header to your server and write your own client that parses it, but you wouldn't be writing a Gemini server and client any more.
https://gemini.circumlunar.space/docs/faq.gmi goes in great length about this in section 2, and even specifically about (the lack of) content-length in section 2.12
- not fast enough yet (I expect leaner protocol and data => instant)
- navigation is still crude, directories and text are.. not ideal so far
I'm open minded, it's not a blind critic of gemini (I wish projects like that to succeed, and for instance, I use dillo regularly) but using it threw me off a little bit.
Some webmaster willing to host a Gemini server could also setup an nginx serving static markdown files with no cookies/js/... and the privacy conscious client could use lynx to browse it.
So I disagree with your earlier statement even if we exclude javascript. No, I can't tell you without clicking if a gemini URL requires a graphical browser to render properly. Without even being cheeky or pedantic.
* Might the server use it for anything without my consent?
(e.g. hacking the sandbox as this state of the browser might open another code-tree with yet unknown security-bugs, or might still running js-scripts keep going in the background even after closing the tab?)
* Might the browser use it for anything without the server's consent?
This obviously has implications for privacy e.g. if that connection is to a third-party so Firefox and Chrome are starting to partition network connections.
If you capture a Netlog in Chrome, you'll a NetworkIsolationKey (?) entry, and consisting of top-level frame origin, frame origin, request origin (or similar) that's used to key the connection an limit it's use
Edit: for real though if you’re using chrome or any equivalent browser with its own internal task manager, go on into it and kill everything except the parent task as often as you like. It’s great.
I’m not aware of any web APIs that explicitly require the browser to hold idle connections alive in a socket pool (server-sent events/websockets are a different matter; but they involve an active worker of some description—and last I knew weren’t available in service workers); this is purely a performance optimization.
[x] Allow persisted TCP connections to websites
Make that an option in the settings.
Also the 6 is the maximum number of HTTP/1.1 connections most browser configurations will open per origin; HTTP/2 lets you have as many streams open on one connection as you like (up to 2³⁰ or 2³¹ if my memory serves me, but a billion ought to be enough for anyone).
Where the host is a 3rd-party then credentialed (stylesheets, scripts, images etc) and anonymous connections (fonts, fetch etc.) will be separate