This repository has been archived by the owner on Oct 22, 2023. It is now read-only.
MiloTruck - Borrower's reputation mark becomes permanent if his loan is defaulted and claimed by lender #484
Labels
Non-Reward
This issue will not receive a payout
Sponsor Disputed
The sponsor disputed this issue's validity
Won't Fix
The sponsor confirmed this issue will not be fixed
MiloTruck
medium
Borrower's reputation mark becomes permanent if his loan is defaulted and claimed by lender
Summary
Borrowers' reputation are not updated if a lender claims their defaulted loan, which will affect their reputation negatively forever.
Vulnerability Detail
In
TellerV2.sol
, if a loan is repaid or liquidated, the borrower's reputation mark is removed in the_repayLoan()
function:TellerV2.sol#L758-L761
As the
ReputationManager.updateAccountReputation()
function fetches a borrower's active bids usinggetBorrowerActiveLoanIds()
, the bid is also removed from_borrowerBidsActive
to prevent it from ever affecting the borrower's reputation in the future:TellerV2.sol#L731-L732
However, if the lender of a defaulted loan claims its collateral through the
CollateralManager.withdraw()
function, the borrower's reputation is not updated, and the bid is never removed from_borrowerBidsActive
. This will cause the borrower to have a permanent defaulted loan in his reputation whenever someone callsReputationManager.getDefaultedLoanIds()
.Impact
Borrowers will have a permanent defaulted loan in their reputation for every defaulted loan that is claimed by a lender. This might cause them to be unable to get loans in the future as lenders rely on the reputation system to determine whose bids to accept.
Code Snippet
Tool used
Manual Review
Recommendation
In the
CollateralManager.withdraw()
function, consider updating the borrower's reputation and removing the bid from_borrowerBidsActive
.The text was updated successfully, but these errors were encountered: