# Drainage of the LEND token reserves through repeated claims of the same rewards

CoreRouter.claimLend never resets lendAccrued after granting LEND, letting any user repeatedly claim the same rewards and drain reserves.

- Payout: Audit contest
- Severity: high
- Program: Lend Audit Contest
- Found by: 0x23r0
- Disclosed: 2025-05-22
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2025-05-lend-audit-contest-judging/issues/148
- Library page: https://bugbountylibrary.com/r/sherlock%3A2025-05-lend-audit-contest%3AH-1
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:sherlock sev:high tech:solidity technique:regression technique:source-review vuln:accounting-error vuln:business-logic

**Target:** CoreRouter.claimLend / LendStorage.lendAccrued (Solidity, LayerZero)
**Root cause:** claimLend reads lendAccrued and calls grantLendInternal but ignores its return value and never writes back the remaining balance, so the accrued amount persists after a successful transfer.
**Steps:**
1. User supplies tokens and accrues LEND rewards via normal protocol use.
2. Call `claimLend()`; loop reads `accrued = lendStorage.lendAccrued(holder)` and calls `grantLendInternal(holder, accrued)`.
3. Tokens transfer successfully but `lendAccrued[holder]` is unchanged.
4. Call `claimLend()` again with same holder; same accrued amount is paid out again.
5. Repeat until protocol LEND balance is drained.
**How found:** Code-reading comparison against Compound's Lendtroller, which assigns `lendAccrued[holders[j]] = grantLendInternal(...)`; the missing assignment in CoreRouter.claimLend revealed the unreset state.
**Exploitation:** Any user with nonzero accrued rewards repeatedly invokes claimLend() for the same holder address, receiving the full accrued amount each call until the router's LEND reserves are exhausted, blocking legitimate claims.
**Insight:** When porting Compound-fork reward logic, diff every state write in the original against the fork; grant functions that return a remaining balance must be written back, otherwise accrual persists and rewards are replayable.

