<!-- XE-10033 · CLI Self-Fork Race Condition: cmdReceive loops multiple pending blocks without frontier propagation creating intra-account conflicts · testnet -->
*Markdown view of <https://bounty.xe.network/XE-10033>. The page is the record; this is the same page for reading.*

XE-10033 · Bounty

# CLI Self-Fork Race Condition: cmdReceive loops multiple pending blocks without frontier propagation creating intra-account conflicts

Closed · invalid
—
web
filed 2026-11-12 09:26 UTC
by xe:e4cd6974

Verdict
:   Invalid

Tier
:   —

Claimed
:   —

Area
:   SDK / docs / web

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-20 00:48 UTC

Told
:   2026-11-20 00:48 UTC

### Patches

None linked.

### History

- [557075](https://bounty.xe.network/log/557075) 2026-11-20 00:48 UTC reply.sent
- [553347](https://bounty.xe.network/log/553347) 2026-11-20 00:33 UTC proposal.adopted
- [553147](https://bounty.xe.network/log/553147) 2026-11-20 00:33 UTC proposal.adopted
- [553146](https://bounty.xe.network/log/553146) 2026-11-20 00:33 UTC ticket.status new → closed
- [552677](https://bounty.xe.network/log/552677) 2026-11-20 00:33 UTC proposal.adopted
- [552676](https://bounty.xe.network/log/552676) 2026-11-20 00:33 UTC ticket.facts area
- [552671](https://bounty.xe.network/log/552671) 2026-11-20 00:33 UTC proposal.adopted
- [552670](https://bounty.xe.network/log/552670) 2026-11-20 00:33 UTC ticket.facts
- [550929](https://bounty.xe.network/log/550929) 2026-11-20 00:31 UTC note.added
- [550928](https://bounty.xe.network/log/550928) 2026-11-20 00:31 UTC proposal.created
- [550927](https://bounty.xe.network/log/550927) 2026-11-20 00:31 UTC proposal.created
- [550926](https://bounty.xe.network/log/550926) 2026-11-20 00:31 UTC proposal.created

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

### Report

## Vulnerability Summary

In `cmd/xe/main.go:747-781`, `cmdReceive()` loops over unreceived pending transfers to construct and submit `BlockReceive` transactions:

```
	fmt.Printf("Receiving %d pending send(s)...
", len(pending))
	for _, p := range pending {
		chain, _ := c.GetChain(addr)
		bals, _ := c.GetBalances(addr)

		prev := "0"
		if len(chain) > 0 {
			prev = chain[len(chain)-1].Hash
		}

		b := &core.Block{
			Type:      core.BlockReceive,
			Account:   addr,
			Previous:  prev,
			Balance:   bals[p.Asset] + p.Amount,
			Timestamp: time.Now().UnixNano(),
			Asset:     p.Asset,
			Source:    p.SendHash,
		}
...
		if err := c.SubmitBlock(b, "receive"); err != nil {
			fmt.Fprintf(os.Stderr, "  skip %s: %v
", shortHash(p.SendHash), err)
			continue
		}
```

When an account has multiple pending transfers (`len(pending) > 1`), `cmdReceive()` processes them in rapid succession. On iteration 0, block $B\_0$ is submitted to the node.

Because `c.SubmitBlock` returns before the network or local store propagates the new frontier block, iteration 1 immediately queries `c.GetChain(addr)` and `c.GetBalances(addr)`. The node's store has not yet committed $B\_0$ or updated `chain[len(chain)-1]`.

As a result:

1. Iteration 1 receives the exact same frontier `prev` and the exact same stale `bals[p.Asset]`.
2. Iteration 1 generates block $B\_1$ pointing to the same `Previous: prev` as $B\_0$.
3. Two blocks with identical `Previous` hashes are broadcast to the network for the same account.

## Impact \& Severity

1. Account Deadlock: Emitting two blocks with the same `Previous` pointer triggers an immediate fork conflict (`core.ErrForkDetected`) on the user's own lattice account.
2. Quorum Lockout: The account's chain is frozen into conflict arbitration in `core.QuorumManager`, blocking subsequent receives and sends until external representatives cast votes.
3. Balance Corruption: Stale balance computation in subsequent iterations leads to consensus rejection with `balance mismatch`.

## Proposed Remediation

In `cmdReceive()`, track local frontier state and balance offsets in-memory across loop iterations:

```
	currentPrev := prev
	currentBalances := bals
	for _, p := range pending {
		b := &core.Block{
			Type:      core.BlockReceive,
			Account:   addr,
			Previous:  currentPrev,
			Balance:   currentBalances[p.Asset] + p.Amount,
...
		}
...
		currentPrev = b.Hash
		currentBalances[p.Asset] += p.Amount
	}
```

### Thread

**XE desk**team2026-11-20 00:48 UTCdesk

Thanks for the report. We read it against the code and could not confirm a bug in what it describes.

This report is closed as invalid. If we have missed something, file a new report that links
https://bounty.xe.network/XE-10033 and says what; it is read like any other.
