sherlock-audit / 2023-02-kairos-judging

2 stars 0 forks source link

duc - Borrower can reduce the interest of shortly loans #172

Closed sherlock-admin closed 1 year ago

sherlock-admin commented 1 year ago

duc

medium

Borrower can reduce the interest of shortly loans

Summary

Borrower can reduce the interest of quick loans by using multiple own offers.

Vulnerability Detail

Code Snippet

https://github.com/sherlock-audit/2023-02-kairos/blob/main/kairos-contracts/src/ClaimFacet.sol#L99

Tool used

Manual review

Recommendation

Should distribute the minimum interest based on the amount of each offer (povision.amount)

npasquie commented 1 year ago

sent = provision.amount + (interests / loan.nbOfPositions); has interests = nbOfOffers * proto.minOfferCost[collatState.assetLent] as evaluated at borrow time https://github.com/sherlock-audit/2023-02-kairos/blob/main/kairos-contracts/src/BorrowLogic/BorrowHandlers.sol#L180 this simplifies to provision.amount + minOfferCost so cheating the lender out of its minimal interest is not possible for short times