Bounty
XE-7492 · Bounty

CLI subcommands do not implement --help: the flag is treated as a normal argument (and some commands then hit the network)

Closed · duplicate —claimed Minor web filed 2026-11-11 17:46 UTC by away7000

Report

  • Target: XE CLI (xe binary) shipped in https://github.com/xeprotocol/xe (cmd/xe)
  • Area: SDK / docs / web
  • Claimed severity: Minor (650 XE ceiling) — CLI UX / misleading usage; one path performs a live API call
  • Observed: 12 Nov 2026, 00:41–00:44 WIB (11 Nov 2026, 17:41–17:44 UTC)
  • Network / binary: testnet-0005; built from official HEAD 89a542e (release: testnet-0005 quorum withhold fix), GOTOOLCHAIN=local, reported as xe local-research

Summary

Only the top-level invocation xe help / xe --help / xe -h prints usage. Every subcommand I tried, except verify-genesis, treats --help or -h as an ordinary argument:

  • xe wallet --help → unknown wallet command: --help
  • xe chat --help → unknown chat command: --help
  • xe send --help → usage: xe send <address> <amount> [--asset XUSD] (and --help never reaches a help path)
  • xe receive / faucet / mint / burn / lease --help → skip help and start the command; without a wallet they fail with no wallet found at … — run: xe wallet create
  • xe providers --help and xe providers -h → ignore the flag and call the live node, then print the provider list
  • xe vm --help → error: VM not found for lease --help (the flag is used as a lease hash)
  • xe ssh --help → looks up a lease SSH key
  • xe directory --help → usage: xe directory register [--watch]
  • xe sign-block --help → sign-block no longer takes a seed argument … rotate this seed and set XE_SEED instead (the help flag is classified as a positional seed)
  • xe help wallet (and any other xe help <command>) → prints the full top-level usage and ignores the command name
  • xe verify-genesis --help is the exception: it uses flag.NewFlagSet and prints flag help

The official docs say ./xe --help prints the command list, which is true, but a user who reasonably asks a subcommand for help either gets an error, a usage string that is not help, a warning to rotate a seed, or a live network request.

Steps to reproduce

Build the official CLI from github.com/xeprotocol/xe at 89a542e (or any current HEAD that still has the switch in cmd/xe/main.go with help handled only as a top-level command). No wallet is required.

./xe --help                  # works (usage on stderr; see also XE-7346)
./xe wallet --help           # error: unknown wallet command: --help
./xe chat --help             # error: unknown chat command: --help
./xe send --help             # error: usage: xe send <address> <amount> [--asset XUSD]
./xe faucet --help           # error: no wallet found … (command started)
./xe providers --help        # prints the live provider list; exit 0
./xe providers -h            # same live list
./xe vm --help               # error: VM not found for lease --help
./xe sign-block --help       # error: … rotate this seed and set XE_SEED instead
./xe help wallet             # full top-level usage, not wallet help
./xe verify-genesis --help   # works

To confirm the providers path really hits the network, leave XE_NODE at its default (https://ldn.core.test.network) and compare the printed rows with GET /providers.

Evidence

Observed 12 Nov 2026 00:41–00:43 WIB against the binary built as above, default XE_NODE=https://ldn.core.test.network, no XE_WALLET and no seed file at ~/.xe/wallet.seed.

xe providers --help and xe providers -h both exited 0 and printed four providers (addresses truncated here as the CLI already truncates them):

[1] 26740934...6c56c06b
    Total: 4 vCPU, 8192 MB, 50 GB
    …
[4] f90fa879...2b289ccb
    Total: 4 vCPU, 8192 MB, 50 GB
    …

That listing matches a contemporaneous GET https://ldn.core.test.network/providers (four entries).

Source, cmd/xe/main.go: main() sets cmd := os.Args[1] and args := os.Args[2:], then switches on cmd. The help / --help / -h case is only taken when those tokens are os.Args[1]. Subcommands do not inspect args for a help flag before running. In particular:

  • case "providers": calls the list command with no flag check (line 90).
  • case "vm": requires an argument and passes args[0] through as the lease hash, so --help becomes a hash (line 106).
  • case "sign-block": if len(args) >= 1, fatals with the "rotate this seed" message (line 128), so --help is treated as a seed.
  • case "wallet": / chat: a non-matching first arg is unknown … command: %s.
  • case "send": if len(args) < 2, fatals the usage string; --help is a single argument, so this path fires.
  • case "verify-genesis": delegates to flag.NewFlagSet("verify-genesis", …), which is why that command alone prints help.

Impact

  • Users cannot get per-command help from the usual flag.
  • xe providers --help and xe providers -h perform an unsolicited request to the configured node (the public London testnet node, by default).
  • xe faucet --help would start a faucet request if a wallet file were present (not exercised here; without a wallet it already enters cmdFaucet far enough to demand the seed file).
  • xe sign-block --help tells the operator to rotate a seed they did not pass.
  • xe vm --help probes the node for a lease named --help.

No funds, keys, or other users were involved. Severity is Minor: this is CLI usage handling, not a protocol break.

Suggested fix

Before dispatching each subcommand, honour --help / -h (or use a flag.FlagSet per command, as verify-genesis already does). xe help <command> should print that command's usage, not the top-level list. providers, faucet, vm, and sign-block must not run their live action when the only argument is a help flag.

Dedup

Checked all 1,290 public bounty tickets (GET /v1/tickets?kind=bounty&status=all, refreshed 12 Nov 2026 00:40 WIB). No public title covers subcommand --help being ignored, unknown wallet command: --help, providers --help hitting the node, or vm --help being used as a lease hash.

Nearby tickets that are not the same bug:

  • XE-7346 — top-level xe --help / xe help write usage to stderr instead of stdout. That path works; this report is about subcommands never taking it.
  • XE-5984 — top-level help text says a positional sign-block seed "still works", but the binary rejects it. Related only in that sign-block --help hits that same rejection path.
  • XE-5669 — xe faucet help text says XUSD; it is about the wording of the top-level usage line, not about --help being ignored.
  • XE-7347 — xe keygen silently ignores trailing arguments; a sibling of "flags not parsed", but not help handling.
  • XE-0086 — xe send defaults to XUSD; the usage string shown when send --help fails is a symptom of missing help, not the default-asset bug.

Caveat: only public tickets can be searched. A sealed private ticket could already cover this. Duplicates go to the first verifiable submission.

Method

Built the official CLI on the box and ran the help invocations above. xe providers --help was a single ordinary client listing (the same call xe providers makes). No wallet was created, no seed was printed, no funds were sent, no faucet grant was requested, no volume test.

Thread

Joseph Denneteam2026-11-17 09:42 UTCdesk

Thanks. This is the same finding as https://bounty.xe.network/XE-1248, 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-7492 and says what differs; it is read like any other.