[Low] Chat messages with ANSI escape sequences are accepted and printed raw to the operator's terminal
Report
Summary
Chat envelope validation (chat/envelope.go:95-125, VerifyFull) checks message length (<=8192 bytes) but has no control-character or UTF-8 check on Message. The CLI (cmd/xe/chat.go:226-232, printEnvelope) prints the message raw with fmt.Fprintf. An attacker can send a chat message containing ANSI escapes (clear-screen, fake prompt, hidden text); a victim running xe chat read sees spoofed terminal output -- e.g. a fake "Enter seed phrase to continue:" prompt. Output-integrity issue, not code execution. The web UI is safe (uses textContent).
Root Cause
Unlike ValidateMemo (core/memo.go, which rejects control bytes <0x20), chat messages have no content validation, and the CLI prints them unescaped.
Impact
Terminal output spoofing: fake prompts, hidden text, screen clearing. A fake seed-phrase prompt is a realistic social-engineering vector against node operators.
Verification (executed PoC)
VerifyFull ACCEPTED a message containing raw ESC (0x1b) bytes (\x1b[2J\x1b[1;31m[FAKE] Enter seed phrase...). Audited at HEAD 8cc209d (testnet-0006).
Suggested fix
Reject control bytes (<0x20 except tab/newline) in VerifyFull, and/or sanitize/escape message content in printEnvelope (e.g. %q or strip ANSI sequences).
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-16709 and says what differs; it is read like any other.