It’s a mistake to push TLS up the stack: it’s much better to move the security layer as low as possible (like QUIC) so that it can secure the transport, and so that different application protocols can share the security layer. TLS has been very good at application neutrality: basically only ssh has its own security layer and that’s largely due to it being too early.
Another interesting parallel universe is one in which IPSEC had been usable by applications without cooperation from the kernel, and supported single-end authentication with a PKI. (I don’t know enough about IPSEC’s key distribution and authentication model, but I guess that’s another reason it’s only used in VPNs.)
I have fond memories of sitting at the hotel bar at one of the Minneapolis IETFs, talking to one of the FreeSWAN developers. This could have been 20 years ago.
Dev: Why aren't you running FreeSWAN?
Me: Sure, I'd like to! Here's my laptop.
... 3 hours later ...
Dev: Hmm... I don't know why it doesn't work.
OpenSSL was a user-space library. So it was easy for applications to link to it, and start using it. IPSec required kernel modifications.
That alone was a huge barrier to adoption. If IPSec was available as a user-space library, thngs might have been different.
Just want to point out that "connect in plaintext first, then upgrade" is a recipe for security vulnerabilities. If you want to know how that looks, just look at STARTTLS (I co-authored that paper):
https://nostarttls.secvuln.info/
The HTTP-upgrade-to-TLS thing mentioned (RFC 2817) that is still implemented by some obscure HTTP servers is also flawed:
https://opossum-attack.com/
Yeah, any interloper can just foul the necessary handshake requests and force a fallback to unencrypted HTTP. We had the same problem when people proposed adding facultative TLS to Gopher. The better solution was to just leave that to the Geminists.
The parallel universe gives that up. Its security is opportunistic: the browser asks whether the server can do encryption and uses it if so. That’s great, right up until someone hides the opportunity before the handshake completes. The negotiation happens in the clear, so an attacker sitting in the middle doesn’t need to break the encryption. They just stop it from ever starting. Anyone who has set up STARTTLS for email will recognize this one.
That's the obvious flaw, but you can sorta fix that by enforcing the STARTTLS upgrade and refuse to connect if it doesn't happen.
But there's a whole can of worms of additional problems. You now have a complex state transition where your server and client have to know which part of the communication is before and after the transition.
We shouldn't forget the fact that HTTP was almost entirely unencrypted before 2010, when Firesheep made everyone realize that it was a good idea to encrypt even "non-sensitive" traffic. It was entirely normal back then to have a secure subdomain for your payments that only spoke TLS, so I suspect that a STARTTLS-like approach wouldn't have made sense anyway (in the same way that for SMTP submission it makes sense to use TLS out of the gate).
I just looked at the number of DNS resolutions my resolver has performed over the last week and it’s frankly staggering. And somebody has to provide a trust root for all of those - there’s no world I can think of where TOFU or WOT would scale to it.
WebPKI sucks, but it seems like the least sucky option.
The usual answer for the issue with WebPKI is that it's got way too many companies involved, where an issue with a single one will cause the entire system to break for a short while.
One of the issues I have is that it relies on the CA paying for audits of themselves, which causes an issue in that the incentive for auditors is to not find things, because if you get known as the ones who fail everyone, no one will buy your services when they can get someone to skim over your documentation and rubber-stamp an audit. There's a reason restaurants don't get to pick and choose who comes to inspect them.
Not everyone will be trying to skirt the requirements that come with being a CA, but all it takes is for one to do so and then end up compromised over it.
Things seem to be moving towards helping people hide the desired hostname in the request by starting the connection encrypted. And that is a pretty damn good thing to have in a world where single IP happens to be a gateway to many very diverse resources, while the infrastructure all the way up to that IP is actively participating in an evesdropping operation. This proposal sort of requires to negotiate everything in plain text, which is a step backwards.
Anyway, I never really figured out why anyone would look at STARTTLS and think "That's a good design, I want that in my protocol." All you get is backwards compatibility exactly where you don't want it and a wide array of ways to accidentally mess things up.
And the fact that Netscape made TLS a transport protocol that cares not about the inner protocol is exactly the reason why we didn't have to reinvent the wheel every time we remembered that another service is transmitting in clear text.
The rough history is that in the late 1990s, SSL/TLS were retrofitted onto a bunch of protocols in the same manner as http, so they got allocated a second port with an “s” appended to the protocol’s URL scheme. (Principally imaps, pops, smtps; it didn’t happen to telnet and ftp in the same manner.)
There were a couple of problems with this approach. More broadly, some in the IETF didn’t like the duplication, especially because there was a risk that another security layer might turn up (kerberos? ipsec?) then every application might need 5 ports and 5 URL schemes. And specifically for SMTP it wasn’t obvious how smtps should be negotiated between sites, made more difficult because at that time there was not yet a clear distinction between mx, submission, and relaying.
So STARTTLS was invented to deal with these problems in the mail protocols, and adapted in similar style for jabber/xmpp, and http Upgrade: TLS. (Compare and contrast the layer cake of SASL + GSSAPI + Kerberos which can also establish a security layer with client authentication.)
But then it was realised that it’s very difficult to avoid downgrade attacks. (It could have been better for the MUA protocols, in theory, if MUA software had done sensible things like automatically setting a strict transport security flag when the server offers TLS. But in practice MUA configuration was a shitshow.) And it transpired that TLS had won the secure protocol wars. So everything went back to the original design with separate cleartext and TLS ports.
Except for SMTP to MX servers, which has awkward naming issues that were not clarified until far too late, and even more awkward compatibility issues, so it’s stuck on STARTTLS.
fanf | 19 hours ago
It’s a mistake to push TLS up the stack: it’s much better to move the security layer as low as possible (like QUIC) so that it can secure the transport, and so that different application protocols can share the security layer. TLS has been very good at application neutrality: basically only ssh has its own security layer and that’s largely due to it being too early.
Another interesting parallel universe is one in which IPSEC had been usable by applications without cooperation from the kernel, and supported single-end authentication with a PKI. (I don’t know enough about IPSEC’s key distribution and authentication model, but I guess that’s another reason it’s only used in VPNs.)
alandekok | 11 hours ago
I have fond memories of sitting at the hotel bar at one of the Minneapolis IETFs, talking to one of the FreeSWAN developers. This could have been 20 years ago.
Dev: Why aren't you running FreeSWAN?
Me: Sure, I'd like to! Here's my laptop.
... 3 hours later ...
Dev: Hmm... I don't know why it doesn't work.
OpenSSL was a user-space library. So it was easy for applications to link to it, and start using it. IPSec required kernel modifications.
That alone was a huge barrier to adoption. If IPSec was available as a user-space library, thngs might have been different.
hanno | 17 hours ago
Just want to point out that "connect in plaintext first, then upgrade" is a recipe for security vulnerabilities. If you want to know how that looks, just look at STARTTLS (I co-authored that paper): https://nostarttls.secvuln.info/
The HTTP-upgrade-to-TLS thing mentioned (RFC 2817) that is still implemented by some obscure HTTP servers is also flawed: https://opossum-attack.com/
classichasclass | 16 hours ago
Yeah, any interloper can just foul the necessary handshake requests and force a fallback to unencrypted HTTP. We had the same problem when people proposed adding facultative TLS to Gopher. The better solution was to just leave that to the Geminists.
Pomax | 16 hours ago
hanno | 14 hours ago
That's the obvious flaw, but you can sorta fix that by enforcing the STARTTLS upgrade and refuse to connect if it doesn't happen. But there's a whole can of worms of additional problems. You now have a complex state transition where your server and client have to know which part of the communication is before and after the transition.
freddyb | 14 hours ago
And there was Opportunistic Encryption in HTTP too, for some brief time. See https://en.wikipedia.org/wiki/Opportunistic_encryption.
keito | 12 hours ago
We shouldn't forget the fact that HTTP was almost entirely unencrypted before 2010, when Firesheep made everyone realize that it was a good idea to encrypt even "non-sensitive" traffic. It was entirely normal back then to have a
securesubdomain for your payments that only spoke TLS, so I suspect that a STARTTLS-like approach wouldn't have made sense anyway (in the same way that for SMTP submission it makes sense to use TLS out of the gate).dvogel | 10 hours ago
This blog post is the result of an LLM prompt paired with a copy/paste. The prose is off-putting. This is the part that matters.
adrien | 19 hours ago
The premise seemed interesting to me but the page is completely AI-generated unfortunately.
ryan-duve | 18 hours ago
I used to share this stance before eMudhra.
owen | 13 hours ago
What’s the alternative?
I just looked at the number of DNS resolutions my resolver has performed over the last week and it’s frankly staggering. And somebody has to provide a trust root for all of those - there’s no world I can think of where TOFU or WOT would scale to it.
WebPKI sucks, but it seems like the least sucky option.
DustyFuzzy | 38 minutes ago
The usual answer for the issue with WebPKI is that it's got way too many companies involved, where an issue with a single one will cause the entire system to break for a short while.
One of the issues I have is that it relies on the CA paying for audits of themselves, which causes an issue in that the incentive for auditors is to not find things, because if you get known as the ones who fail everyone, no one will buy your services when they can get someone to skim over your documentation and rubber-stamp an audit. There's a reason restaurants don't get to pick and choose who comes to inspect them.
Not everyone will be trying to skirt the requirements that come with being a CA, but all it takes is for one to do so and then end up compromised over it.
czarkoff | 9 hours ago
Things seem to be moving towards helping people hide the desired hostname in the request by starting the connection encrypted. And that is a pretty damn good thing to have in a world where single IP happens to be a gateway to many very diverse resources, while the infrastructure all the way up to that IP is actively participating in an evesdropping operation. This proposal sort of requires to negotiate everything in plain text, which is a step backwards.
Anyway, I never really figured out why anyone would look at STARTTLS and think "That's a good design, I want that in my protocol." All you get is backwards compatibility exactly where you don't want it and a wide array of ways to accidentally mess things up.
And the fact that Netscape made TLS a transport protocol that cares not about the inner protocol is exactly the reason why we didn't have to reinvent the wheel every time we remembered that another service is transmitting in clear text.
fanf | 6 hours ago
The rough history is that in the late 1990s, SSL/TLS were retrofitted onto a bunch of protocols in the same manner as http, so they got allocated a second port with an “s” appended to the protocol’s URL scheme. (Principally imaps, pops, smtps; it didn’t happen to telnet and ftp in the same manner.)
There were a couple of problems with this approach. More broadly, some in the IETF didn’t like the duplication, especially because there was a risk that another security layer might turn up (kerberos? ipsec?) then every application might need 5 ports and 5 URL schemes. And specifically for SMTP it wasn’t obvious how smtps should be negotiated between sites, made more difficult because at that time there was not yet a clear distinction between mx, submission, and relaying.
So STARTTLS was invented to deal with these problems in the mail protocols, and adapted in similar style for jabber/xmpp, and http Upgrade: TLS. (Compare and contrast the layer cake of SASL + GSSAPI + Kerberos which can also establish a security layer with client authentication.)
But then it was realised that it’s very difficult to avoid downgrade attacks. (It could have been better for the MUA protocols, in theory, if MUA software had done sensible things like automatically setting a strict transport security flag when the server offers TLS. But in practice MUA configuration was a shitshow.) And it transpired that TLS had won the secure protocol wars. So everything went back to the original design with separate cleartext and TLS ports.
Except for SMTP to MX servers, which has awkward naming issues that were not clarified until far too late, and even more awkward compatibility issues, so it’s stuck on STARTTLS.