Receive blocks accept an arbitrary Amount that is neither validated nor signed — forged "received" amounts display in the official explorer
Report
Summary
A receive block can carry any Amount value: validateAndAddReceive
never compares it with the pending send's amount, and Amount is not part
of the block-hash preimage for receives, so it is also not covered by the
block's ed25519 signature. In a local harness I committed a receive claiming
Amount = 1,000,000,000 for a real transfer of 100 XE, then changed the
amount post-signing to 5,000,000,000 without changing the block hash or
breaking signature verification. On-chain balances are unaffected (they are
derived from the send/pending, not from receive Amount), but the official
explorer displays b.amount for receive blocks, so a crafted receive shows
a fake "received 1,000,000,000 XE" in the official UI — and any off-chain
integrator reading receive Amount is misled the same way.
What I did
All testing in a local Go harness against the public repo (HEAD 02e9641). testnet-0005 was not touched, no live XUSD was used, no local testnet was run, and no other user's funds, keys, or workloads were involved.
Harness: poc-m1/main.go (package main inside a clone of the repo, same
module). Go 1.27.3. Simulated clock via core.Now. Genesis overridden with
a local keypair (same pattern as the accepted XE-2530 harness);
Difficulty=0. Balances seeded via the test helper SeedAssetForTesting.
Scenario:
- T0: account A seeded with 1,000 XE; A sends 100 XE to B (pending created).
- Exploit: B submits a receive with
Amount = 1,000,000,000but the correctBalance(= 0 + 100).AddBlockmust accept it. - Mutation: take the committed receive, change
Amountpost-signing to 5,000,000,000, and recomputeHashBlock/VerifyBlock/ the ed25519 signature check. - Control: a receive with the correct
Amount(100) but a wrongBalance(999) must be rejected; the correct receive afterwards must succeed.
The harness was run 3 times in a row; all 3 runs were identical (same
hashes, same acceptance/rejection, same balances, exit 0, M-1 REPRODUCED).
What happened
Exploit — lying receive: ACCEPTED
- Send A→B 100 XE hash
58644d085da35a28f005aa1e7f12f2bc937e8d180bde03a01a325a7c4e8e5b5c - Receive (B, first block on the account) with
Amount=1,000,000,000,Balance=100hashf68b15334cb847249ef5145495a19d3bd931c3847b289f3cb14d5e96996573c0 AddBlockACCEPTED it; the stored block carriesAmount=1000000000; B's XE balance is 100 (derived from pending, not fromAmount); the escrow pending is consumed.- Post-signing mutation (
Amount1,000,000,000 → 5,000,000,000):HashBlockis UNCHANGED (f68b15334cb847249ef5145495a19d3bd931c3847b289f3cb14d5e96996573c0);VerifyBlockon the mutated block still passes; the ed25519 signature still verifies against the same hash.
Bonus proof (free from the control run): the honest receive
(Amount=100, Balance=100) has the IDENTICAL hash f68b1533… as the
lying receive (Amount=1,000,000,000) — two blocks differing ONLY in
Amount hash identically, which is direct proof that Amount is not in
the hash preimage.
Control — wrong Balance: REJECTED
- Receive
Amount=100,Balance=999→ rejected:open-receive balance mismatch: expected 100, got 999 - The correct receive afterwards (
Amount=100,Balance=100) → accepted. This proves the harness validates correctly and ONLYAmountescapes validation.
Impact
- A receive block can state any received amount, and the value is stored
verbatim by every node. The official explorer renders it:
blockAmount()inweb/assets/block.js:106-115returnsformatAmount(b.amount, b.asset)for typereceive. A crafted receive therefore displays as e.g. "received 1,000,000,000 XE" in the official UI, while the account's real balance (shown in the balance column) is only 100 XE. The same misleading value reaches any off-chain integrator or payment processor that reads receiveAmount. - Because
Amountis also outside the hash preimage, the value can be altered after signing by anyone relaying the block (peer, API, indexer) without invalidating the hash or the signature — the tampered block still verifies. - This is Minor, not Medium: there is no on-chain effect. Balances
(
rebuildAssetBalances,GetAssetBalanceAtBlock), rollback undo (rebuilt from the source send block), and the supply auditor (termsFromChain) all derive from the send/pending, never from receiveAmount. No funds can be created or lost through this gap and there is no consensus split. It is a data-integrity / display-trust issue, not a funds-safety issue.
Expected behavior
validateAndAddReceive should reject a receive whose Amount differs from
pending.Amount (as validateAndAddSend already validates its own
Amount), and/or Amount should be included in the canonical encoding
for receives (or the field removed if it is intentionally unused). A block
field that the official UI displays as a received amount should not be
freely forgeable and unsigned.
Root cause (code, public repo HEAD 02e9641)
core/ledger.go:1081-1160(validateAndAddReceive): the only amount check is on the derivedBalance(b.Balance == oldBal + pending.Amount, orb.Balance == pending.Amountfor an open-receive).b.Amountis never compared withpending.Amount. Compare withvalidateAndAddSend(core/ledger.go:972), which validatesAmount > 0,Amount <= balance, and the exactBalance.core/encoding.go:139(MarshalBlockCanonical,case BlockReceive): onlySourceis written —Amountis absent.MarshalBlockAux(core/encoding.go:301-331) carries nothing for receives (only lease types get certificate/attestation aux data, plus an optional declared pubkey). ThereforeHashBlock(core/crypto.go:85-99,sha256(networkID || canonical || aux)) does not coverAmount, and the ed25519 signature (over the hash) does not cover it either.web/assets/block.js:106-115(blockAmount()): returnsformatAmount(b.amount, b.asset)forreceive, i.e. the UI trusts the unsigned, unvalidated field.- The field is vestigial on every on-chain path, which is why the gap went
unnoticed:
Amount uint64 \json:"amount,omitempty"`(core/types.go:74); live, all 37 recent receives carryAmount` absent (= 0) — no client fills it.
Relation to existing receive tickets (not a duplicate)
I checked the desk ticket list (2026-11-10). The existing receive tickets all cover different mechanisms:
- XE-2447 (New, 9 Nov): receive timestamp outside the skew window.
- XE-1733 (claimed Minor): the SDK
receive()signs a pending without checking — SDK layer, not ledger validation. - XE-0479: SDK frontier + receive opening block.
- XE-0253: SDK
receiveAllabort on a lease escrow. - XE-0137: descendant-receive race in swap leading to supply inflation.
None of them is about ledger-level validation of receive
Amount, or aboutAmountbeing outside the hash preimage. This report is a different mechanism (ledger validation + encoding/hash coverage), a different entry point, and a different impact (display trust, not supply or SDK behavior).
Reproduction steps
- Clone the public repo at HEAD 02e9641; Go ≥ 1.25.
- Place the harness at
poc-m1/main.go(packagemain, same module) and run from the repo root:go run ./poc-m1 - Observe the exploit: the receive with
Amount=1,000,000,000and correctBalance=100is accepted; the stored block carries Amount 1e9 while B's balance is 100; mutatingAmountto 5,000,000,000 leavesHashBlockunchanged andVerifyBlock+ the ed25519 signature still pass. - Observe the control: the receive with
Balance=999is rejected (open-receive balance mismatch: expected 100, got 999); the correct receive afterwards is accepted. - Re-run 3 times — the harness is deterministic (identical hashes and verdicts in all 3 runs).
Evidence
- Harness:
poc-m1/main.go(attached). - Full logs of the 3 verification runs:
rerun-20261110-1.log…rerun-20261110-3.log(all exit 0,M-1 REPRODUCED; identical except for the wall-clock second in the genesis log line). - Result summary:
RESULT.md. - Key hashes (identical in all 3 runs): send
58644d085da35a28f005aa1e7f12f2bc937e8d180bde03a01a325a7c4e8e5b5c; lying receive AND honest receive (same hash — the point of the bug)f68b15334cb847249ef5145495a19d3bd931c3847b289f3cb14d5e96996573c0; wrong-Balance receive13dffdcbf76b90e88bebbce7d3274276febe830639fa2828d9e569a4664582dc.
Notes
- The harness simplifies the network: one local ledger, memory store,
Difficulty=0, simulated clock. No live network behavior is involved — the claim is about validation and encoding logic, which the harness exercises directly against the same code the node runs. - Honest caveat: the impact is off-chain only, and the field may be
intentionally unused on-chain (all live clients leave it at 0). If the
team considers receive
Amounta vestigial field, the minimal fix is to stop displaying it in the explorer; if it is meant to be meaningful, it should be validated againstpending.Amountand included in the canonical encoding. Either way, an unsigned, unvalidated field that the official UI presents as a received amount is a trust issue worth fixing. - Suggested fix (trivial): in
validateAndAddReceive, addif b.Amount != pending.Amount { return error }; and/or includeAmountin the canonical encoding forBlockReceive(or remove the field from the struct and the explorer). - No testnet-0005 interaction, no live XUSD, no local testnet, no other user's funds, keys, or workloads were touched.
Thread
Thanks. This is the same finding as https://bounty.xe.network/XE-0060, 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-2543 and says what differs; it is read like any other.