<!-- XE-0448 · [Medium] cmd/xe chat: signed chat messages render ANSI/OSC terminal control sequences verbatim — screen-clear + OSC-8 phishing inside an authenticated session · testnet -->
*Markdown view of <https://bounty.xe.network/XE-0448>. The page is the record; this is the same page for reading.*

XE-0448 · Bounty

# \[Medium\] cmd/xe chat: signed chat messages render ANSI/OSC terminal control sequences verbatim — screen-clear \+ OSC-8 phishing inside an authenticated session

Closed · duplicate
—claimed Medium
[xe#256](https://github.com/xeprotocol/xe/issues/256)
filed 2026-11-04 09:24 UTC
by Fahri Raditya Arrifudin

Verdict
:   Duplicate

Tier
:   —

Claimed
:   Medium

Area
:   —

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-10 00:11 UTC

Told
:   2026-11-05 22:08 UTC

### Patches

- [xe#263](https://github.com/xeprotocol/xe/pull/263) open by tipprb
  fix(cmd/xe,chat): sanitize ANSI/OSC terminal escapes and validate chat messages (fixes #256)

### History

- [9401](https://bounty.xe.network/log/9401) 2026-11-05 22:09 UTC github.state\_pushed
- [9400](https://bounty.xe.network/log/9400) 2026-11-05 22:09 UTC github.labels
- [9391](https://bounty.xe.network/log/9391) 2026-11-05 22:08 UTC reply.mirrored
- [9373](https://bounty.xe.network/log/9373) 2026-11-05 22:08 UTC reply.sent
- [9372](https://bounty.xe.network/log/9372) 2026-11-05 22:08 UTC proposal.adopted
- [9371](https://bounty.xe.network/log/9371) 2026-11-05 22:08 UTC proposal.adopted
- [9370](https://bounty.xe.network/log/9370) 2026-11-05 22:08 UTC ticket.status triaging → closed
- [9369](https://bounty.xe.network/log/9369) 2026-11-05 22:08 UTC proposal.adopted
- [9368](https://bounty.xe.network/log/9368) 2026-11-05 22:08 UTC ticket.facts
- [9367](https://bounty.xe.network/log/9367) 2026-11-05 22:08 UTC proposal.adopted
- [9366](https://bounty.xe.network/log/9366) 2026-11-05 22:08 UTC ticket.facts
- [7333](https://bounty.xe.network/log/7333) 2026-11-05 14:02 UTC proposal.created

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

### Report

**Suggested severity: Medium**

**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.

Reviewed at commit `02e9641b0ac64437f57e09d63301f88cce61a802`.

## Summary

Signed 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.

## Evidence

- `cmd/xe/chat.go:230`: `fmt.Fprintf(w, "%s %s -> %s %s\n", ts, env.From, env.To, env.Message)` — no sanitization.
- `chat/envelope.go:84-109` (`VerifyFull`): validates signature, PoW and freshness — everything about *authenticity*, nothing about *content*.
- `chat/chat.go` `Store`: keeps `Message` byte-for-byte.

Observed (PoC against a copy of the repo):

```
POC1: signed envelope with terminal escapes PASSES VerifyFull
POC1: 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"
```

## Attack

Victim 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.

## Impact

One signed message phishes or manipulates any user who reads chat; no interaction beyond `xe chat read`.

**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.

### Thread

**Joseph Denne**team2026-11-05 22:08 UTCgithub

Thanks. This is the same finding as https://bounty.xe.network/XE-0409, 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, reply with what differs and we will look again.
