20,000 USDC
View results
Submission Details
Severity: medium
Valid

Loan may be refinanced to a pool with high interest rate

Summary

Loan may be refinanced to a pool with high interest rate.

Vulnerability Details

Borrower may refinance a loan to a new pool with lower interest rate to get a better loan.

However, the new pool's interest rate can be updated by the lender.

function updateInterestRate(bytes32 poolId, uint256 interestRate) external {
if (pools[poolId].lender != msg.sender) revert Unauthorized();
if (interestRate > MAX_INTEREST_RATE) revert PoolConfig();
pools[poolId].interestRate = interestRate;
emit PoolInterestRateUpdated(poolId, interestRate);
}

When a borrower sends a transaction to refinance, there is no gurantee that the pool's interest rate won't be updated before the execution of the borrower's transaction, if the pool's interest rate is update higher than the loan's interest rate, the loan's interest rate beomces higher too.

Impact

Borrower gets a bad loan and pays more interest.

Tools Used

Manual Review

Recommendations

Please consider to add check if the new pool's interest rate is higher than the loan's interest rate.

Support

FAQs

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