AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 46 Bitcoin

multi: replace btcsuite/go-socks with an x/net/proxy wrapper

Public commit record

What the developer wrote

Authored by Boris Nagaev

78/100 · Adequate
multi: replace btcsuite/go-socks with an x/net/proxy wrapper

btcsuite/go-socks, a fork of samuel/go-socks is outdated. Replace it
with a maintained package golang.org/x/net/proxy. Add internal/socks,
which keeps the API btcd used on top of x/net/proxy, and the behavior it
relied on:

- The connection reports the requested destination as its remote
address. outboundPeerConnected whitelists peers by it, so with a
plain x/net/proxy connection, which reports the proxy's address, a
whitelisted local Tor proxy would have whitelisted every peer reached
through it.
- Its local address is the address the proxy bound, now parsed
correctly.
- Tor stream isolation uses new random credentials for every
connection.
- Hostnames, including onion addresses, are passed to the proxy
unresolved.
- The timeout covers the SOCKS handshake too.

rpcclient now dials its websocket through the proxy with the dialer's
context, so the handshake timeout also covers the proxy.

Verified end to end with two simnet nodes connected through a
forwarding SOCKS5 proxy: the handshake completes, getpeerinfo reports
the peer and the proxy's bound address, the peer connection uses random
isolation credentials, and btcctl and an rpcclient websocket client
reach the RPC server through the proxy.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This commit swaps out an old, unmaintained SOCKS proxy library for a new internal wrapper around a modern Go package. The change is mostly a refactor, but it deliberately fixes several subtle SOCKS/Tor-related behaviors that could affect security: peer whitelisting, stream isolation, hostname handling, and handshake timeouts. The commit message and tests describe these as behavior-preserving fixes rather than as a response to a reported vulnerability.

Recommended action

Treat as a hardening/maintenance change with latent security implications. Review the new internal/socks implementation for correct context propagation and error handling, verify that all SOCKS/Tor configurations still work, and consider whether the old behavior could have allowed unintended whitelist bypasses in deployments using Tor. No emergency patch is indicated absent a specific advisory.

Security signals we found

01

Replacement of outdated/unmaintained SOCKS dependency

02

Fix for peer whitelisting bypass via proxy RemoteAddr semantics

03

Per-connection random Tor stream-isolation credentials

04

Correct handling of long proxy-bound hostnames that previously panicked

05

SOCKS handshake now covered by dial timeout/context

06

Hostname/onion addresses passed unresolved to proxy

Risk score

Why this scored 46/100

Our methodology →
Potential impact 12/30
Exploitability 8/25
Stealth signal 6/15
Affected reach 9/15
Confidence 7/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.