<!-- XE-17966 · [Re-report] XE-0661 still unfixed at HEAD 8cc209d: lease_cancel still lacks uint64 overflow guard · testnet -->
*Markdown view of <https://bounty.xe.network/XE-17966>. The page is the record; this is the same page for reading.*

XE-17966 · Bounty

# \[Re-report\] XE-0661 still unfixed at HEAD 8cc209d: lease\_cancel still lacks uint64 overflow guard

Closed · duplicate
—claimed High
web
filed 2026-11-18 02:34 UTC
by xe:a2b14c2a

Verdict
:   Duplicate

Tier
:   —

Claimed
:   High

Area
:   Leasing / ledger

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

Tracked
:   internally

Updated
:   2026-11-23 09:05 UTC

Told
:   2026-11-23 09:05 UTC

### Patches

None linked.

### History

- [807557](https://bounty.xe.network/log/807557) 2026-11-23 09:05 UTC proposal.adopted
- [807556](https://bounty.xe.network/log/807556) 2026-11-23 09:05 UTC reply.sent
- [807555](https://bounty.xe.network/log/807555) 2026-11-23 09:05 UTC ticket.status new → closed
- [805475](https://bounty.xe.network/log/805475) 2026-11-23 09:05 UTC proposal.adopted
- [805474](https://bounty.xe.network/log/805474) 2026-11-23 09:05 UTC proposal.adopted
- [805473](https://bounty.xe.network/log/805473) 2026-11-23 09:05 UTC ticket.facts
- [805472](https://bounty.xe.network/log/805472) 2026-11-23 09:05 UTC proposal.adopted
- [805471](https://bounty.xe.network/log/805471) 2026-11-23 09:05 UTC ticket.facts
- [805470](https://bounty.xe.network/log/805470) 2026-11-23 09:05 UTC proposal.adopted
- [805469](https://bounty.xe.network/log/805469) 2026-11-23 09:05 UTC ticket.facts
- [803842](https://bounty.xe.network/log/803842) 2026-11-23 09:03 UTC note.added
- [803841](https://bounty.xe.network/log/803841) 2026-11-23 09:03 UTC proposal.created

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

### Report

{"title": "\[Re-report\] XE-0661 still unfixed at HEAD 8cc209d: lease\_cancel still lacks uint64 overflow guard", "body": "# \[Re-report\] XE-0661 still unfixed at HEAD 8cc209d: validateAndAddLeaseCancel still lacks uint64 overflow check\\n\\n**Original ticket:** [XE-0661](https://bounty.xe.network/XE-0661) \\u2014 "core: validateAndAddLeaseCancel computes expectedBal without overflow protection (High)"\\n**Original status:** triaging (as of this filing)\\n**This report:** re-report \\u2014 the defect is still present at current HEAD. It is NOT a new bug. Filed in the style of XE-13265 (\[Re-report\] XE-0072 still unfixed).\\n\\n## Verified still broken at HEAD 8cc209d ("release: testnet-0006 build", 2026-11-16)\\n\\n`core/ledger.go`, `validateAndAddLeaseCancel` (now at **line 1987**, moved from 1853):\\n\\n`go\noldBal := l.getAssetBalanceOverlay(b.Account, \"XCU\")\nexpectedBal := oldBal + leaseBlock.Amount // overflow not checked\nif b.Balance != expectedBal {\n return fmt.Errorf(\"balance mismatch: expected %d, got %d\", expectedBal, b.Balance)\n}\n`\\n\\nNo `if expectedBal < oldBal` guard exists anywhere in this function.\\n\\n## The contrast is even sharper now\\n\\nThe sibling paths DO have the guard at the same HEAD:\\n\\n- `core/ledger.go:2346` \\u2014 `lease_settle would overflow uint64 balance`\\n- `core/ledger.go:2103` \\u2014 `lease_force_settle would overflow uint64 balance`\\n- `core/ledger.go:1203` \\u2014 `receive would overflow uint64 balance`\\n\\nLeaseCancel remains the sole balance-increasing path without overflow protection, exactly as XE-0661 described. The delta between original filing and now: the function moved lines (1853 \\u2192 1987\) in the testnet-0006 build but the missing guard did not change.\\n\\n## What was checked to rule out an indirect fix\\n\\n- No clamp/saturating-add helper introduced: `grep -rn 'saturating\\|MaxUint64' core/ledger.go` \\u2014 no hits on the lease-cancel path.\\n- `getAssetBalanceOverlay` returns raw uint64; no wrap-detection upstream.\\n- Recent ledger.go commits (testnet-0006 build) touch settlement/quorum, not lease-cancel balance math.\\n\\n## Impact (unchanged from XE-0661)\\n\\nA lease-cancel block with `oldBal + Amount > MaxUint64` wraps and passes validation \\u2014 consumer receives a wrapped (incorrect) balance: double-spend-equivalent on the XCU accounting path.\\n\\n## Suggested fix (unchanged)\\n\\n`go\nexpectedBal := oldBal + leaseBlock.Amount\nif expectedBal < oldBal {\n return fmt.Errorf(\"lease_cancel would overflow uint64 balance\")\n}\n`\\n", "claimed\_tier": "high", "area": "leasing-ledger", "references": "XE-0661"}

### Thread

**Joseph Denne**team2026-11-23 09:05 UTCdesk

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