Fix Tor DNS leak - #1460
Merged
Merged
Fix Tor DNS leak#1460
Conversation
socks5_proxy 1.0.3+dev.3 resolves the target host with the system DNS before issuing the SOCKS5 CONNECT, so every request made through the Tor proxy leaked its hostname to the local resolver and handed Tor an IP address instead of a domain. It also meant .onion hosts could not be reached through HttpClient at all. Upstream removed the local lookup in 1.0.5+dev.1 and fixed domain serialization in 2.1.1, so the CONNECT now carries the hostname (address type 3) and Tor does the resolution. The 2.x API is unchanged for everything Stack uses (assignToHttpClient and ProxySettings).
Run the HTTP wrapper against a local fake SOCKS5 server and assert the CONNECT carries the domain name, including for .onion hosts, rather than a locally resolved address.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## staging #1460 +/- ##
===========================================
+ Coverage 6.72% 6.79% +0.06%
===========================================
Files 1118 1122 +4
Lines 111939 112368 +429
===========================================
+ Hits 7533 7634 +101
- Misses 104406 104734 +328 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.