Open ngehrsitz opened 5 months ago
Hi,
I am trying to intercept the traffic from a website that embeds code from
https://unpkg.com/
but that fails with the following error:2024/06/07 22:43:25 [007] WARN: Cannot handshake to unpkg.com:443 %!(EXTRA *errors.errorString=tls: server sent ECH retry configs without client sending ECH extension)
I am using Firefox
125.0.3
as the client. I already tried togglingnetwork.dns.echconfig.enabled
andnetwork.dns.use_https_rr_as_altsvc
but that didn´t change anything. There is a specific ECH test site, that fails to load with the same error: https://defo.ie/ech-check.php In the debugger I can see that the ECH extension is indeed missing The ECH support was implemented in refraction-networking/utls#240, but I couldn´t find an issue with that code. Could it be that theclientHello
is not interpreted correctly?
same error here, did you find a solution? throw me your discord if u have it
No, I didn´t find a solution. I think I will try to implement my MitM use-case with a browser plugin instead
Maybe you could just comment out a specific part of the code to be less strict when it comes to receiving an ECH retry config without having sent an extension.
https://guardianproject.info/2021/11/30/implementing-tls-encrypted-client-hello/
--> our client is not too strict. Rather, it's misbehaving — the target doesn't understand what we're sending so it resorts to an "ECH Retry"
Erratum. It looks like the target server has trouble decrypting the data?
It would be worthwhile to check if the problem arises with a different client.
E.g. can you access the same website with cURL?
On my side:
I didn't try Firefox.
It looks like Firefox's ClientHello is not the entire problem. Firefox might be triggering additionnal problems making it impossible to access unpkg. It's already possible to reproduce problems with cURL, but only with https://defo.ie/ech-check.php
Not sure what to conclude.
--> The first step in resolving the issue is to get cURL+utlsproxy+https://defo.ie/ech-check.php working.
I did the following:
defo-ie-curl-utlsproxy.pcapng.zip
defo-ie-curl-standalone.pcapng.zip
(left is utlsproxy+cURL, right is cURL standalone)
We can check the flow of TLS packet content types:
We can notice that there is a difference there already.
Since we can already see a difference at packet 2, I bet that there is something different in packet 1 beside the content type. (there is also the hypothesis that I'm just missing some TLS keys to decrypt some parts of the flow)
Erratum: there's no difference
So, the issue is not in the first Handshake packet (Client Hello).
We can skip packets sent by the server (2 and 3), assuming that they are the same and we just cannot decrypt some part of them without configuring cURL to output an NSS Key Log.
We can see that utlsproxy finalizes the handshake maybe a bit early on the left? (reminder: utlsproxy+cURL on the left, curl alone on the right)
Not sure what's going on.
I think that to resolve the issue, the best would be to perform the following steps:
I'm going to do something else with my day, but what I would advise to do to resolve the issue:
Hello everyone! Should be fixed on latest main branch now. Let me know
I just did a quick test with https://unpkg.com/
on 44a0906ecb39a27ba3183719cdfc423f2bfe9450 and that works fine.
But https://defo.ie/ech-check.php still refuses to work
I can also see the same error with regular domains like https://api.mapbox.com/
so the issue is not just limited to the test site.
Hi,
I am trying to intercept the traffic from a website that embeds code from
https://unpkg.com/
but that fails with the following error:I am using Firefox
125.0.3
as the client. I already tried togglingnetwork.dns.echconfig.enabled
andnetwork.dns.use_https_rr_as_altsvc
but that didn´t change anything. There is a specific ECH test site, that fails to load with the same error: https://defo.ie/ech-check.php In the debugger I can see that the ECH extension is indeed missing The ECH support was implemented in https://github.com/refraction-networking/utls/issues/240, but I couldn´t find an issue with that code. Could it be that theclientHello
is not interpreted correctly?