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

Malicious borrower can empty pool balance by refinancing

Summary

Malicious borrower can empty pool balance by refinancing.

Vulnerability Details

Borrower can refinance a loan to a new pool, the new pool balance will be reduced by the new debt.

_updatePoolBalance(poolId, pools[poolId].poolBalance - debt);

At the end of the refinancing process, the new pool balance is wrongly reduced again.

pools[poolId].poolBalance -= debt;

A malicious borrower can specify the new debt to be the half of the new pool balance and refinance to the new pool, then the new pool will be emptied as the pool balance is reduced twice.

Impact

Pool balance is emptied.

Tools Used

Manual Review

Recommendations

Please consider to remove one of the reductions in the refinance method.

Support

FAQs

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