Support using the OS Resolver for ECH
Categories
(Core :: Networking: DNS, enhancement, P3)
Tracking
()
People
(Reporter: jan, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: feature, nightly-community, Whiteboard: [necko-triaged][necko-priority-review])
Attachments
(2 files)
Reporter | ||
Comment 1•6 years ago
|
||
Comment 2•6 years ago
|
||
Reporter | ||
Comment 3•6 years ago
|
||
Updated•6 years ago
|
Comment 4•6 years ago
|
||
Reporter | ||
Comment 5•6 years ago
|
||
Comment 6•6 years ago
|
||
I use dnscrypt-proxy found at https://github.com/jedisct1/dnscrypt-proxy which already has DoH/ESNI implemented, so Firefox should be able to detect that and be aware of it, that way I don't have configure DoH in Firefox to ensure ESNI working.
same thing here, i use stubby with my system resolver, encrypted DNS works fine, but the ESNI feature in firefox seems to require the firefox built-in resolver; that makes no sense to me, aren't DNS and SNI two completely seperate things?
https://i.postimg.cc/tTTrbZyq/Jul11-110531.png
I was wondering why this is at P5 priority. Is this definitely something that you "basically never want" (as per Moz Priority System)? This seems like a very sensible feature.
Comment 9•5 years ago
|
||
(In reply to Vishnu from comment #8)
I was wondering why this is at P5 priority. Is this definitely something that you "basically never want" (as per Moz Priority System)? This seems like a very sensible feature.
That page is actually how the Bugzilla projects assigned priorities for the development of Bugzilla.
https://mozilla.github.io/bug-handling/triage-bugzilla is what the priority means for Firefox. So this one is P5 - Will not fix, but will accept a patch
Comment 10•5 years ago
|
||
The general meaning behind the priorities is the same, though. P5 is "We'll never work on this but -may- accept a patch if someone submits it" which basically never happens.
It does seem like a very sensible feature to have. Requiring DoH for ESNI to work is not very sensible since they are separate mechanisms and have no strict dependencies between them (aside from the Mozilla implementation not supporting what's needed without DoH enabled). If we actually want this to become more widely adopted, it shouldn't be locked behind a different feature that has privacy drawbacks and might not be enabled because of that.
Comment 11•5 years ago
|
||
Encrypted DNS can be installed for the entire system and even for the entire network (dnscrypt-proxy, simplednscrypt, pi-hole...)
-> Firefox should not require ESNI to depend on its internal DNS resolver.
If the DNS is already encrypted, there are no technical reasons not to enable ESNI. The only reasons I can see are political.
Can we at least expect a preference flag?
Comment 12•5 years ago
|
||
What does it mean patch welcome? I am perfectly sure that the patch is changing one or 2 line in code!
I will also copy my issue https://bugzilla.mozilla.org/show_bug.cgi?id=1542754
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36
Steps to reproduce:
If you put 1dot1dot1dot1.cloudflare-dns.com in Private DNS in Android 9, DNS over TLS will be activated and working. But your Trusted Recursive Resolver doesn't consider it, it still should be activated to access network.security.esni.enabled set to true.
Actual results:
Trusted Recursive Resolver should be activated though the user may already have DoH or DoT installed. Also I don't understand why DNS should be encrypted. All that happens in encryption of SNI in DNS part is asking public key from TXT of _esni. subdomain of the domain you accessing; I understand the risk of DPI finding out _esni DNS query, but on the other hand, DPI will not intervenue with TLS 1.3 eSNI connection itself, it will be very helpfull in countries, which has such DPI regulation; besides that DNS queries are cached, so it means that even if DPI will block access the first time, the second time it should work.
Expected results:
network.security.esni.enabled should not be connected with TRR in any way, after that I think we should rewrite its defaults to true. Look into it; make sure that if any problems to connection happen, it would go down to non encrypted SNI. But true should be the defaults.
Besides that I think we should help Google to implement it. After all I think the idea of eSNI has the same level of revolution as ephemeral keys of perfect forward secrecy in https. After that DNSSEC keys can be used as certificates insteed of CA certificates. And I am not talking about only IP blocks possible after eSNI will become popular. Post DPI era is coming!
Look into https://bugs.chromium.org/p/chromium/issues/detail?id=908132
Comment 13•5 years ago
|
||
Also tell me please about my comment "look there, I asked chromium devs about which DNS query (ESNI or TXT) they are going to use. And they will use ESNI. https://bugs.chromium.org/p/boringssl/issues/detail?id=275#c_ts1561592153
Are you in contact with cloudflare? What are they going to do?"
This is unacceptable!
Comment 14•5 years ago
|
||
(In reply to val.zapod.vz from comment #12)
What does it mean patch welcome? I am perfectly sure that the patch is changing one or 2 line in code!
It is a bit more, Firefox first has to implement a DNS resolver for non-DoH queries since it only uses getaddrinfo
to resolve IP addresses. Additional DNS queries can be implemented with res_nquery
from libresolv (included in glibc >= 2.9) on linux and DnsQuery_A
on windows.
I have taken a look at the code and it seems like in nsHostResolver::ResolveHost
you have to allow for queue priority adjustments for non-A/AAAA records, in nsHostResolver::NameLookup
you have to allow native non-address lookups, nsHostResolver::NativeLookup
has to be adjusted, and in nsHostResolver::ThreadFunc
you have to call res_nquery
for non-A/AAAA and then parse the result with functions from /include/arpa/nameser.h
. The functions in this header are part of the libresolv API, but have no documentation. In a second codepath use DnsQuery_A
. You might also have to move around members of nsHostRecord
, TypeHostRecord
, and AddrHostRecord
.
I have no idea about android, maybe it is possible with DnsResolver::rawQuery
or does it support libresolv as well? rawQuery also requires implementing functions to create dns queries as binary data and parse the response.
I have not enough time to compile and test it on my slow computer, so I don't think I will create a patch.
http://man7.org/linux/man-pages/man3/resolver.3.html
https://docs.microsoft.com/en-us/windows/win32/api/windns/nf-windns-dnsquery_a
https://developer.android.com/reference/android/net/DnsResolver.html
Comment 15•5 years ago
|
||
Progandy: thank you for looking at it. To clarify this is because it has to send other query types than A and AAAA.
But this is already implemented for DoH. The code to create and parse DNS packets is already there. Instead of sending these packets using HTTP it would be sending it over TCP or UDP to the system resolver.
Comment hidden (me-too) |
Comment hidden (me-too) |
Comment hidden (me-too) |
Comment hidden (me-too) |
Comment 20•4 years ago
|
||
(In reply to yetanotheremail from comment #19)
I'm using 79.0 (64-bit). I use dns through my pi-hole which does secure dns. I don't want firefox to use its own, I just want it to do what the dhcp server in my router says: use the pi-hole dns.
But I do want ESNI. But firefox won't let me because of this :-(
"Me too" signaling will not help much.
As a stop-gap solution you can run your own DoH-server on the pi-hole with doh-proxy. You'll have to manually configure each Firefox installation and If you use a self-signed certificate then you have to tell Firefox to trust it. (Open the DoH-URL https://YOURIP:YOURPORT/dns-query
in the browser and accept the certificate before changing the DoH settings)
One option is to run dns-proxy on a second IP on the pi-hole. Otherwise choose an unused port or set up a reverse-proxy that delegates traffic between the pi-hole backend and DoH. For more support you should probably ask the pi-hole community.
Comment hidden (me-too) |
Comment 22•4 years ago
|
||
The most common workaround is using https://dnscrypt.info's local DoH feature, but this is really overkill for local setups.
If a local DNS server/proxy is already trusted, ECH is totally fine and safe to use.
Comment hidden (advocacy) |
Comment 24•4 years ago
|
||
Original decision was made because the plain DNS was not encrypted and host names are already leaked. Now OSs implement DoT and DoH and we will reconsider implemented this. I do not know about the time line yet.
Comment 25•4 years ago
|
||
In addition to system DNS using DoT or DoH directly, it's also possible that DNS could be going over a VPN with a split tunnel.
Comment 26•4 years ago
|
||
Hi,
I looked into fixing this. One question -- is the TXT/HTTPSSVC/SRV equivalent of GetAddrInfo already implemented? If so, I'm about to prepare a patch. Otherwise, this might need Linux/Mac/Windows specific code which I can't write.
Thanks.
Comment 27•3 years ago
|
||
On Android, DnsResolver.rawQuery() will get whatever RRs you need, but it returns the raw DNS Answer which must then be parsed. And this is only on Android newer than API 29.
Comment 28•3 years ago
|
||
Dennis - what's the deal with ESNI / ECH? Is ECH bound by the same restriction for DoH? If so would a patch for ESNI be applicable easily to ECH also?
Comment 29•3 years ago
|
||
IMHO encrypted DNS does not need to be a hard requirement for ECH per se. It could be a useful way to check for modern DNS capabilities, since ECH will need successful HTTPS/SVCB DNS queries to function.
Comment 30•3 years ago
|
||
(In reply to Tom Ritter [:tjr] (ni? for response to CVE/sec-approval/advisories/etc) from comment #28)
Is ECH bound by the same restriction for DoH?
Yes, there have been only minor changes at the DNS record level between ESNI and ECH. In brief, the user's DNS queries reveal exactly which websites they are visiting over ECH and so protecting them is vital. In general, I don't think we can/should trust network provided values unless the user has explicitly opted in (e.g. through a pref).
If so would a patch for ESNI be applicable easily to ECH also?
The changes needed to support non-DoH resolvers would all happen outside of NSS and are independent of my work on the ECH implementation. NSS just needs to provided with the configuration string fetched from the DNS records and then handles the rest.
Comment 31•3 years ago
|
||
the user's DNS queries reveal exactly which websites they are visiting over ECH and so protecting them is vital.
In the general sense of privacy I think DoH is vital. But I don't see how it is vital for this feature. My understanding is that ECH is no worse than the current state, even if the DNS request was being tracked. It seems to me like we may as well do ECH so that if the DNS query happens to be private (whether because of DoH or just because the resolver is trustworthy) then you have a fully private experience.
I fail to see the downside of just allowing this all the time, I agree that in most cases without DoH or similar it doesn't provide complete protection. But it is still an improvement in many cases.
Comment 32•3 years ago
|
||
@Kevin: I want to clarify this isn't a case of 'just allowing this'. Widening the support in Firefox for ECH over additional DNS transports will require reworking the low level code and a considerable amount of testing to make sure we don't break connectivity for users with older DNS resolvers. For experts who are early adopters and would like to use ECH with their own local resolvers, this is currently possible with a moderate amount of additional effort (enabling a local DoH endpoint and setting it in Firefox).
Comment 33•3 years ago
|
||
DoH/DoT could also happen on the host or local network. This cannot be detected by Firefox. DoH is not enabled by default for most users.
Requiring DoH for ECH would prevent a large user base from using it, e.g. split DNS environments, adblock DNS or DNSSEC aware setups.
Comment 34•3 years ago
|
||
I will also add that windows 11 supports DoH out of the box now (ipv6, ipv4, two different addresses for both) no problem. Also, some people may use unencrypted DNS over a different AS/ISP or do an ONION APNIC resolver (https://developers.cloudflare.com/1.1.1.1/other-ways-to-use-1.1.1.1/dns-over-tor) or local recursive resolver!!
That is this: https://dns4torpnlfs2ifuz2s2yf3fc7rdmsbhm6rw75euj35pac6ap25zgqad.onion/
Comment 35•3 years ago
|
||
I agree encrypting DNS is important, and requiring Firefox use its own DoH before enabling ECH seems like a good step towards a complete implementation. My fear is that this DNS change will become permanent. Avoiding the centralization of DNS is also important. I think that encrypting the SNI field (e.g. using ECH) while maintaining decentralized DNS is more important than encrypting the DNS. The SNI is plain text so its visible to all networks where the packet passes through. DNS is commonly hosted on the client's network and there is already local caching in place, so its less visible than the SNI field.
Comment 36•3 years ago
|
||
>My fear is that this DNS change will become permanent.
Not important! What is important is that it is slow and loads only 2 or 3 seconds after browser is loaded, b) it is not implemented as kernel module and is not part of the kernel, so it is higher latency
Comment 37•3 years ago
|
||
From my understanding Firefox would also want to query SVCB/HTTPS DNS records to optimize determining if HTTP/3 is supported, and probably to know if it should prefer https to http. Or will those features also be gated by having DoH enabled?
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 39•2 years ago
|
||
The original report was without DoH, not limited to a DoH resolver on the OS. DoH is not the only (secure) method to resolve domains. As outlined in https://bugzilla.mozilla.org/show_bug.cgi?id=1590746#c8, I'd not limit ECH to DoH. Can we please revert the summary change?
Comment 40•2 years ago
|
||
Yes, "support the OS resolver" would be a more accurate title.
ODoH, DoOH, DNSCrypt, Anonymized DNS, DoQ and future DNS-over-something methods are totally fine for ECH as well.
Comment 41•2 years ago
|
||
There's also no need for DNS-over-* for ECH - ECH can add substantial security value by allowing an outside-of-CA way to communicate the server's private key (ie the DANE security model), for which you need only a secure channel for DNS, not an encrypted one, DNSSEC via standard ol' UDP port 53 more than suffices. For privacy, too, you may trust the path to your resolver (eg if its on the host if Firefox is running in a VM, or if its on your local network) without trusting the full public-internet path from you to the server (eg not trusting your ISP, not trusting an ISP reseller, etc).
Comment 42•2 years ago
|
||
I agree the current bug topic is not at all what the intent was here, which is to support an encrypted hello without enforcing DoH, or DNS-over-anything, for that matter. They should not be conflated or forcefully coalesced. Please revert to the original intent.
Updated•2 years ago
|
Comment 43•1 year ago
|
||
I would also like this to happen.
Comment 44•1 year ago
|
||
Note that using ECH only for DoH discloses to the server whether the user uses DoH or not, which is a minor new privacy leak, a new fingerprinting vector for distinguishing visitors.
Every MITM able to observe some hops in the connection also gets that same information even if they can't observe the DNS resolution itself.
Comment 45•1 year ago
|
||
I would love to see this feature implemented in Firefox. I use DoH configured via a macOS configuration profile, and since I often use VPNs for both privacy and work purposes. I constantly have to constantly manually enable and disable secure DNS in Firefox, since I want to be able to leverage using ECH when I'm not using a VPN, and prevent DNS leaks when using a VPN. Even the privacy nightmare called Google Chrome currently supports ECH using the OS resolver, so it pains me a little to see this issue be given a P5, the lowest priority, essentially indicating this won't ever be implemented.
Reporter | ||
Comment 46•11 months ago
|
||
I have found this:
https://github.com/rustls/rustls/pull/1718/files#diff-b394a2611c7b41b4e372276bdfe57e14ad9c3f8b1f85f40b77d358dd098c0c08R83-R97
let resolver = Resolver::new(ResolverConfig::google_https(), ResolverOpts::default()).unwrap();
fn lookup_ech(resolver: &Resolver, domain: &str) -> Vec<u8> {
resolver
.lookup(domain, RecordType::HTTPS)
.expect("failed to lookup HTTPS record type")
.record_iter()
.find_map(|r| match r.data() {
Some(RData::HTTPS(svcb)) => svcb
.svc_params()
.iter()
.find_map(|sp| match sp {
(SvcParamKey::EchConfig, SvcParamValue::EchConfig(e)) => Some(e.clone().0),
_ => None,
}),
_ => None,
})
.expect("missing expected HTTPS SvcParam EchConfig record")
}
https://www.memorysafety.org/initiative/dns/
https://github.com/hickory-dns/hickory-dns/tree/main/crates/resolver
-
resolver from system config:
let resolver = Resolver::from_system_conf().unwrap();
- Windows
- Unix
- But Android is not fully supported yet: https://github.com/hickory-dns/hickory-dns/issues/652#issuecomment-1782431288
-
resolver from user-provided config:
https://docs.rs/hickory-resolver/latest/hickory_resolver/struct.Resolver.html#method.new
https://docs.rs/hickory-resolver/latest/hickory_resolver/config/struct.ResolverConfig.html#method.from_partsdomain
- domain of the entity querying results. If the Name being looked up is not an FQDN, then this is the first part appended to attempt a lookup. ndots in the ResolverOption does take precedence over this.
search
- additional search domains that are attempted if the Name is not found in domain, defaults to vec![]
name_servers
- set of name servers to use for lookups, defaults are Google: 8.8.8.8, 8.8.4.4 and 2001:4860:4860::8888, 2001:4860:4860::8844https://docs.rs/hickory-resolver/latest/hickory_resolver/config/struct.NameServerConfigGroup.html#method.from_ips_clear
https://docs.rs/hickory-resolver/latest/hickory_resolver/config/struct.NameServerConfigGroup.html#method.from_ips_tls
https://docs.rs/hickory-resolver/latest/hickory_resolver/config/struct.NameServerConfigGroup.html#method.from_ips_https
https://docs.rs/hickory-resolver/latest/hickory_resolver/config/struct.NameServerConfigGroup.html#method.from_ips_quic
https://docs.rs/hickory-resolver/latest/hickory_resolver/config/struct.NameServerConfigGroup.html#method.from_ips_h3
https://docs.rs/hickory-resolver/latest/hickory_resolver/config/struct.NameServerConfigGroup.html#method.mergelet ips: &[IpAddr] = &[ IpAddr::V4(Ipv4Addr::new(8, 8, 8, 8)), IpAddr::V4(Ipv4Addr::new(8, 8, 4, 4)), IpAddr::V6(Ipv6Addr::new(0x2001, 0x4860, 0x4860, 0, 0, 0, 0, 0x8888)), IpAddr::V6(Ipv6Addr::new(0x2001, 0x4860, 0x4860, 0, 0, 0, 0, 0x8844)), ]; let name_servers = NameServerConfigGroup::from_ips_clear(ips, 53, true); // name_servers.merge(name_servers_2); // name_servers.merge(name_servers_3); let config = ResolverConfig::from_parts(None, vec![], name_servers); let resolver = Resolver::new(config, ResolverOpts::default()).unwrap();
Updated•10 months ago
|
Comment 47•9 months ago
|
||
The implementation is already done and behind a pref. bug 1874464 will turn it on.
Updated•8 months ago
|
Description
•