Closed Bug 1638053 Opened 5 years ago Closed 5 years ago

ESNI + webproxy not working: nsSocketTransport::ResolveHost()

Categories

(Core :: DOM: Networking, defect)

76 Branch
defect

Tracking

()

RESOLVED WONTFIX

People

(Reporter: amritanshu, Unassigned)

Details

Attachments

(1 file)

605.87 KB, application/octet-stream
Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36

Steps to reproduce:

I am trying to make ESNI work with a web-proxy, what I am observing is that although the tunnel is TLSv1.3 the SNI is still going in plain text. This is not a MITM-SSL proxy

Point FF to the proxy
access and test browser for ESNI https://www.cloudflare.com/ssl/encrypted-sni/

Actual results:

The connection was TLSv1.3 the SNI went in plaintext

Expected results:

In nsSocketTransport::ResolveHost() (where we also compute the ESNI keys), the problem is on Line number 1080 where esniHost.Append(SocketHost()); it ends up picking the ProxyAddress instead of the host see[0], ultimately leading to a lookup for _esni.127.0.0.1 or whatever is there in the proxy instead of _esni.some.encryptedsnihost.com in the DNS cache.

Looking up ESNI for the proxy is bad for multiple reasons, best case the ESNI keys are not found and the TLS tunnel is "degraded", but in the worst case, the proxy itself has an ESNI key present, where the TLS HELLO packet gets encrypted with the wrong key. Ideally the connection should have been encrypted.

Attached file log.txt-main.2204.rar

Adding the logs for the failure scenario

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Networking: DNS
Product: Firefox → Core

I have rephrased the bug here the original summary is like putting the Horse before the Cart, apologies for that.

Steps to reproduce:

  1. ensure the DNS is pointing to CloudFlare DNS
  2. enable esni bits on FF under ESNI and network.security are set to true in about: config
  3. visit https://www.cloudflare.com/ssl/encrypted-sni/ and run Esni test
  4. Esni Test Passes.
  5. enable proxy settings in FF, in my case HTTP/https was manually set to talk to 127.0.0.1:3128
  6. revisit https://www.cloudflare.com/ssl/encrypted-sni/ and run Esni test
    Actual result:
  7. the test fails, the Cloudfare response says the SNI was sent in plaintext.
    Expected result:
    The test should pass.

Existing debugging/RCA:
In nsSocketTransport::ResolveHost() (where we also compute the ESNI keys), the problem is on Line number 1080 where esniHost.Append(SocketHost()); it ends up picking the ProxyAddress instead of the host see[0], ultimately leading to a lookup for _esni.127.0.0.1 or whatever is there in the proxy instead of _esni.some.encryptedsnihost.com in the DNS cache.

Looking up ESNI for the proxy is bad for multiple reasons, best case the ESNI keys are not found and the TLS tunnel is "degraded", but in the worst case, the proxy itself has an ESNI key present, where the TLS HELLO packet gets encrypted with the wrong key. Ideally, the connection should have been encrypted.

Component: Networking: DNS → Untriaged
Product: Core → Firefox

Hi,
I don't have the technical knowledge to confirm this issue but I'll add product and component so the team can make some research on it. Hopefully, someone with a more deep understanding of this matter can help. Feel free to route this ticket to the corresponding team.

Component: Untriaged → DOM: Networking
Flags: needinfo?(nhnguyen)
Product: Firefox → Core

The old ESNI spec has some problems with proxies. There is a new one and a new DNS query for it, HTTPSSVC. We will be working on an implementation in the near future. I will closed this bug as WONTFIXED

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → WONTFIX

[:dragana] so the issue is meant to go away in a future release?

(In reply to amritanshu from comment #6)

[:dragana] so the issue is meant to go away in a future release?

yes

Flags: needinfo?(nhnguyen)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: