Bounty
XE-9672 · Bounty

Go chat: NewEnvelope creates and PoWs empty/oversized envelopes its own VerifyFull rejects — the XE-3108 roundtrip break in the original implementation

Closed · duplicate —claimed Minor web filed 2026-11-12 06:23 UTC by xe:03ea5b15

Report

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

Summary

The 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".

Mechanism

  1. 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.
  2. The envelope is submitted to the sender's own node, whose SendChatMessage runs validateChatEnvelope (= VerifyFull) before storing or forwarding — and rejects it as invalid.
  3. 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.

Reproduction (external Go harness module with a replace directive to this tree; the repository itself unmodified)

=== RUN   TestGoChatRoundtrip
    empty: created id=123d1b2a9a337ac9... pow_nonce=0
    empty: VerifyFull rejects: missing required fields
    oversized: created id=aae1f43cafb60e40...
    oversized: VerifyFull rejects: message exceeds maximum length of 8192 bytes
    normal: round-trips OK
--- PASS: TestGoChatRoundtrip

Impact

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

Remediation direction

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

Distinctness (searches run against the live index: NewEnvelope, empty message, chat envelope, VerifyFull)

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

Thread

Joseph Denneteam2026-11-20 00:33 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-9672 and says what differs; it is read like any other.