Bounty
XE-10134 · Bounty

Pending Send List Duplication: PutPendingSend and CommitUndo omit deduplication on destination index causing phantom duplicate receives

Closed · duplicate — web filed 2026-11-12 10:10 UTC by xe:e4cd6974

Report

Vulnerability Summary

In store/badger_store.go:224-232 and 1060-1070 (and store/mem_store.go:120-135), PutPendingSend and CommitUndo.AddPending index pending transactions by destination account:

		destKey := prefixedKey(prefixPendingDst, ps.Destination)
		var hashes []string
		item, err := txn.Get(destKey)
		if err != nil && err != badger.ErrKeyNotFound {
			return err
		}
		if err == nil {
			if err := item.Value(func(val []byte) error {
				return json.Unmarshal(val, &hashes)
			}); err != nil {
				return err
			}
		}
		hashes = append(hashes, ps.SendHash)
		destData, err := json.Marshal(hashes)
		if err != nil {
			return err
		}
		return txn.Set(destKey, destData)

Notice that hashes = append(hashes, ps.SendHash) unconditionally appends the send block hash to the destination's pending list slice without deduplication:

  1. Idempotency Failure: If PutPendingSend is executed more than once for the same send transaction (e.g. during p2p block synchronization re-runs, block re-announcements, or cascade reorg rollbacks), the transaction hash is appended multiple times: ["sendHashA", "sendHashA"].
  2. Duplicate API & CLI Responses: GetPendingByDest iterates through hashes and fetches each item via GetPendingSend(h). It returns a slice containing duplicate *core.PendingSend records to API callers (GET /pending/{address}).
  3. Client Double-Receive Conflict: Automated client tools and CLI (xe receive) iterate over c.GetPending(addr) and attempt to construct and submit multiple BlockReceive blocks referencing the same send hash, causing transaction rejection or self-fork conflicts.

Proposed Remediation

In store/badger_store.go and store/mem_store.go, ensure hashes is deduplicated before appending:

		alreadyPresent := false
		for _, h := range hashes {
			if h == ps.SendHash {
				alreadyPresent = true
				break
			}
		}
		if !alreadyPresent {
			hashes = append(hashes, ps.SendHash)
		}

Thread

Joseph Denneteam2026-11-20 00:33 UTCdesk

Thanks. This is the same finding as https://bounty.xe.network/XE-0135, 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-10134 and says what differs; it is read like any other.