In the LendingPool contract, the _withdrawFromVault function incorrectly passes msg.sender as the owner parameter when calling the Curve vault's withdraw function. This creates a critical mismatch in ownership validation since msg.sender in this context refers to the user who initiated the deposit, not the LendingPool contract that actually owns the vault shares.
The vulnerability stems from the complex call chain that occurs during a deposit operation:
A user calls the deposit() function, where msg.sender is the user's address
This triggers _rebalanceLiquidity(), which may need to withdraw funds from the Curve vault
The withdrawal is executed through _withdrawFromVault(), which uses:
The fundamental issue is that the owner parameter (third argument) should be address(this) since the LendingPool contract is the actual owner of the vault shares. Instead, it's passing msg.sender, which refers to the original depositor's address.
This creates a critical ownership mismatch because:
The vault shares were originally deposited by the LendingPool contract
The withdrawal attempt specifies a different owner (the user)
The Curve vault will likely reject the transaction due to this ownership discrepancy
_rebalanceLiquidity in deposit
_withdrawFromVault in _rebalanceLiquidity
Failed Rebalancing: The liquidity rebalancing mechanism will fail when trying to withdraw from the vault, potentially leaving the protocol with insufficient buffer liquidity
Blocked Deposits: Since rebalancing is called after deposits, this could effectively block new deposits from being processed
Potential Fund Lock: In severe cases, this could lead to funds being temporarily locked in the Curve vault if the protocol cannot properly execute withdrawals
Manual
Replace msg.sender with address(this).
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.