Bounty
XE-12954 · Bounty

Go client: read helpers swallow HTTP status and decode errors; zero values feed signing and user verdicts

Closed · duplicate —claimed Medium web filed 2026-11-14 14:45 UTC by Jeri055

Report

Summary. In the Go client, every read helper except the already-reported GetChain ignores the HTTP status and discards JSON decode errors, returning zero values as success. Node error pages therefore turn into false CLI verdicts and into blocks signed against zeroed state.

Documented rule. A failed read must surface as an error; the SDK client states this rule in its own header and implements it.

Code path. xe/client/client.go: GetBalances (61), GetPending (77), GetProviders (104), GetLeases (142), GetVM (153, returns (nil, nil) on transport error, non-200 and decode error) and getJSON (167) all decode without checking resp.StatusCode and assign the decode error to _. Callers trust the nil error: cmdReceive (main.go:740) prints "No pending sends to receive." for a failed read; cmdLeaseStatus (main.go:1111) prints {} and exits 0 for an errored lease lookup because getJSON returns an empty non-nil map; cmdMint builds its signed balance from the zeroed map; initNetworkID (main.go:245) keeps the default network id when /node cannot be read. Affected code is at xe HEAD 89a542e.

Reproduction. Point XE_NODE at any endpoint that returns HTTP 500 with an HTML or empty body for these routes. xe receive reports no pending sends; xe lease status <unknown> prints {} and exits 0; xe mint signs a block asserting balance = minted amount.

Impact. Missed receives, phantom lease status, blocks signed against wrong balances, and silent wrong-network signing, all induced by one bad node response.

Thread

Joseph Denneteam2026-11-20 19:45 UTCdesk

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-12954 and says what differs; it is read like any other.