{"id":"XE-16709","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"650","source_url":"https://github.com/xeprotocol/xe/issues/650","reporter_id":2920,"title":"[Low] Chat messages with ANSI escape sequences are accepted and printed raw to the operator's terminal","area":"node-api","claimed_tier":null,"assessed_tier":null,"verdict":"duplicate","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"closed","closed_reason":"duplicate","github_state":"open","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-17T05:17:33.107125+00:00","updated_at":"2026-11-22T23:26:17.004942+00:00","source_created_at":"2026-11-17T05:17:26+00:00","told_at":"2026-11-22T23:26:17.022174+00:00","status_changed_at":"2026-11-22T23:26:17.013450+00:00","url":"https://bounty.xe.network/XE-16709","body":"## Summary\nChat 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`).\n\n## Root Cause\nUnlike `ValidateMemo` (`core/memo.go`, which rejects control bytes <0x20), chat messages have no content validation, and the CLI prints them unescaped.\n\n## Impact\nTerminal output spoofing: fake prompts, hidden text, screen clearing. A fake seed-phrase prompt is a realistic social-engineering vector against node operators.\n\n## Verification (executed PoC)\n`VerifyFull` ACCEPTED a message containing raw ESC (0x1b) bytes (`\\x1b[2J\\x1b[1;31m[FAKE] Enter seed phrase...`). Audited at HEAD `8cc209d` (testnet-0006).\n\n## Suggested fix\nReject control bytes (<0x20 except tab/newline) in `VerifyFull`, and/or sanitize/escape message content in `printEnvelope` (e.g. `%q` or strip ANSI sequences).","patch_refs":[],"thread":[{"id":18879,"source":"desk","source_ref":"reply:16556","author":"Joseph Denne","team":true,"body":"Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the\nfirst verifiable submission, so this one closes as a duplicate. If you believe it is a different\nbug, file a new report that links https://bounty.xe.network/XE-16709 and says what differs; it is read like any other.","created_at":"2026-11-22T23:26:17.004942+00:00"}]}