{"id":"XE-9672","kind":"bounty","visibility":"public","source":"web","source_repo":"","source_ref":"","source_url":"","reporter_id":693,"title":"Go chat: NewEnvelope creates and PoWs empty/oversized envelopes its own VerifyFull rejects — the XE-3108 roundtrip break in the original implementation","area":"sdk-docs-web","claimed_tier":"minor","assessed_tier":null,"verdict":"duplicate","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"closed","closed_reason":"duplicate","github_state":"","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-12T06:23:37.283740+00:00","updated_at":"2026-11-20T00:33:17.382013+00:00","source_created_at":null,"told_at":"2026-11-20T00:33:17.411116+00:00","status_changed_at":"2026-11-20T00:33:17.392907+00:00","url":"https://bounty.xe.network/XE-9672","body":"Component: xeprotocol/xe @ 89a542e — `chat/envelope.go` (`NewEnvelope` line 60; `VerifyFull` lines 84–89; `MaxMessageBytes` line 15). Consumers: CLI `cmd/xe/chat.go` (`chatSend` → `SendChat`), node `SendChatMessage`/`Node.SendChat` in node.go (runs `VerifyFull` before store/forward; ingest also `VerifyFull`).\r\n\r\nSummary\r\n\r\nThe defect class already paid as XE-3108 in the desk Python copy (and filed as XE-9595 for the dao Python copy) exists in the original Go implementation, which no ticket names: `chat.NewEnvelope` performs no validation of the message at all — it builds, PoW-grinds and signs envelopes for an **empty message** and for a message **larger than `MaxMessageBytes` (8192)** — while `Envelope.VerifyFull`, the check every node runs before accepting a chat envelope, rejects both shapes: empty hits the required-fields check (`e.Message == \"\"` → \"missing required fields\"), oversized hits \"message exceeds maximum length of 8192 bytes\".\r\n\r\nMechanism\r\n\r\n1. A sender (e.g. the shipped CLI's `chatSend`) calls `NewEnvelope(from, to, \"\", kp, difficulty)` or with a >8192-byte message. Creation succeeds; the envelope is PoW-ground (default chat difficulty ≈ 2^18 work) and signed.\r\n2. The envelope is submitted to the sender's own node, whose `SendChatMessage` runs `validateChatEnvelope` (= `VerifyFull`) before storing or forwarding — and rejects it as invalid.\r\n3. The message never sends; the failure surfaces only after the PoW cost has been burned. A normal message round-trips fine (control in the reproduction), so this is a creation-side validation gap, not a broken verifier.\r\n\r\nReproduction (external Go harness module with a replace directive to this tree; the repository itself unmodified)\r\n\r\n```\r\n=== RUN   TestGoChatRoundtrip\r\n    empty: created id=123d1b2a9a337ac9... pow_nonce=0\r\n    empty: VerifyFull rejects: missing required fields\r\n    oversized: created id=aae1f43cafb60e40...\r\n    oversized: VerifyFull rejects: message exceeds maximum length of 8192 bytes\r\n    normal: round-trips OK\r\n--- PASS: TestGoChatRoundtrip\r\n```\r\n\r\nImpact\r\n\r\nThe official Go client can produce chat envelopes the network can never accept, wasting the sender's PoW on every attempt and surfacing the failure only at submission. This is a client reliability defect in the reference implementation — the same creation/verification asymmetry the programme has already rated Minor in both Python copies.\r\n\r\nRemediation direction\r\n\r\nValidate at creation, exactly as the copies do: `NewEnvelope` should refuse an empty message and any message over `MaxMessageBytes` before grinding PoW, so the error reaches the caller before any work is spent.\r\n\r\nDistinctness (searches run against the live index: `NewEnvelope`, `empty message`, `chat envelope`, `VerifyFull`)\r\n\r\n- **XE-3108** (awarded, Minor) names only the desk Python copy; **XE-9595** (ours, new) names only the dao Python copy. Neither mentions the Go original, which is a separate component with its own CLI and node consumers.\r\n- **XE-9591** is the neighbouring creation-order defect in the same CLI — the recipient is checked only after PoW. Different input (recipient vs message content), different missing check, different fix.\r\n- **XE-1472 / XE-1483** are the ChatStore seen-ID black-hole; **XE-5931** is per-account store growth; **XE-6319** is terminal-escape rendering of message bodies. None concerns creation-time content validation.","patch_refs":[],"thread":[{"id":13194,"source":"desk","source_ref":"reply:11216","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-9672 and says what differs; it is read like any other.","created_at":"2026-11-20T00:33:17.382013+00:00"}]}