20,000 USDC
View results
Submission Details
Severity: medium

The lack of `maxLoanRatio` upper limit breaks the logic of the platform

Summary

The updateMaxLoanRatio function sets MaxloanRatio, but not having an upper limit breaks the logic of the platform, it can even be set to 100% or higher, this is wrong

Vulnerability Details

src/Lender.sol:
209 /// @param maxLoanRatio the new max loan ratio
210: function updateMaxLoanRatio(bytes32 poolId, uint256 maxLoanRatio) external {
211: if (pools[poolId].lender != msg.sender) revert Unauthorized();
212: if (maxLoanRatio == 0) revert PoolConfig();
213: pools[poolId].maxLoanRatio = maxLoanRatio;
214: emit PoolMaxLoanRatioUpdated(poolId, maxLoanRatio);
215: }

Impact

Tools Used

Manuel Code Review

Recommendations

add upper limit to MaxloanRatio value

Support

FAQs

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