{"id":"XE-0448","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"256","source_url":"https://github.com/xeprotocol/xe/issues/256","reporter_id":190,"title":"[Medium] cmd/xe chat: signed chat messages render ANSI/OSC terminal control sequences verbatim — screen-clear + OSC-8 phishing inside an authenticated session","area":null,"claimed_tier":"medium","assessed_tier":null,"verdict":"duplicate","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"closed","closed_reason":"duplicate","github_state":"closed","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-04T09:26:12.769388+00:00","updated_at":"2026-11-10T00:11:31.791685+00:00","source_created_at":"2026-11-04T09:24:33+00:00","told_at":"2026-11-05T22:08:53+00:00","status_changed_at":"2026-11-05T22:08:42.401675+00:00","url":"https://bounty.xe.network/XE-0448","body":"**Suggested severity: Medium**\n\n**Duplicate check:** swept the full live tracker. #50 is the SSE-overflow vector (and explicitly refutes chat starvation via SSE); #10's memo finding is Unicode C1/Bidi in *transaction* memos. No issue covers ANSI/OSC terminal control sequences rendered by the chat CLI.\n\nReviewed at commit `02e9641b0ac64437f57e09d63301f88cce61a802`.\n\n## Summary\nSigned chat messages are rendered to the terminal verbatim, including ANSI/OSC control sequences. One signed, PoW-solved envelope can clear the victim's screen and render attacker-controlled text as a clickable hyperlink — a phishing primitive delivered inside an already-authenticated session.\n\n## Evidence\n- `cmd/xe/chat.go:230`: `fmt.Fprintf(w, \"%s %s -> %s %s\\n\", ts, env.From, env.To, env.Message)` — no sanitization.\n- `chat/envelope.go:84-109` (`VerifyFull`): validates signature, PoW and freshness — everything about *authenticity*, nothing about *content*.\n- `chat/chat.go` `Store`: keeps `Message` byte-for-byte.\n\nObserved (PoC against a copy of the repo):\n```\nPOC1: signed envelope with terminal escapes PASSES VerifyFull\nPOC1: rendered line: \"2026-11-04T08:03:27Z fed11e56… -> victim-address \\x1b[2J\\x1b[H\\x1b]8;;http://evil.example\\aIMPORTANT: re-enter your wallet phrase at http://evil.example\\x1b]8;;\\a\\a\\n\"\n```\n\n## Attack\nVictim registers in the directory; attacker sends one envelope whose `Message` is `\\x1b[2J\\x1b[H` + OSC-8 hyperlink + bell. Victim runs `xe chat read` (or `--follow`): screen clears, attacker text renders as a clickable link. Other escapes rewrite the scrollback/status line for persistent fake prompts. The chat read path already requires an ownership proof, so the victim is by definition logged in when the payload fires.\n\n## Impact\nOne signed message phishes or manipulates any user who reads chat; no interaction beyond `xe chat read`.\n\n**Fix direction:** strip C0/C1 control sequences and OSC/CSI escapes (except newline/tab) at render time in `cmd/xe/chat.go`, or reject envelopes whose message contains them.\n","patch_refs":[{"id":271,"repo":"xeprotocol/xe","kind":"pr","ref":"263","title":"fix(cmd/xe,chat): sanitize ANSI/OSC terminal escapes and validate chat messages (fixes #256)","url":"https://github.com/xeprotocol/xe/pull/263","note":"","state":"open","author":"tipprb","added_by":"desk","created_at":"2026-11-04T10:19:32.105805+00:00"}],"thread":[{"id":406,"source":"github","source_ref":"6670822880","author":"Joseph Denne","team":true,"body":"Thanks. This is the same finding as https://bounty.xe.network/XE-0409, 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, reply with what differs and we will look again.","created_at":"2026-11-05T22:08:53+00:00"}]}