<!-- XE-0683 · CLI flag parser does not consume option values: - -memo can hijack - -asset, and - -memo - -yes bypasses the burn confirmation · testnet -->
*Markdown view of <https://bounty.xe.network/XE-0683>. The page is the record; this is the same page for reading.*

XE-0683 · Bounty

# CLI flag parser does not consume option values: --memo can hijack --asset, and --memo --yes bypasses the burn confirmation

Triaging
claimed Minor
[xe#267](https://github.com/xeprotocol/xe/issues/267)
filed 2026-11-05 11:38 UTC
by rusdiwireng

Verdict
:   published when the fix ships

Tier
:   published when the fix ships

Claimed
:   Minor

Area
:   SDK / docs / web

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-10 00:11 UTC

Told
:   2026-11-08 20:19 UTC

### Patches

- [xe#286](https://github.com/xeprotocol/xe/pull/286) open by Khanhtnq
  fix(cli,client,chat,node,api): harden CLI flag parsing, provider errors, chat PoW bounds, marketplace rate-limit, and API pagination
- [xe#314](https://github.com/xeprotocol/xe/pull/314) open by arturbarszcz78
  fix(cmd/xe): advance argument cursor after consumed option values (fixes #267)

### History

- [61314](https://bounty.xe.network/log/61314) 2026-11-10 00:12 UTC patch.linked
- [43837](https://bounty.xe.network/log/43837) 2026-11-08 20:19 UTC github.labels
- [43815](https://bounty.xe.network/log/43815) 2026-11-08 20:19 UTC reply.mirrored
- [43645](https://bounty.xe.network/log/43645) 2026-11-08 20:18 UTC proposal.adopted
- [43644](https://bounty.xe.network/log/43644) 2026-11-08 20:18 UTC reply.sent
- [42320](https://bounty.xe.network/log/42320) 2026-11-08 20:18 UTC proposal.adopted
- [42319](https://bounty.xe.network/log/42319) 2026-11-08 20:18 UTC ticket.facts area
- [42318](https://bounty.xe.network/log/42318) 2026-11-08 20:18 UTC proposal.adopted
- [42317](https://bounty.xe.network/log/42317) 2026-11-08 20:18 UTC ticket.facts
- [42316](https://bounty.xe.network/log/42316) 2026-11-08 20:18 UTC proposal.adopted
- [42315](https://bounty.xe.network/log/42315) 2026-11-08 20:18 UTC ticket.facts
- [42314](https://bounty.xe.network/log/42314) 2026-11-08 20:18 UTC proposal.adopted

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

### Report

Suggested severity tier: Low

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

Repository state checked: xeprotocol/xe HEAD 978785929bc17a2f4ab30c383e5fc9cf4d634512

## Summary

The send and burn commands scan their arguments with a loop that never skips a consumed option value. Every argument is examined in turn, including values already taken by a preceding flag. A value that looks like a flag is therefore interpreted as a flag. Two consequences follow: a memo value of "--asset" changes the asset of a send, and a memo value of "--yes" sets the skip-confirmation flag of a burn. The burn confirmation is the only guard on an irreversible action in this CLI, and it can be bypassed through a memo value.

## What was proven

The loop in cmdSend (cmd/xe/main.go, around lines 674-684) walks all arguments:

for i, a :\= range args {
if a \=\= "--asset" \&\& i\+1 \< len(args) {
asset \= args\[i\+1\]
}
if a \=\= "--memo" \&\& i\+1 \< len(args) {
memo \= args\[i\+1\]
}
}

After "--memo" takes its value, the loop continues to that value on the next iteration and treats it as a flag. cmdBurn (cmd/xe/main.go, line 866 onward) has the same pattern over rest :\= args\[1:\].

Proven against a local build of the CLI plus a local stub node (stub balances: XUSD 0, XE 1,000,000,000 micro):

1. `xe send <64-hex address> 1 --memo --asset XE` prints "Sent 1 XE". The user meant memo "--asset" with the default asset XUSD. What happened: the memo took "--asset" as its value, and then "--asset" was read again as a flag, so the asset became XE and the send went through because the XE balance was sufficient. Had the asset stayed XUSD, the command would have failed with insufficient funds.
2. `xe burn 1 --memo --yes` with stdin from /dev/null prints "Burned 1 XE" with no prompt. The control, `xe burn 1` with no flags and the same stdin, prints the confirmation prompt and then fails with "error: aborted". The memo value "--yes" set skipConfirm to true while also being stored as the memo.

## Reproduction

1. Clone https://github.com/xeprotocol/xe and confirm HEAD is 978785929bc17a2f4ab30c383e5fc9cf4d634512.
2. Build the CLI from source and point it at a stub or local node.
3. Run `xe send <destination> 1 --memo --asset XE` and observe "Sent 1 XE" with the asset changed to XE.
4. Run `xe burn 1 --memo --yes` with stdin closed and observe "Burned 1 XE" with no confirmation prompt. Run `xe burn 1` with the same stdin and observe the prompt followed by "error: aborted".

## Impact

A send can go out in the wrong asset when a memo value happens to be flag-like, and a burn can execute with no confirmation when a memo value is "--yes". The realistic trigger is a memo taken from a script variable or pasted input that contains a flag-like string, rather than a user typing it by hand. No remote party can trigger this without control of the user's command line or script input. No funds move to an attacker's account through this path; the send still goes to the intended destination, and the burn still burns the user's own tokens.

## Suggested fix

Parse flags with a proper argument parser, or advance the loop index past a consumed option value so a value is never re-examined as a flag. The same fix applies to cmdSend and cmdBurn, and the same review should cover the other commands that scan arguments by hand.

## Honest limits of this proof

The proof ran against a local build and a local stub node. It does not involve the public testnet. The trigger requires the user's own input to contain a flag-like memo value, so this is a parser defect with a narrow trigger, not a remotely exploitable vulnerability. If the maintainers intended the parser to be this simple, the honest resolution is to document the behavior and the issue drops to Info or docs.

### Thread

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

Thanks for the report. We have read it against the code and it is being handled; we will update https://bounty.xe.network/XE-0683 when there is news.
