[Medium] Go client SDK has no HTTP timeout on any method — a stalling node hangs the caller forever
Report
Summary
Every Go client SDK method uses bare http.Get (→ http.DefaultClient, Timeout: 0) or http.DefaultClient.Do directly. There is no http.Client{Timeout: ...} anywhere in client/ or cmd/ — the only timeouts in the codebase are server-side. A malicious/compromised node, or a node behind a broken proxy, hangs any CLI command and any automation using the SDK indefinitely.
Root cause
client/client.go (GetChain, GetBalances, GetPending, SubmitBlock, GetProviders, GetLease, GetReputation, GetCertificate, GetLeases, GetVM, getJSON) and client/chat.go:88 (do()), plus cmdLeaseRenew (cmd/xe/main.go:1134). The CLI uses the SDK directly via apiClient() (cmd/xe/main.go:241-243, no wrapper).
Verification
Executed PoC: fake server that accepts and never responds → GetBalances still blocked after 5s (never returns).
Impact
A healthy node won't stall (the server has Read/Write timeouts), but a light client must not trust the server to be responsive — that is the point of a client timeout. Affected CLI commands include balance, receive, send, vm, lease renew.
Note on related reports
Searched http client timeout hangs: #659 (ours — downloadImage, different), #397 (chat send trusts server-advertised PoW difficulty — different mechanism, CPU pin via PoW, not HTTP), #359 (PoW infinite loop — different). No report on Go HTTP client timeouts.
Suggested fix
Give the SDK a shared http.Client with a sensible timeout (e.g. 30s) and use it for all requests.
Thread
Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the first verifiable submission, so this one closes as a duplicate. If you believe it is a different bug, file a new report that links https://bounty.xe.network/XE-16847 and says what differs; it is read like any other.