Unprotected external calls in ReserveLibrary.sol
enable reentrancy in LendingPool.sol
, allowing attackers to drain funds. IMMEDIATE AND DECISIVE ACTION IS NON-NEGOTIABLE.
ReserveLibrary.sol
's deposit
and withdraw
functions execute external calls (safeTransferFrom
, IRToken.mint
, IRToken.burn
) without reentrancy protection. LendingPool.sol
's deposit
, withdraw
, borrow
, repay
, depositNFT
, withdrawNFT
, initiateLiquidation
, and closeLiquidation
functions call these vulnerable ReserveLibrary.sol
functions. A malicious contract, acting as the reserve asset token, can re-enter LendingPool.sol
during the ERC20 transferFrom
callback within ReserveLibrary.sol.deposit
, bypassing intended logic and state updates. Similar reentrancy vectors exist in ReserveLibrary.sol.withdraw
via IRToken.burn
and are exploitable through LendingPool.sol.withdraw
.
fund loss as the yulnerability enables a Malacious attacker to manipulate the core deposit and withdrawal functions in LendingPool.sol, leading to unauthorized RToken minting during deposits and excessive reserve asset withdrawals. By exploiting this re-entrancy condition, an attacker can systematically drain the lending pool's liquidity and artificially inflate their token balances. The presence of this vulnerability in primary fund flow paths represents a critical risk to protocol solvency and user assets.
Immediate Mitigation: Wrap LendingPool.sol
's deposit
, withdraw
, borrow
, repay
, depositNFT
, withdrawNFT
, initiateLiquidation
, and
closeLiquidation
functions with @openzeppelin/contracts/utils/ReentrancyGuard
's nonReentrant
modifier.
Code Review: Thoroughly audit all functions in LendingPool.sol
and ReserveLibrary.sol
for external calls and potential reentrancy vectors.
Testing: Implement comprehensive reentrancy tests.
In LendingPool.sol
, wrap vulnerable functions with nonReentrant
:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.