<!-- XE-13349 · Report bug · testnet -->
*Markdown view of <https://bounty.xe.network/XE-13349>. The page is the record; this is the same page for reading.*

XE-13349 · Bounty

# Report bug

Closed · duplicate
—
[xe#494](https://github.com/xeprotocol/xe/issues/494)
filed 2026-11-12 03:18 UTC
by Gib230223

Verdict
:   Duplicate

Tier
:   —

Claimed
:   —

Area
:   Consensus

Duplicate of
:   [XE-0028](https://bounty.xe.network/XE-0028) accepted

Tracked
:   internally

Updated
:   2026-11-20 00:34 UTC

Told
:   2026-11-20 00:33 UTC

### Patches

- [xe#522](https://github.com/xeprotocol/xe/pull/522) open by arturbarszcz78
  fix(core): validate asset, lease existence, and emission amount in staged BlockLeaseSettle (fixes #494)

### History

- [554020](https://bounty.xe.network/log/554020) 2026-11-20 00:34 UTC reply.mirrored
- [553469](https://bounty.xe.network/log/553469) 2026-11-20 00:34 UTC github.state\_pushed
- [553454](https://bounty.xe.network/log/553454) 2026-11-20 00:34 UTC github.labels
- [552478](https://bounty.xe.network/log/552478) 2026-11-20 00:33 UTC proposal.adopted
- [552477](https://bounty.xe.network/log/552477) 2026-11-20 00:33 UTC reply.sent
- [552476](https://bounty.xe.network/log/552476) 2026-11-20 00:33 UTC ticket.status new → closed
- [551870](https://bounty.xe.network/log/551870) 2026-11-20 00:33 UTC proposal.adopted
- [551869](https://bounty.xe.network/log/551869) 2026-11-20 00:33 UTC ticket.facts area
- [551868](https://bounty.xe.network/log/551868) 2026-11-20 00:33 UTC proposal.adopted
- [551867](https://bounty.xe.network/log/551867) 2026-11-20 00:33 UTC ticket.facts
- [551866](https://bounty.xe.network/log/551866) 2026-11-20 00:33 UTC proposal.adopted
- [551865](https://bounty.xe.network/log/551865) 2026-11-20 00:33 UTC ticket.facts

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

### Report

# XE Bounty — Laporan siap file (temuan pass 3 #2)

File issue baru di: https://github.com/xeprotocol/xe/issues/new
Paste judul \+ isi di bawah. Akun GitHub: Gib230223.

---

## Judul

\[Low\] ValidateStagedBlock BlockLeaseSettle accepts any self-asserted Amount and any Asset

## Isi

## Summary

In `core/ledger.go`, the staged `BlockLeaseSettle` case in `ValidateStagedBlock` (\~lines 2794–2807) checks only the uint64 overflow guard and the balance equation `b.Balance == parentBalance + b.Amount`. It never checks `b.Asset == "XE"`, never checks `b.Amount == LeaseTotalEmission(lease)`, and never checks that the lease exists, is Accepted, is expired, or has valid attestations. Full admission (`validateAndAddLeaseSettle`, `core/ledger.go:2117–2250`) requires all of those. So a staged settle with a forged Amount or a wrong Asset is staged-valid but full-invalid — the XE-0028 quorum-decoy pattern.

The settle case is the odd one out: the sibling staged cases anchor their amount to a real store value — staged `BlockReceive` (\~2774) requires `b.Amount == pending.Amount`, staged `BlockLeaseCancel` / `BlockLeaseForceSettle` tie the balance to `pending.Amount`. Settle uses the block's own self-asserted `b.Amount` instead.

## Evidence

```
// core/ledger.go — staged BlockLeaseSettle case (~2794–2807)
pending, err := l.store.GetPendingSend(b.Source)
if err != nil { return fmt.Errorf("staged lease_settle: GetPendingSend: %w", err) }
if pending == nil { return fmt.Errorf("staged lease_settle: no pending escrow for lease") }
expectedBal := parentBalance + b.Amount
if expectedBal < parentBalance {
    return fmt.Errorf("staged lease_settle: balance would overflow uint64")
}
if b.Balance != expectedBal {
    return fmt.Errorf("staged lease_settle: balance mismatch: expected %d, got %d", expectedBal, b.Balance)
}
// No check of b.Asset, no check of b.Amount against the lease.
```

Full admission requires what staging skips (`core/ledger.go`):

- `:2119` — `lease_settle block must have asset=XE`
- `:2070` `LeaseTotalEmission(lease)` \+ `:2174` / `:2183` — `lease_settle XE mismatch: expected %d (segments=%d, base cost=%d, R=%d), got %d`
- lease.State must be LeaseAccepted; `ValidateAttestations` must pass; settleTime within \[expiry, expiry\+grace\].

## Impact (Low)

Staged-valid / full-invalid quorum decoy. Reachable from normal balances (no 2^64 needed; any provider can forge a decoy settle for their own lease), but the attacker must be the account owner (provider) and full admission blocks the commit, so the impact is a chain-position stall / wasted quorum, not theft. Related note: the staged cancel/force\_settle/accept cases also skip the Asset check (full admission requires Asset\=\="XUSD" for all three) — same class, different cases, not claimed here.

## Reproduction (PoC)

MemStore ledger, signed blocks (`core.SignBlock`, `ValidateStagedBlock`):

```
staged lease_settle amount=1e12: ACCEPTED (nil error) — BUG
staged lease_settle amount=200: ACCEPTED (nil error) — BUG
staged lease_settle asset=XUSD: ACCEPTED (nil error) — BUG
staged lease_cancel (balance != parent+pending): REJECTED (staged lease_cancel: balance mismatch: expected 1200, got 1000999) — correct, amount is anchored
```

Two different "emissions" (1e12 and 200\) for one 200-unit escrow both pass staged validation; only one can be real. The Asset\="XUSD" settle would be rejected by full admission ("lease\_settle block must have asset\=XE").

## Suggested fix

In the staged `BlockLeaseSettle` case, anchor the amount to the lease the way the sibling cases anchor to `pending.Amount`: require `b.Asset == "XE"` and `b.Amount == LeaseTotalEmission(lease)` (fetching the lease by `b.Source`), the same checks full admission already performs.

## Novelty note

No ticket covers the staged settle Amount. Closest, all verified: XE-0028 (the general staged class, Accepted Medium); XE-5065 (scoped to overflow on cancel/force\_settle \+ semantic checks for staged lease CREATE/ACCEPT only); XE-6782 (scoped to staged mint/burn/receive; its "why not a duplicate" section confirms the board treats each staged case family separately — the precedent this filing relies on); XE-2636/XE-7353 (cancel/force\_settle overflow); GitHub #401 (empty-asset defaulting to XE in `core/quorum.go` promotable/confirmConflict — a different mechanism in a different function, about the asset default, not the Amount anchor); GitHub #52 (the general class). Checked the live bounty board (High\+Medium and Minor views) and the GitHub repo issues, 2026-11-12.

Repo: github.com/xeprotocol/xe, HEAD 89a542e, testnet-0005.

### Thread

**Joseph Denne**team2026-11-20 00:34 UTCgithub

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