20,000 USDC
View results
Submission Details
Severity: high

Insufficient Input Validation in the borrow() function

Summary

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

Vulnerability Details

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

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 collateral. 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].collateral 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.