56621 sc insight broken withdrawal logic in aavev3arbusdcstrategy permanently locks user funds
Description
Brief/Intro
Vulnerability Details
function _deallocate(uint256 amount) internal override returns (uint256) {
uint256 usdcBalanceBefore = TokenUtils.safeBalanceOf(address(usdc), address(this));
pool.withdraw(address(usdc), amount, address(this));
uint256 usdcBalanceAfter = TokenUtils.safeBalanceOf(address(usdc), address(this));
uint256 usdcRedeemed = usdcBalanceAfter - usdcBalanceBefore;
if (usdcRedeemed < amount) {
emit StrategyDeallocationLoss("Strategy deallocation loss.", amount, usdcRedeemed);
}
require(TokenUtils.safeBalanceOf(address(usdc), address(this)) >= amount,
"Strategy balance is less than the amount needed");
TokenUtils.safeApprove(address(usdc), msg.sender, amount);
return amount;
}Impact Details
References
Proof of Concept
Proof of Concept
Previous58288 sc critical incorrect fee payment logic leads to underpayment Next57774 sc critical redemption earmark mechanism can be permanently blocked via single block earmark calls
Was this helpful?