<!-- XE-0060 · Block fields outside the canonical hash are neither hashed nor validated, so a relay can rewrite stored block data after signing · testnet -->
*Markdown view of <https://bounty.xe.network/XE-0060>. The page is the record; this is the same page for reading.*

XE-0060 · Bounty

# Block fields outside the canonical hash are neither hashed nor validated, so a relay can rewrite stored block data after signing

Accepted
claimed Minor
[xe#83](https://github.com/xeprotocol/xe/issues/83)
filed 2026-10-26 21:17 UTC
by rusdiwireng

Verdict
:   published when the fix ships

Tier
:   published when the fix ships

Claimed
:   Minor

Area
:   Leasing / ledger

Duplicate of
:   —

Tracked
:   internally

Updated
:   2026-11-10 11:38 UTC

Told
:   2026-11-10 00:16 UTC

### Patches

- [xe#121](https://github.com/xeprotocol/xe/pull/121) open by arturbarszcz78
  fix(core): reject stray unhashed block fields in ledger validators (#83)

### History

- [61413](https://bounty.xe.network/log/61413) 2026-11-10 00:16 UTC reply.mirrored
- [61370](https://bounty.xe.network/log/61370) 2026-11-10 00:15 UTC reply.sent
- [17827](https://bounty.xe.network/log/17827) 2026-11-07 16:08 UTC proposal.adopted
- [17826](https://bounty.xe.network/log/17826) 2026-11-07 16:08 UTC ticket.award
- [17825](https://bounty.xe.network/log/17825) 2026-11-07 16:08 UTC proposal.rejected
- [6892](https://bounty.xe.network/log/6892) 2026-11-05 13:45 UTC proposal.created
- [1817](https://bounty.xe.network/log/1817) 2026-11-02 19:16 UTC proposal.created
- [1471](https://bounty.xe.network/log/1471) 2026-11-02 10:11 UTC note.added
- [764](https://bounty.xe.network/log/764) 2026-10-29 14:22 UTC note.added
- [763](https://bounty.xe.network/log/763) 2026-10-29 14:22 UTC ticket.facts area
- [638](https://bounty.xe.network/log/638) 2026-10-29 14:05 UTC github.labels
- [569](https://bounty.xe.network/log/569) 2026-10-29 14:04 UTC ticket.status triaging → accepted

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

### Report

Suggested severity tier: Minor

Summary:
The canonical hash of a block covers only a subset of its fields, and the signature and the proof of work bind only that hash. For several block types, fields outside the subset are also never read by the ledger validators, so anyone relaying a block can change those fields in transit and the changed copy is the one a node stores. The fields are the amount and destination of a receive block, the source of a send block, the source of a lease block, and the amount of a lease\_cancel and lease\_force\_settle block. Balances are not affected, because every validator recomputes amounts from hashed state and pending records. The stored record is affected.

Evidence:

- core/encoding.go, MarshalBlockCanonical: the receive case writes only the source into the canonical form. The send and lease cases leave out source. The lease\_cancel and lease\_force\_settle cases write only source.
- core/crypto.go, line 107: HashBlock hashes the network ID, the canonical form, and the aux form. Lines 134 and 169 sign and verify over the hash bytes only.
- core/ledger.go, line 1081: validateAndAddReceive derives everything from the pending send and never reads the amount or destination fields of the block.
- core/ledger.go, line 972: validateAndAddSend never checks the source field. Line 1506: validateAndAddLease never checks it either.
- core/ledger.go, lines 1792 and 1879: the cancel and force settle validators compute the refund from the lease block and the pending record, never from the amount field of the incoming block.
- core/ledger.go, line 795: addBlock deduplicates by hash and returns early when a block with that hash is already stored, so the first copy a node sees is the copy it keeps.
- The same codebase rejects stray fields elsewhere. core/ledger.go, line 1030, rejects a burn block with a source or destination, and core/mint.go, line 36, does the same for mint.
- A proof of concept program and its output are available on request. A signed receive block still verifies after its amount is set to 999999999999 and its destination is replaced. The hash is unchanged and verification returns no error. Setting a junk source on a send block and changing a lease\_cancel amount from 100 to 777777777 also leave the hash unchanged.

Impact:
Two nodes can hold different block bodies under one hash and one valid signature, and the difference is permanent for a node that stored the changed copy first, because the genuine body is later ignored as a duplicate. API responses and explorer or indexer views that read the generic block fields can show a receive amount, a cancel amount, or a send source that the signer never signed. No balance changes result from this, and this report claims nothing about balances.

Suggested fix:
Include these fields in the canonical hash, or reject stray values in the validators for these block types, in the same way the burn and mint validators already reject them.

### Thread

**XE desk**team2026-11-10 00:16 UTCgithub

Read and accepted. It is tracked internally and the fix will land in a public PR; this issue is
updated when it does, and the tier and award follow the fix. The desk entry is https://bounty.xe.network/XE-0060.
