Reproduced Exploit

Burve — Reserve share overflows due to strict reward calculation

1. ReserveLib.deposit mints shares as amount * shares / balance. 2. Dust residuals leave balance tiny while amount > 0 still mints. 3. Repeated inflation drives shares near type(uint256).max. 4. Next deposit panics on shares += minted → permanent DoS of trim paths.

Apr 2025Otheruntagged2 min read

Chain

Other

Category

untagged

Date

Apr 2025

Source

AuditVault

EVM Playground

Source-level debugger — step opcodes and Solidity in sync

evm-hack-analyzer

The attack is replayed in an in-browser EVM preloaded with the exact dumped fork state. The execution tree shows every call; step by Solidity line or by opcode across all depths — source, Stack, Memory, Storage, Balances (native / ERC-20 / NFT), Transient storage and Return value stay in sync. Click a tree node, opcode, or source line to jump. No backend, no live RPC.

Loading fork state…

Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 56958-h-9-reserve-share-overflows-due-to-too-strict-reward-calcula. Standalone Foundry PoC and full write-up: 56958-h-9-reserve-share-overflows-due-to-too-strict-reward-calcula_exp in the evm-hack-registry mirror.


Vulnerability classes: integer-bounds · underflow · reward-calculation · fix-arithmetic

Reproduction: self-contained Foundry PoC, offline, forge-std only. Full trace: output.txt.


Key info#

ImpactHIGH — reserve share counter overflows → trim/deposit DoS
ProtocolBurve ReserveLib
Vulnerable codeshares = (amount * reserve.shares[idx]) / balance with no floors
Bug classShare inflation / overflow from dust deposits
FindingSherlock 2025-04-burve · #56958 · H-9 · TessKimy
Reportsherlock-audit/2025-04-burve-judging
Fixitos-finance/Burve#78
Compiler^0.8.24 (PoC)

TL;DR#

  1. ReserveLib.deposit mints shares as amount * shares / balance.
  2. Dust residuals leave balance tiny while amount > 0 still mints.
  3. Repeated inflation drives shares near type(uint256).max.
  4. Next deposit panics on shares += minted → permanent DoS of trim paths.

The vulnerable code#

SOLIDITY
shares = (balance == 0)
    ? amount * SHARE_RESOLUTION
    : (amount * reserve.shares[idx]) / balance; // @> VULN
reserve.shares[idx] += shares;

Fix: minimum balance/amount before minting reserve shares.

Diagrams#

flowchart TD A["trimBalance residual dust"] --> B["deposit amount against tiny balance"] B --> C["shares inflates"] C --> D{"shares near max?"} D -->|yes| E["shares += minted panics"] E --> F["trim and deposit DoS"]

Impact#

Total share overflow corrupts reserve accounting; functions that deposit to reserve revert forever.

Sources#


Sources & further analysis#

Reproductions & code

Alerts & third-party analyses

  • Web3Sec X hacked database: search.
  • Rekt leaderboard: search.
  • Solodit incident search: search.

These dashboards index community alerts tweets, post-mortems, and independent write-ups. Reach them through the protocol name above to cross-check this reproduction against other analyses.