9 ms·
Encrypted Client Hello: The Future of ESNI in Firefox
- jagger27 6y agoOpenSSL doesn't support this yet, so neither does nginx.
- darkhorn 6y agoESNI is the only reason why I use Cloudflare in some of my web sites.
- corty 6y agoThis is extremely ugly. They got rid of ESNI because it was an incomplete solution possibly exposing the connection target anyways. So they decided to encrypt the whole client hello message, calling it ECH (encrypted client hello). However, to make it work, they need the server's public key out of DNS. To get that, they didn't rely on preexisting TLSA records intended for this purpose (partly because it wouldn't work in some cases, TLSA can either contain fingerprints or pubkeys). Instead, they defined a whole new DNS record type to publish those keys. But those records, called SVCB, don't just publish keys. They are an amalgamation of SRV records (this service called "something" is actually at that host and port), CNAME records and a list of key/value-properties with associated priorities. If you think you might know that one, yes, it looks almost like all of DNS inside DNS again. Just another Meta-DNS, because all those RRs aren't fancy enough already. Or maybe Cloudflare just wants a way to put all their internal routing info into DNS somehow. Anyways, I'll wash my eyes with soap now...
- Koffiepoeder 6y agoIn that case, wouldn't it have been more logic to use eDNS OPT query fields instead?
- pas 6y agoProbably much harder than simply adding a new record resource type.
- LinuxBender 6y agoIf it depends on DNS, does that not expose the name being requested via DNS and defeat the point of ESNI? I guess I need to go read up on this. Reading Cloudflares blog, it appears they assume people are using DoH or DoT.
- Fnoord 6y agoNot if your DNS is encrypted (e.g. DNSCrypt, DoH, DoT, ...) I suppose it does if you run your own resolver?
- kevincox 6y agoBut your resolver still needs to fetch those from somewhere. So you need encryption somewhere in the chain.
- admax88q 6y agoDoH or DoT is encrypted. The address of the upstream resolver typically is hard coded or comes as a parameter during DHCP.
- pas 6y agoPlus both Firefox and Chrome has built-in DoH support.
- ameshkov 6y ago> it appears they assume people are using DoH or DoT Things changed since then, now plain DNS is also allowed.
- w3ll_w3ll_w3ll 6y agoIf the DNS query is done with DoT or DoH the server name is not exposed.
- LinuxBender 6y agoThat is what I took from their blog as well. For some reason I thought the original intent of ESNI was to do some type of opportunistic or self signed handshake for the (E)SNI portion to hide the requested name, then validate the actual site certificate. They must have run into a problem.
- Nullabillity 6y agoAren't SRV records CNAME-ish as well? So it kind of makes sense to see SVCB as SRV 2.0, I guess.
- pas 6y agoYep, just not widely implemented. Hence a new thing with new hopes. It looks really nice though, and it seems it has vendor support too. https://blog.cloudflare.com/speeding-up-https-and-http-3-negotiation-with-dns/ https://blog.cloudflare.com/speeding-up-https-and-http-3-neg...
- tialaramex 6y agoSo, one reason not to have this as like fifty separate DNS records is that consistency is essential. DNS doesn't provide any consistency guarantees, if you ask "A? foo.example" and "AAAA? foo.example" you are not promised that your answers represent the same moment in time, one of them might be brand new while the other has been cached for six hours and is now obsolete. For A vs AAAA that's fine, you don't need both to be consistent you just want either of them to work. For ECH this could mean you get told key A (from yesterday), target name B (just changed now) and port number N (six hours old) and then when you try to connect to port N with key A and target name B that combination doesn't work. So by bundling everything you need into a single record means the only remaining problem is that a cached record might be out-of-date, an ordinary routine mistake by operators that happens for any DNS records. The other reason is dirtier and practical: We want all this information to make (for example) a web browser work. So why have the web browser always make fifty queries when there could be one query that encapsulates everything needed?
- corty 6y agoDNS is never consistent, that is an explicit non-goal. You can also get a CNAME from last week pointing to a CNAME from 5 minutes ago pointing to a nonexistent hostname in a nonexistent zone. This feels very much like hammering on DNS to make it look like a bad copy of etcd or something. Also, http(s) within SVCB is an ugly special case to be handled differently than other SVCB records. And one SVCB answer doesn't contain all you need. E.g. there is no intent to be a replacement to or consistent with TLSA entries, so you will still need to do mutiple queries. It just contains the ECH key, so it rather looks like a half-baked kludge to make ECH work somehow.
- 1vuio0pswjnm7 6y agoIn studies I have done, most websites on the internet do not require SNI. Thus with most websites there is no problem of domain names in plaintext being sent in ClientHello packets, and no need for ESNI. There are not many ESNI-enabled websites on the web, but Cloudflare's CDN offers ESNI service. Thus, one can use ESNI for websites that use Cloudflare. I have been testing ESNI for a while now. I use it for reading websites text-only with no ads or tracking. I use links; I am not a fan of "modern" browsers. IMHO, Cloudflare's ESNI is very fast. It seems even faster than normal TLSv1.2 or TLSv1.3. https://defo.ie https://defo.ie is one source for ESNI info, including links to source code on Github for ESNI-enabled openssl, curl, lighttpd, etc. If you compile the ESNI-enabled openssl from Github, below is a one-liner and a small script to try ESNI out. First you must fetch an ESNI key in a TXT RR from Cloudflare DNS. Then you use the key to submit HTTP requests for about an hour, until it expires. Then you must get a new key. # one-liner to fetch a key # if you run your own DNS you could then put this into a TXT RR in your own zone file #!/bin/sh curl "https://cloudflare-dns.com/dns-query?name=_esni.www.cloudflare.com&type=TXT&ct=application/dns-json"|grep -o [/][^\\]* > esnirr It seems that connecting to cloudflare-dns.com to fetch the initial key via DoH requires SNI. Why not have a bootstrap server that is not on a shared IP and hence does not require SNI. # try out ESNI using the key # usage: echo https://some.cloudflare.website.com|$0 # usage: $0 HEAD < file-of-urls-with-same-domainname -- (http/1.1 pipelining) #!/bin/sh read k < esnirr exec 2>/dev/null (while read uri;do case $uri in http://*)uri=${uri#*http://};;https://*)uri=${uri#*https://};esac; export host=${uri%%/*};path=/${uri#*/};test ! ${#path} -gt ${#url}||path=/; printf ${1-GET}' '$path' HTTP/1.1\r\nHost: '$host'\r\nConnection: keep-alive\r\n\r\n'; done|sed 'N;$!P;$!D;$d';printf 'Connection: close\r\n\r\n') > .http; host=$(sed -n '/^Host: /{s/.*Host: //;p;q;}' .http|tr -d '\r'); # Any Cloudflare IP should work - 104.16.249.249 is just one example # https://www.cloudflare.com/ips-v4 openssl s_client -4 -tls1_3 -noservername -ign_eof -verify 9 -connect 104.16.249.249:443 -esni $host -esnirr $k < .http rm .http "Modern" browsers are stupid. They are sending domain names in the clear even when the website is not using SNI. https://github.com/kontaxis/snidump https://github.com/kontaxis/snidump
- chaz6 6y agoI agree the whole design is horrible. I would much rather have had no DNS records whatsover, and instead used onion-style layered TLS, rather like how 802.1X works with outer and inner authentication. The browser would first initiate a TLS connection to the IP address, using the IP address as subject name. It then creates a second connection inside the first using the domain name as subject name.
- fpoling 6y agoHow the authenticity of IP address is established then? Wouldn’t the server need a certificate for its IP?
- corty 6y agoEither for its IP or for the hostname that results from the reverse-lookup of the IP. The latter is easier to obtain (proof of ownership for IPs is cumbersome) and is often present anyways. It would need an additional DNS lookup, but the present suggestion involving SVCB would need that as well (along with all the other uglyness).
- ameshkov 6y agoCan anyone explain why is it designed this way? Why was it necessary to involve DNS into this? Was it unavoidable or is that all in the name of keeping 0-rtt possible? Tbh, with the current implementation, ECH setup seems rather complicated to me. It benefits CDNs like CloudFlare since they control both DNS and the handshake process, but those who would like to setup ECH on their own are in trouble.
- unilynx 6y agoYou need to know if you're talking to the server you think you're connecting to, otherwise a man-in-the-middle could impersonate the server and intercept the handshake to see the hostname you're trying to connect. So you need another channel to pull a public key (or something comparable), and they picked DNS for that
- ameshkov 6y agoAs someone suggested in a different comment: handshake with one certificate, then send a new ClientHello that contains the desired hostname and "re-handshake" with the real cert?
- shawnz 6y agoHow do you validate the authenticity of the first certificate without revealing any hostnames?
- ameshkov 6y agoIf we're keeping this simple, then I'd say have IP address in subaltnames. Obtaining such certs shouldn't be a problem for CDNs, and possible for others as well (regarding free options: Let's Encrypt doesn't support that, but ZeroSSL does)
- corty 6y agoYou wouldn't even need a cert for an IP address (which is hard to get). You could just resolve the CNAME and A records until you arrive at an address, do a reverse lookup on that address. Then use the resulting "primary" PTR hostname for the encryption certificate. No additional info for an attacker, no new weird RRs, in the best case just one additional DNS query (but SVCB would need that as well).
- unilynx 6y agoHTTPSSVC might, as a side effect, finally solve the problem of not being able to point the root of a domain (eg 'google.com') to a CDN. (although the rollout of HTTPSSVC to all DNS servers and domain hoster APIs will probably take even longer than the phase-out of IE..)
- _wldu 6y agoIsn't that because CNAMES may not be combined with other records and SOA and NS are required on whatever.com? https://tools.ietf.org/html/rfc2181 https://tools.ietf.org/html/rfc2181
- unilynx 6y agoYep. There was talk of ANAME records at IETF but that doesn't seem to be really going somewhere Some DNS servers implement something they often call ALIAS, but it's basically the equivalent of having a crontab mirror the settings of the records you're referring to, and breaks eg. geo-dependent address resolving (so not that useful for referring to a CDN, which is why you'd most likely want this)
- corty 6y agoSRV records would already support that is browsers would look them up. But unfortunately they don't.
- EvanAnderson 6y agoI wish SRV records had been adopted widely. It would be a much nicer world.
- pas 6y agoThat's the [new] hope with SVCB. https://blog.cloudflare.com/speeding-up-https-and-http-3-negotiation-with-dns/ https://blog.cloudflare.com/speeding-up-https-and-http-3-neg...
- xfalcox 6y ago
- superkuh 6y agoSo... the attack on this would be to take over the local nameserver (or even just system DNS resolution) of the clients trying to get to a domain and then serve your own public key?
- progval 6y agoMozilla also pushes for DNS over HTTPS, so the browser uses a hardcoded server by default (eg. Cloudflare).
- justin_oaks 6y agoThat would work right up to the point where the server returns a certificate that the client needs to validate. If you're an attacker then you'd also need to have a certificate with a matching domain and is signed by a trusted certificate authority. Otherwise the client will see the certificate as untrusted. Having a trusted certificate for a domain you don't own is already the "Game Over" scenario for current TLS connections since DNS hijacking is generally much easier.
- shawnz 6y agoIf you can do that, there's no need to change any keys. You can just look at the DNS requests that come in and the hostnames will be revealed that way. That is why it is important to also use encrypted DNS in addition to ESNI.
- filleokus 6y agoEncrypting the SNI is probably a good idea. According to Wikipedia one Russian ISP and China has already blocked ESNI'ed connections, which is probably a good sign that it's doing something. But still, it feels like such a hack throwing this into the DNS records. A mess for server operators to implement if you don't manage your DNS records via an API today (since they'll need to be changed when certs rotate). And I'm guessing that a wast majority of people use the ISP default DNS (or Google/Cloudflare), that brings plenty of privacy problems on its own... Maybe ESNI/ECO is really worth the hassle in a future where the whole Oblivious DNS-thing[0] is widely spread. [0] Someone like Apple would proxy your encrypted (DoH) DNS requests to Cloudflare, so neither Cloudflare nor Apple can see what a specific user is querying
- pas 6y agoThere's no obvious place to put it. Conjuring up CertificateTransparency-like public notaries might work, but who would run them? It would basically have the exact same operational requirements as DNS resolvers. Plus DNS is already "inlined" to the process. This suffers from the same problem as the v4-v6 migration. There's simply no good way to solve it other than biting the bullet and laying the new v6 pipes. (Though this is a bit easier, but getting DNSSEC off the ground, the root signed, getting root rollover worked out ... all of that like v6 deployment took more than a decade, and it's just getting mainstream.)
- filleokus 6y agoTrue. I'm just saying that it's a lot of work for a pretty small improvement (as the world looks today). But maybe I'm incorrect, maybe this would solve real world problems today? I'm just thinking that if you don't have encrypted DNS queries, your basically still revealing similar info (at least on first/uncached connections). If you use DoT to your ISP, they will have similar info. If you use DoH to Google/Cloudflare, they will have similar info. How big is the privacy gain over cleartext SNI on first connection + client side caching of certs and encrypted SNI on later connections? Obviously it depends on your threat model, this + DoH/DoT to someone you trust would protect from plenty of things in an environment where a passive attacker can see your network traffic. But the question is who to trust...
- parliament32 6y ago>A TLS server supporting ECH now advertises its public key via an HTTPSSVC DNS record Why a new record type, when TLSA records were invented for literally this exact purpose?
- pas 6y agoBecause it's like TLSA + SRV [which itself is basically CNAME + a port hint] + A + AAAA in one. (Because there's no "consistent multi querying" in DNS, so it had to be basically multiplexed into one RR type.) https://blog.cloudflare.com/speeding-up-https-and-http-3-negotiation-with-dns/ https://blog.cloudflare.com/speeding-up-https-and-http-3-neg...
- snuxoll 6y agoOkay, I can see why this new record type would be beneficial given the lax consistency model of DNS - seems a little lame to make the record type ‘HTTPSVC’ given that other TLS-enabled services could benefit from the same guarantees.
- teddyh 6y agoAs I understand it, the new record types are “HTTPS” and “SVCB” (“service binding”). The SVCB record is a generic SRV-like thing, and HTTPS is like SVCB but with extra things which HTTPS needs.
- tialaramex 6y agoYou want to bundle the entire configuration, because DNS doesn't provide any consistency guarantee between records.
- sedatk 6y agoIsn't DNS doing too much work in this? How do you authenticate DNS results?
- _flux 6y agohttps://github.com/dlundquist/sniproxy https://github.com/dlundquist/sniproxy does not yet support ESNI. But might supporting ECH be completely infeasible? So for those unfamiliar, sniproxy is able to forward traffic to virtual hosts with their own encryption keys, by dispatching the connection based on the SNI of the handshake. After determining the correct vhost it initiates its own handshake with the destination and then hands the connection over to the original client, so the host running sniproxy does not need access to any keys or certificates.
- asdfthrowawayyy 6y agoasdf
- asdfthrowawayyy 6y agoYah but what these turds did not mention is that as long ago as Firefox 83, they simply removed all production ESNI code, silently, without warning a single soul. As in, hundreds of thousands if not millions of Firefox browser users that were relying upon encrypted SNI in despot regimes - after waiting some two fucking years for Cloudflare to actually implement ESNI on their endpoints - updated their browser one day, just to have all SNI in the clear and without a word of warning from the Firefox development team. In order to implement ECH which nobody supports yet, no mainstream even nightly web server build has ECH yet, with exception to early alpha Cloudflare go code which based on the initial ESNI debacle is probably ~1.5 years away from being implemented on their production DNS servers. Firefox devs are a buncha losers.
- pabs3 6y agoI suggest reading this presentation and blog post: "What can you learn from an IP?" https://irtf.org/anrw/2019/slides-anrw19-final44.pdf https://irtf.org/anrw/2019/slides-anrw19-final44.pdf https://blog.apnic.net/2019/08/23/what-can-you-learn-from-an-ip-address/ https://blog.apnic.net/2019/08/23/what-can-you-learn-from-an...