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

should restrict oldPoolId ≠ new poolId

Summary

should restrict oldPoolId ≠ new poolId

Vulnerability Details

For example, in the giveLoan function, the loan can be transferred to a new pool, but it is not checked whether the new pool is the same as the old pool. If it is the same poolid, then there will be problems.

// newpool
pools[poolId].outstandingLoans += totalDebt; // loan.debt + lenderInterest + protocolInterest
// oldpool
pools[oldPoolId].outstandingLoans -= loan.debt;

Actually pools[poolid].outstandingLoans += lenderInterest + protocolInterest

Impact

Relatively speaking, the pool has not been migrated, but outstandingLoans has been updated

Tools Used

vscode

Recommendations

It is recommended to judge that oldPoolId ≠ new poolId

Support

FAQs

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