<!-- XE-9686 · Staged Block Validation Bypass: ValidateStagedBlock omits structural field constraints and memo restrictions on BlockMint and BlockBurn · testnet -->
*Markdown view of <https://bounty.xe.network/XE-9686>. The page is the record; this is the same page for reading.*

XE-9686 · Bounty

# Staged Block Validation Bypass: ValidateStagedBlock omits structural field constraints and memo restrictions on BlockMint and BlockBurn

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

Verdict
:   Duplicate

Tier
:   —

Claimed
:   —

Area
:   Consensus

Duplicate of
:   —

Tracked
:   internally

Updated
:   2026-11-20 00:33 UTC

Told
:   2026-11-20 00:33 UTC

### Patches

None linked.

### History

- [552754](https://bounty.xe.network/log/552754) 2026-11-20 00:33 UTC proposal.adopted
- [552753](https://bounty.xe.network/log/552753) 2026-11-20 00:33 UTC reply.sent
- [552752](https://bounty.xe.network/log/552752) 2026-11-20 00:33 UTC ticket.status new → closed
- [552193](https://bounty.xe.network/log/552193) 2026-11-20 00:33 UTC proposal.adopted
- [552192](https://bounty.xe.network/log/552192) 2026-11-20 00:33 UTC ticket.facts area
- [552191](https://bounty.xe.network/log/552191) 2026-11-20 00:33 UTC proposal.adopted
- [552190](https://bounty.xe.network/log/552190) 2026-11-20 00:33 UTC ticket.facts
- [552189](https://bounty.xe.network/log/552189) 2026-11-20 00:33 UTC proposal.adopted
- [552188](https://bounty.xe.network/log/552188) 2026-11-20 00:33 UTC ticket.facts
- [552187](https://bounty.xe.network/log/552187) 2026-11-20 00:33 UTC proposal.adopted
- [552186](https://bounty.xe.network/log/552186) 2026-11-20 00:33 UTC ticket.facts
- [550617](https://bounty.xe.network/log/550617) 2026-11-20 00:30 UTC note.added

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

### Report

## Vulnerability Summary

In `core/ledger.go:2732-2870`, `ValidateStagedBlock(b *Block, parentBalance uint64) error` performs validation on candidate blocks competing in a BFT quorum election before they are promoted or staged.

Normal block ingestion via `validateAndAddBurn` (`core/ledger.go:1026-1069`) and `validateAndAddMint` (`core/mint.go:28-80`) strictly enforces protocol invariants regarding forbidden routing fields, non-zero values, and memo restrictions:

### For `BlockBurn`:

- `if b.Destination != "" || b.Source != "" { return fmt.Errorf("burn: must not have source or destination") }`
- `if err := ValidateMemo(b.Memo); err != nil { return fmt.Errorf("burn: %w", err) }`

### For `BlockMint`:

- `if b.Destination != "" || b.Source != "" { return fmt.Errorf("mint: must not have source or destination") }`
- `if b.Memo != "" { return fmt.Errorf("mint: memo not allowed") }`

However, in `ValidateStagedBlock` (`core/ledger.go:2839-2869`), these structural checks are **completely omitted**:

```
	case BlockBurn:
		if b.Asset != "XE" {
			return fmt.Errorf("staged burn: restricted to XE")
		}
		if b.Amount == 0 {
			return fmt.Errorf("staged burn: amount must be > 0")
		}
		if b.Amount > parentBalance {
			return fmt.Errorf("staged burn: insufficient balance: have %d XE, burning %d", parentBalance, b.Amount)
		}
		if b.Balance != parentBalance-b.Amount {
			return fmt.Errorf("staged burn: balance mismatch: expected %d, got %d", parentBalance-b.Amount, b.Balance)
		}
        // MISSING: check that Destination == "" and Source == ""
        // MISSING: ValidateMemo(b.Memo)

	case BlockMint:
		if b.Asset != "XUSD" {
			return fmt.Errorf("staged mint: restricted to XUSD")
		}
		if !l.isMinter(b.Account) {
			return fmt.Errorf("staged mint: account %s is not an authorized minter", shortAddr(b.Account))
		}
		if b.Amount == 0 {
			return fmt.Errorf("staged mint: amount must be > 0")
		}
		expectedBal := parentBalance + b.Amount
		if expectedBal < parentBalance {
			return fmt.Errorf("staged mint: balance would overflow uint64")
		}
		if b.Balance != expectedBal {
			return fmt.Errorf("staged mint: balance mismatch: expected %d, got %d", expectedBal, b.Balance)
		}
        // MISSING: check that Destination == "" and Source == ""
        // MISSING: check that b.Memo == ""
```

---

## Vulnerable Code Locations

1. `core/ledger.go:2839-2851`:
   `case BlockBurn` checks only asset, amount \> 0, parent balance, and balance equation. It omits checking `b.Destination == ""` and `b.Source == ""`, as well as `ValidateMemo(b.Memo)`.
2. `core/ledger.go:2852-2869`:
   `case BlockMint` omits verifying that `b.Destination == ""` and `b.Source == ""`, and omits verifying that `b.Memo == ""`.

---

## Attack \& Failure Scenario

1. An authorized minter (or an attacker generating a conflicting burn block on their account during a reorg/fork) constructs a `BlockMint` or `BlockBurn` with malicious, oversized, or smuggling fields:
   - For example, a `BlockMint` populated with `b.Destination = "xe_victim_account"` and a non-empty `b.Memo`.
   - Or a `BlockBurn` populated with an unvalidated arbitrary-length memo (\> 256 bytes or illegal UTF-8 / control characters) or a phantom `b.Source` / `b.Destination`.
2. When injected into an active conflict or quorum vote election, peer nodes execute `ValidateStagedBlock(candidate, parentBalance)`.
3. Because `ValidateStagedBlock` omits these checks, the malformed block passes validation and is accepted into `stagedStore` via `PutStagedBlock` and promoted via `confirmConflict` / `swapBlockLocked`.
4. When `swapBlockLocked` calls `commitBlockWrite`, the block is permanently appended to the canonical chain.
5. In downstream P2P sync and ledger verification:
   - Nodes syncing the block through standard ingestion pipelines (`validateAndAddMint` or `validateAndAddBurn`) reject the block due to `b.Destination != ""` or `b.Memo != ""`.
   - The network suffers an immediate **consensus split / chain fork**: nodes that staged the block via quorum consider it canonical, while nodes receiving the block via normal sync reject it as invalid!

---

## Impact

1. **Permanent Network Fork / Consensus Split**:
   Inconsistent validation invariants between live block ingestion and staged conflict resolution allow blocks with illegal routing fields or forbidden memos to enter the chain, causing peers syncing from scratch to reject the chain.
2. **Protocol Smuggling \& Storage Bloat**:
   Attackers can smuggle arbitrary metadata into `BlockMint` and oversized unvalidated memos into `BlockBurn` past the consensus validation layer.

---

## Remediation

In `core/ledger.go`, update `ValidateStagedBlock`:

```
	case BlockBurn:
		if b.Asset != "XE" {
			return fmt.Errorf("staged burn: restricted to XE")
		}
		if b.Destination != "" || b.Source != "" {
			return fmt.Errorf("staged burn: must not have source or destination")
		}
		if b.Amount == 0 {
			return fmt.Errorf("staged burn: amount must be > 0")
		}
		if b.Amount > parentBalance {
			return fmt.Errorf("staged burn: insufficient balance: have %d XE, burning %d", parentBalance, b.Amount)
		}
		if b.Balance != parentBalance-b.Amount {
			return fmt.Errorf("staged burn: balance mismatch: expected %d, got %d", parentBalance-b.Amount, b.Balance)
		}
		if err := ValidateMemo(b.Memo); err != nil {
			return fmt.Errorf("staged burn: %w", err)
		}

	case BlockMint:
		if b.Asset != "XUSD" {
			return fmt.Errorf("staged mint: restricted to XUSD")
		}
		if !l.isMinter(b.Account) {
			return fmt.Errorf("staged mint: account %s is not an authorized minter", shortAddr(b.Account))
		}
		if b.Destination != "" || b.Source != "" {
			return fmt.Errorf("staged mint: must not have source or destination")
		}
		if b.Memo != "" {
			return fmt.Errorf("staged mint: memo not allowed")
		}
		if b.Amount == 0 {
			return fmt.Errorf("staged mint: amount must be > 0")
		}
		expectedBal := parentBalance + b.Amount
		if expectedBal < parentBalance {
			return fmt.Errorf("staged mint: balance would overflow uint64")
		}
		if b.Balance != expectedBal {
			return fmt.Errorf("staged mint: balance mismatch: expected %d, got %d", expectedBal, b.Balance)
		}
```

### Thread

**Joseph Denne**team2026-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-9686 and says what differs; it is read like any other.
