A User/Lender Can force someone else pool to take their outstanding loan by calling buyLoan()
with someone else poolid
lets say alice has a outstanding loan which she has taken form bob who is the lender now bob decide to auction alice loan for someone else to buy by calling startAuction
:
https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Lender.sol#L437
Now instead of letting someone else buy loan bob will call buyLoan
function with someone else poolid
lets say mark's id and he will pay small amount of protocol interest , now the loan debt is added to the mark's pool instead of adding in bobs pool and bobs pooldebt will be reduced by the loan which alice has taken also the poolbalance will be increased and he will get the lender interest also (see audit tag):
https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Lender.sol#L489C1-L505C72
now bob will became the lender of loan but the loan is being imposed on mark's pool without him knowing even if mark wants to auction alice loan he will not be able to because bob is now the lender :
https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Lender.sol#L518
bob can repeat this process and increase it poolbalance also decrease it's pool debt to 0 and taking the lender interest also because the old pool id will be same because lender collateraltoken and loantoken is not changed :
https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Lender.sol#L493-L497
If alice decide to pay her debt the repaid amount will be added into bob's pool balance instead of mark's pool
https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Lender.sol#L303-L307
a lender can increase its poolbalance and reducing its debt by imposing its pool debt to someone else
vs
original lender should not be able to buy loan and also someone else should not be able to buy loan on someone else behalf(poolid)
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.