58393 sc low wrong order in balance querying instructions in morphoyearnogwethstrategy deallocate function leads to always emit strategydeallocationloss event
Description
Brief/Intro
Vulnerability Details
function _deallocate(uint256 amount) internal override returns (uint256) {
vault.withdraw(amount, address(this), address(this));
@> uint256 wethBalanceBefore = TokenUtils.safeBalanceOf(address(weth), address(this));
@> uint256 wethBalanceAfter = TokenUtils.safeBalanceOf(address(weth), address(this));
@> uint256 wethRedeemed = wethBalanceAfter - wethBalanceBefore;
if (wethRedeemed < amount) {
emit StrategyDeallocationLoss("Strategy deallocation loss.", amount, wethRedeemed);
}Impact Details
References
Proof of Concept
Proof of Concept
Previous57522 sc insight usecurrent flag ignored in preview functions in moonwell strategiesNext58363 sc high accounting corruption in liquidations due to missing global counter update
Was this helpful?