Open c4-bot-3 opened 7 months ago
0xA5DF marked the issue as primary issue
0xA5DF marked the issue as selected for report
0xA5DF marked the issue as satisfactory
Changing interest paid to use the end of the loan (this appears in another issue since this delta in time otherwise breaks teh maxSeniorRepayment concept). https://github.com/pixeldaogg/florida-contracts/pull/371
Lines of code
https://github.com/code-423n4/2024-04-gondi/blob/b9863d73c08fcdd2337dc80a8b5e0917e18b036c/src/lib/AuctionWithBuyoutLoanLiquidator.sol#L83
Vulnerability details
Impact
Lenders in the Gondi protocol could be EOA and Gondi Pool. Gondi Pool, an ERC4626, allows anyone to deposit funds and earn yield from lending on Gondi. Gondi Pool implemented the
LoanManager
interfaces, which include thevalidateOffer()
,loanRepayment()
, andloanLiquidation()
functions. The functionsloanRepayment()
andloanLiquidation()
are called when a borrower repays the loan or the loan is liquidated, i.e., when the Pool receives funds back fromMultiSourceLoan
. Both functions is used to update the queue accounting and the outstanding values of the Pool.In the
settleWithBuyout()
function, the main lender buys out the loan by repaying all other lenders directly. However,loanLiquidation()
is not called, leading to incorrect accounting in the Pool.Proof of Concept
The
loanLiquidation()
function handles accounting in the pool. https://github.com/code-423n4/2024-04-gondi/blob/b9863d73c08fcdd2337dc80a8b5e0917e18b036c/src/lib/pools/Pool.sol#L449-L463Tools Used
Manual Review
Recommended Mitigation Steps
Consider checking and calling
loanLiquidation()
insettleWithBuyout()
to ensure accurate accounting in the pool.Assessed type
Other