<!-- XE-1248 · xe lease silently ignores unknown flags: a typo in - -duration or - -provider runs with defaults instead of failing · testnet -->
*Markdown view of <https://bounty.xe.network/XE-1248>. The page is the record; this is the same page for reading.*

XE-1248 · Bounty

# xe lease silently ignores unknown flags: a typo in --duration or --provider runs with defaults instead of failing

Triaging
[xe#300](https://github.com/xeprotocol/xe/issues/300)
filed 2026-11-08 01:41 UTC
by rusdiwireng

Verdict
:   published when the fix ships

Tier
:   published when the fix ships

Claimed
:   —

Area
:   SDK / docs / web

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-10 00:11 UTC

Told
:   2026-11-08 20:19 UTC

### Patches

- [xe#303](https://github.com/xeprotocol/xe/pull/303) open by tipprb
  fix(cmd/xe): reject unknown flags in parseLeaseArgs
- [xe#306](https://github.com/xeprotocol/xe/pull/306) open by arturbarszcz78
  fix(cmd/xe): reject unknown flags and typos in parseLeaseArgs (fixes #300)

### History

- [61310](https://bounty.xe.network/log/61310) 2026-11-10 00:12 UTC patch.linked
- [43833](https://bounty.xe.network/log/43833) 2026-11-08 20:19 UTC github.labels
- [43811](https://bounty.xe.network/log/43811) 2026-11-08 20:19 UTC reply.mirrored
- [43493](https://bounty.xe.network/log/43493) 2026-11-08 20:18 UTC proposal.adopted
- [43492](https://bounty.xe.network/log/43492) 2026-11-08 20:18 UTC reply.sent
- [41290](https://bounty.xe.network/log/41290) 2026-11-08 20:18 UTC proposal.adopted
- [41289](https://bounty.xe.network/log/41289) 2026-11-08 20:18 UTC ticket.facts area
- [41288](https://bounty.xe.network/log/41288) 2026-11-08 20:18 UTC proposal.adopted
- [41287](https://bounty.xe.network/log/41287) 2026-11-08 20:18 UTC ticket.facts
- [41286](https://bounty.xe.network/log/41286) 2026-11-08 20:18 UTC proposal.adopted
- [41285](https://bounty.xe.network/log/41285) 2026-11-08 20:18 UTC ticket.facts
- [41284](https://bounty.xe.network/log/41284) 2026-11-08 20:18 UTC proposal.adopted

[Full history](https://bounty.xe.network/log?ref=XE-1248) · [JSON](https://bounty.xe.network/v1/tickets/XE-1248) · [markdown](https://bounty.xe.network/XE-1248.md)

### Report

Suggested severity tier: Info

Area: CLI argument parsing, cmd/xe/main.go (parseLeaseArgs)

Repository state checked: xeprotocol/xe HEAD 978785929bc17a2f4ab30c383e5fc9cf4d634512

## Summary

`xe lease` accepts any flag-like argument without complaint, even one it does not recognize. parseLeaseArgs walks the arguments with a switch that has no default case, so an unknown token is skipped and the command runs with default values. A typo such as `--duraton 3600` silently produces a 300 second lease, and a typo such as `--providr <address>` silently lets the CLI pick any provider. Every sibling parser in the same CLI rejects unknown flags with an error. Only the lease parser stays silent.

## What was proven

parseLeaseArgs in cmd/xe/main.go, around lines 975-1008, defaults to 1 vCPU, 1024 MB, 1 GB disk, and 300 seconds, then loops over the arguments:

for i :\= 0; i \< len(args); i\+\+ {
switch args\[i\] {
case "--vcpus":
...
case "--provider":
...
}
}

There is no default case, so any token that matches none of the five known flags falls through with no error and no warning. The value that followed the typo is also skipped as an ordinary token, or consumed as a value by a later known flag.

Proven with a local test against the real parser:

1. parseLeaseArgs(\["--duraton", "3600"\]) returns no error and duration 300\. The user asked for 3600 seconds and got the 300 second default.
2. parseLeaseArgs(\["--bogus", "--provider", "abcd"\]) returns no error and provider "abcd". The unknown token vanished without a trace.

For comparison, the sibling parsers all fail loudly. parseChatReadArgs returns `unknown flag %q`, parsePhraseOptions returns an error for anything outside --passphrase and --account, and cmdDirectory fatals on anything but --watch. (The send and burn parsers get the same treatment in PR #286, which adds parseSendArgs and parseBurnArgs returning `unknown flag %q`.) The lease parser is the only one that swallows unknown input.

## Reproduction

1. Clone https://github.com/xeprotocol/xe and confirm HEAD is 978785929bc17a2f4ab30c383e5fc9cf4d634512.
2. Build the CLI from source.
3. Run `xe lease --duraton 3600` and observe the command proceeds with a 300 second lease instead of reporting the unknown flag.
4. Run `xe lease --providr <address>` and observe the command proceeds with automatic provider selection instead of reporting the unknown flag.

## Impact

No funds move to another party and no remote party can trigger this. The trigger is the user's own typo on their own command line. The harm is a lease that does not match what the user asked for: a shorter duration than planned, or a provider the user did not choose, with no signal that anything went wrong. The lease still settles normally and the user can notice the duration or provider afterwards, so the failure is recoverable and visible after the fact, just silent at the moment it matters.

## Suggested fix

Add a default case to the switch in parseLeaseArgs that returns an error naming the unknown flag, the same way parseChatReadArgs already does (parseSendArgs and parseBurnArgs do the same in PR #286). The usage line should list the five accepted flags so a typo is easy to spot.

## Related issues

This sits next to #267, which covered the send and burn parsers reading a consumed value again as a flag. The mechanism here is different: the lease parser already consumes values correctly, and the defect is the missing rejection of unknown flags. The fix for #267 (PR #286) hardened send and burn only and did not touch this parser.

## Honest limits of this proof

The proof ran against the parser function in a local test harness, not against a live node, because the defect is in argument parsing before any network call happens. The typo examples use a local build only. No testnet or mainnet traffic was involved. The impact depends on the user mistyping a flag, so this is a silent misconfiguration, not a remotely exploitable vulnerability. If the maintainers intended the lease parser to accept and ignore extra arguments, the honest resolution is to document that behavior and this issue drops to docs.

### Thread

**Joseph Denne**team2026-11-08 20:19 UTCgithub

Thanks for the report. We have confirmed the behaviour you describe in the lease command's argument handling and it is being handled. We will update you here at https://bounty.xe.network/XE-1248 when the fix lands.

**kinoy-1**2026-11-20 12:40 UTCgithub

Additional evidence on the same defect class, checked against HEAD `8cc209d`: the send parser was **not** hardened the way this issue's body assumes. There is no `parseSendArgs`/`parseBurnArgs` in `cmd/xe/main.go` at this HEAD (and no trace of PR #286 in the history), and both `cmdSend` and `cmdBurn` still silently ignore unknown flags.

Proven with a local build (throwaway wallet, no transaction — all runs stop at the balance check):

- `xe send <addr> 1 --asste XE` → `error: insufficient XCU: have 0, need 1` — the typo is swallowed and the asset silently falls back to the XCU default. With a funded wallet this would send XCU when the user asked for XE.
- Control: `xe send <addr> 1 --asset XE` → `error: insufficient XE: have 0, need 1`.
- `xe send <addr> 1 --bogus` → also silently accepted, same XCU fallback.
- `xe burn 1 --memoo hello` / `--bogus` → also silently accepted (burn's asset is hardcoded XE, so the impact there is limited to a dropped `--memo` or a missed `--yes` — the latter fails safe into the confirmation prompt).

So the fix for this issue should cover `cmdSend` (and `cmdBurn` for completeness), not just `parseLeaseArgs` — the send case is arguably worse than the lease case, since funds move to another party in the wrong asset. Suggested severity for this added evidence: Info/Low, same family as #300.
