20,000 USDC
View results
Submission Details
Severity: high

Insufficient Input Validation in borrow() Function

Summary

The borrow() function in the contract does not validate that the borrows[i].debt parameter provided is not zero.

Vulnerability Details

The borrow function lacks validation for the borrows[i].debt input parameters. This could lead to edge cases where the loan has a zero value for borrows[i].debt.

Impact

The impact of this vulnerability is that it could lead to unexpected behaviours in the smart contract, such as the creation of loans with zero debt. This could potentially disrupt the normal functioning of the contract and lead to financial losses

Tools Used

Manual Review

Recommendations

Add a check to ensure that borrows[i].debt is greater than zero.

Whilst this can be guarded on the frontend inputs, and I have seen via public commentary on Twitter that checks such as these should be disregarded to save gas, the ultimate checks are the smart contracts and the guard rails should ultimately be set here

Support

FAQs

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