<!-- XE-16709 · [Low] Chat messages with ANSI escape sequences are accepted and printed raw to the operator's terminal · testnet -->
*Markdown view of <https://bounty.xe.network/XE-16709>. The page is the record; this is the same page for reading.*

XE-16709 · Bounty

# \[Low\] Chat messages with ANSI escape sequences are accepted and printed raw to the operator's terminal

Closed · duplicate
—
[xe#650](https://github.com/xeprotocol/xe/issues/650)
filed 2026-11-17 05:17 UTC
by kecedanzz77-bit

Verdict
:   Duplicate

Tier
:   —

Claimed
:   —

Area
:   Node / API

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-22 23:26 UTC

Told
:   2026-11-22 23:26 UTC

### Patches

None linked.

### History

- [770285](https://bounty.xe.network/log/770285) 2026-11-22 23:26 UTC reply.mirror\_failed
- [770106](https://bounty.xe.network/log/770106) 2026-11-22 23:26 UTC proposal.adopted
- [770105](https://bounty.xe.network/log/770105) 2026-11-22 23:26 UTC reply.sent
- [770104](https://bounty.xe.network/log/770104) 2026-11-22 23:26 UTC ticket.status new → closed
- [769343](https://bounty.xe.network/log/769343) 2026-11-22 23:26 UTC proposal.adopted
- [769342](https://bounty.xe.network/log/769342) 2026-11-22 23:26 UTC ticket.facts area
- [769341](https://bounty.xe.network/log/769341) 2026-11-22 23:26 UTC proposal.adopted
- [769340](https://bounty.xe.network/log/769340) 2026-11-22 23:26 UTC ticket.facts
- [769339](https://bounty.xe.network/log/769339) 2026-11-22 23:26 UTC proposal.adopted
- [769338](https://bounty.xe.network/log/769338) 2026-11-22 23:26 UTC ticket.facts
- [766089](https://bounty.xe.network/log/766089) 2026-11-22 23:17 UTC note.added
- [766088](https://bounty.xe.network/log/766088) 2026-11-22 23:17 UTC proposal.created

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

### 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

**Joseph Denne**team2026-11-22 23:26 UTCdesk

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.
