fix(mobile): propagate SOCKS5 user/pass auth through FakeDNS upstream dial - #19
Merged
Conversation
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.
What
When FakeDNS is enabled (the default) and the user configures SOCKS5 user/pass
auth on their profile, every TCP connection through the VPN silently fails.
The FakeDNS proxy in
fakedns_proxy.goalways offered onlyNO_AUTHwhendialing the inner SOCKS5 server. The inner server's
UserPassAuthenticatorrejected the connection, but no error was surfaced — TCP connections just hung.
Why
The FakeDNS dial path had no visibility into the SOCKS5 credentials configured
on
StartClient's inner server. The credentials lived inProfileEntitybutwere never threaded through
StartTunBridge→StartFakeDNSProxy→FakeDNSProxy.Changes
fakedns_proxy.go: AddSocksUser/SocksPassfields toFakeDNSProxy;add
dialRealSocks()helper implementing RFC 1928 greeting + RFC 1929user/pass sub-negotiation;
handleConnectionandhandleUDPAssociatenowcall it instead of the inline bare
05 01 00dial.tun_api.go:StartFakeDNSProxysignature gainssocksUser, socksPassparams; log line now includes
auth=%v.mobile.go:StartTunBridgesignature gainssocksUser, socksPassparams; passes them to
StartFakeDNSProxy. Plan 004'stunOwnedFdblockpreserved unchanged.
GooseRelayVpnService.kt: ReflectivegetMethodupdated to 5 paramtypes;
invokenow passesprofile.socksUserandprofile.socksPass.Verification
go vet ./mobile/...— passes on Linux (CI); fails on Windows only due topre-existing
syscall.DupindupFd(Linux-only syscall).gofmt -don committed blob — clean.Select-Stringdone-criteria — all pass (4 files, correct signatures,dialRealSockscalled from both handlers).+111/-32), no out-of-scope changes.socks_user/socks_passset,keep FakeDNS enabled (default), connect, load a webpage through the VPN.
Before: silent failure. After: works.
Notes
for
dialRealSocksagainst an in-process SOCKS5 server (usingthings-go/go-socks5) is flagged as a follow-up.the VPN session duration — unchanged from the existing threat model
(
ProfileEntity, Go core config). Not elevated by this PR.