56806 sc insight broken withdrawal logic in aavev3arbwethstrategy permanently locks user funds
Description
Brief/Intro
Vulnerability Details
function _deallocate(uint256 amount) internal override returns (uint256) {
uint256 wethBalanceBefore = TokenUtils.safeBalanceOf(address(weth), address(this));
// withdraw exact underlying amount back to this adapter
pool.withdraw(address(weth), amount, address(this));
uint256 wethBalanceAfter = TokenUtils.safeBalanceOf(address(weth), address(this));
uint256 wethRedeemed = wethBalanceAfter - wethBalanceBefore;
if (wethRedeemed < amount) {
emit StrategyDeallocationLoss("Strategy deallocation loss.", amount, wethRedeemed);
}
require(TokenUtils.safeBalanceOf(address(weth), address(this)) >= amount, "Strategy balance is less than the amount needed");
TokenUtils.safeApprove(address(weth), msg.sender, amount);
return amount;
}Impact Details
References
Proof of Concept
Proof of Concept
Previous57941 sc high incorrect handling of deallocate return val causes any interest gains in a strategy to become unclaimable and permanently lockedNext58572 sc high liquidation of account collateral doesn t subtract mytsharesdeposited which creates bad debt in the system and causes insolvency
Was this helpful?