Two critical remote code execution bugs turned up in nginx today, both rated 9.2, both reachable without authenticating. Patch first, then come back, because the bugs themselves are not the interesting part. The interesting part is why bugs like them sit in the open for years — and the fact that client certificate authentication has been carrying one of its own for about as long.

Left: one fixed login host, where logout clears the cookie but not the cached certificate. Right: a per-attempt subdomain bound to a store entry and a short-lived cookie, retired on logout.
The browser will not forget the certificate you picked. Give it a name worth forgetting instead.

Two remote code execution bugs, and why bugs like them sit around

The two nginx flaws are memory-safety bugs in the HTTP/2 code. One is a use-after-free in connection handling, the other an integer underflow in the flow-control window, and either one lets somebody who has never authenticated run code on your server. The second one reaches back to the release that first shipped HTTP/2, which means it has been sitting in production binaries for about a decade.

The write-up is careful to say that exploitation is difficult in practice, and the proof of concept has not been published. I believe both of those things, and I also think that is exactly the problem. A bug that is hard to exploit is a bug that is easy to defer.

This should not come as a surprise to anyone. Almost nobody invests heavily in security before the business is making money, and even afterwards, a finding with a complicated exploitation path gets written down as an acceptable risk so the team can go back to shipping. That is usually a defensible decision. It stays defensible right up until the day somebody does the hard work.

There is an mTLS version of the same story

Here is one that has been open for years, has no CVE, no severity score and no patch coming, and that I run into constantly: there is no way to log a user out of client certificate authentication.

When a user picks a certificate for a site, the browser remembers the pairing of that origin and that certificate for the rest of the browsing session, and answers every later certificate request from that origin on its own. That is a deliberate usability choice. Nobody wants a card prompt on every image on the page, and a request should not behave differently depending on which pooled connection it happens to land on.

Now log out. Your application does everything right: it drops the session, clears the cookie, revokes the token. The browser still holds the certificate selection, and it still holds an open, already-authenticated connection in its pool. The next person who sits down at that machine opens the same site and is, as far as the handshake is concerned, still the previous user. No prompt, no card, no choice to make.

The places this matters are exactly the places that use certificates in the first place: a shared clinical workstation, a counter terminal, a lab machine, a kiosk, a virtual desktop that several people pass through in a shift. The strongest credential on the network, undone by a browser doing something sensible.

Why nobody has fixed it

The obvious answer looks like it should work and does not. The standard header for clearing site data can clear the authentication cache, but only when it also clears cookies, which takes the persistent ones with it. Chromium has not implemented that part at all. And clearing the cache alone would not be enough anyway, because the authenticated connections sitting in the reuse pool have to be closed too, or the next request simply rides one of them.

What actually works, reliably, across browsers, is restarting the browser. Not closing the tab, not closing the window. Edge eventually added a way for the user to forget a certificate, and Chrome has a flag that clears selections when the last window of a profile closes. Neither of those is something your login page can ask for.

So the ticket stays open, and I understand why. The audience is small and mostly enterprise. The blast radius is the next person at that keyboard rather than the whole internet. The fix touches connection pooling, which is delicate. There is no scanner flagging it, no compliance clause naming it, no disclosure deadline. It is an acceptable risk, assessed by people who are not the ones sitting at the shared terminal. Same calculus as the nginx bug, minus the CVE that forces a decision.

Changing the shape of the problem

I could not make the browser forget. So I stopped trying, and made what it remembers worthless instead.

The browser keys the certificate it remembers to an origin. Give every authentication attempt its own origin, and there is nothing to inherit.

In practice it works like this. The user starts on the normal login page and chooses certificate sign-in. The server picks a one-time hostname under a wildcard, something like a1b2c3.mtls.example.com, writes that identifier down, and sets a cookie on the parent domain holding the same value, with a lifetime measured in minutes. It then redirects the browser there. The browser has never seen this origin, so it asks the user which certificate to present, every single time.

The handshake happens on that hostname. The server validates the certificate, and then checks the identifier three ways: the hostname that was actually connected to, the entry in the store, and the cookie. All three have to agree or there is no session. On logout, or when the clock runs out, the entry and the cookie are dropped and that hostname is never issued again.

The browser still caches a certificate selection. It caches it against a name nobody will ever visit again. The next person starts at the parent domain and gets sent somewhere new. No browser changes, no extension, no enterprise policy, no asking users to restart anything.

What it costs, honestly

This is a workaround, and workarounds have a bill.

You need wildcard DNS and a certificate that covers the subdomain space, which is one more thing to renew and one more thing to get wrong. The store is now on the login path, so it has to be quick and it has to expire entries reliably. Cookie scope across the parent and the subdomain needs thought, and so does strict transport security. You will see a lot more hostnames in your logs and in anything that pins or allowlists them.

It also does not do everything. If somebody has the card and the PIN, they are that user and no amount of namespace juggling changes it. This closes the inherited-session gap on shared machines, which is a narrow and real thing, and nothing wider. And the certificate prompt comes back on every sign-in, which is the entire point and which some users will still file as a regression.

The pattern underneath

Two things stay with me from writing this up.

One is a design habit: when the standard gives you no lever, look at what the standard is keyed on and change that instead. The browser would not give me a logout, but it did give me a cache key.

The other is less comfortable. Both of these bugs survived for the same reason, which is that the cost of leaving them alone lands on somebody other than the person deciding. That is worth remembering the next time a finding comes back with a difficult exploitation path and an easy decision attached.

That is the part I would push back on hardest if somebody showed me this design. Not “is the mitigation elegant”, but “who is carrying the risk while we decide not to act”.

Why I am publishing this instead of filing it

I wrote this up as a patent application. I am not going to file it.

The people who actually need this are running shared terminals in hospitals, government offices, factories and branch counters, usually on a budget that has no room for a licensing conversation about a logout button. Gating a fix for a decade-old gap behind a patent would make me part of the reason it stays unfixed, and I already spent most of this post complaining about that.

There is one practical reason to publish rather than simply shelve it, and it is worth saying plainly: a public, dated description is prior art. Putting this in the open means nobody else can patent the same mechanism later and come after the people using it. That protection only exists if the description is specific, which is why the walkthrough above names the moving parts instead of gesturing at them.

So take it. Implement it, change it, ship it in your own product, argue with the trade-offs. If you build it and find a hole I missed, I would genuinely like to hear about it. Related reading on this site: authentication methods, device-bound sessions and how we think about security.

References