20,000 USDC
View results
Submission Details
Severity: medium

Silent overflow

Summary

When we update pool balance we set the value directly that comes when we call the function and my cause a silen overflow

Vulnerability Details

_updatePoolBalance(
oldPoolId,
pools[oldPoolId].poolBalance + loan.debt + lenderInterest
);

function _updatePoolBalance(bytes32 poolId, uint256 newBalance) internal {
pools[poolId].poolBalance = newBalance;
emit PoolBalanceUpdated(poolId, newBalance);
}

There are plenty of places where we do it

Impact

may cause silent overflow or underflow and breaks the logic of the protocol

Tools Used

VSCode

Recommendations

Add checks that the casting value is not greater than the uint256 type max value or smaller than 0:

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.