Reproduced Exploit
LEND: 2.8% of every liquidation stays in the router forever
On every liquidation, CoreRouter multiplies the seized collateral by PROTOCOL_SEIZE_SHARE_MANTISSA (2.8e16) and stores the product in protocolReward. The borrower loses the full seize. The liquidator is credited seize - reward and can redeem that credit. Nothing ever reads protocolReward except to…
Loss
28 COL of a 1000 COL seizure. The liquidator can redeem 972. The 28 has no owner
Chain
Ethereum
Category
logic
Date
May 2025
Source
AuditVault
EVM Playground
Source-level debugger — step opcodes and Solidity in sync
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. Query opens a search over the trace: previous and next writes, balance changes and calls, breakpoints, and a diff of everything that changed between two steps. No backend, no live RPC.
Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 58371-h-2-protocol-rewards-tokens-permanently-stuck-sherlock-lend. Standalone Foundry PoC and full write-up: 58371-h-2-protocol-rewards-tokens-permanently-stuck-sherlock-lend_exp in the
evm-hack-registrymirror.
Vulnerability classes:
vuln/logic/reward-calculation·vuln/logic/liquidation-logic
Key info#
| Field | Value |
|---|---|
| Loss | 28 COL of a 1000 COL seizure. The liquidator can redeem 972. The 28 has no owner |
| Vulnerable contract | CoreRouter.liquidateSeizeUpdate |
| Attacker EOA | 0x1111111111111111111111111111111111111111 (the liquidator) |
| Attack contract | Exploit |
| Attack tx | Exploit.run() |
| Chain / block / date | Ethereum model · block 0 · 2025-05 |
| Compiler | solc 0.8.27, cancun, via IR |
| Bug class | Protocol seize share is accrued and never withdrawn |
TL;DR#
On every liquidation, CoreRouter multiplies the seized collateral by PROTOCOL_SEIZE_SHARE_MANTISSA (2.8e16) and stores the product in protocolReward. The borrower loses the full seize. The liquidator is credited seize - reward and can redeem that credit. Nothing ever reads protocolReward except to add to it. A 1000 COL seizure leaves 28 COL in the router with no claim.
The vulnerable code#
uint256 currentReward = mul_(seizeTokens, Exp({mantissa: lendStorage.PROTOCOL_SEIZE_SHARE_MANTISSA()}));
lendStorage.updateProtocolReward(lTokenCollateral, lendStorage.protocolReward(lTokenCollateral) + currentReward); // @> VULN: 2.8% of seized collateral is added to protocolReward, which no function ever pays out
The recommended change is a withdrawal or a reserve sink for protocolReward. The audited code has neither. redeem only pays totalInvestment.
Root cause#
updateProtocolReward is the only writer, and it replaces the mapping with a larger value. CoreRouter.redeem transfers collateral against totalInvestment, which was increased by seizeTokens - currentReward, not by currentReward.
Preconditions#
- A borrower has 1000 COL of
totalInvestmentand the router holds that collateral. PROTOCOL_SEIZE_SHARE_MANTISSAis 2.8e16.- The lendtroller returns 1000 seize tokens for the repayment.
Attack walkthrough#
- The router custodies 1000 COL for the borrower.
- The liquidator calls
liquidate. The seize is 1000 COL. - 28 COL is added to
protocolReward. The liquidator is credited 972 COL. - The liquidator redeems 972 COL.
- The router still holds 28 COL. Redeeming that 28 reverts with
Insufficient balance.
Diagrams#
Impact#
The protocol's 2.8% seize share cannot be moved to a treasury, a reserve, or any other spender. On this seizure that is 28 COL. The same fraction of every later liquidation is added to the same stranded balance. Suppliers and the liquidator are paid. The protocol is not.
Remediation#
Add a privileged or governance path that transfers protocolReward[lToken] out of the router and sets the mapping back down, or fold the amount into the existing reserve. Do not only increment the mapping.
How to reproduce#
cd 58371-h-2-protocol-rewards-tokens-permanently-stuck-sherlock-lend_exp
forge test -vv
test_protocol_reward_is_stuck asserts the 28 COL residual. test_control_stuck_reward_cannot_be_redeemed asserts a redeem of that residual reverts. Captured output is output.txt.
Sources#
- AuditVault finding: https://github.com/Auditware/AuditVault/blob/main/findings/58371-h-2-protocol-rewards-tokens-permanently-stuck-sherlock-lend.md
- Sherlock issue 184: https://github.com/sherlock-audit/2025-05-lend-audit-contest-judging/issues/184
- Blamed lines: https://github.com/sherlock-audit/2025-05-lend-audit-contest/blob/main/Lend-V2/src/LayerZero/CoreRouter.sol#L300
- Taxonomy: genome reward-accounting, liquidation-incentives, dos/frozen-funds, loss-of-funds/locked-funds, known-pattern, always, redesign-logic, blast-radius/protocol-wide. Tags severity/high, sector/lending, sector/bridge, sector/governance, platform/sherlock.
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 58371-h-2-protocol-rewards-tokens-permanently-stuck-sherlock-lend_exp (evm-hack-registry mirror).
- AuditVault finding: 58371-h-2-protocol-rewards-tokens-permanently-stuck-sherlock-lend.
Alerts & third-party analyses
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.