Open c4-bot-7 opened 11 months ago
0xSorryNotSorry marked the issue as sufficient quality report
0xSorryNotSorry marked the issue as primary issue
Acknowledging this, it doesn't hurt to fix the issue (as outlined by the warden, we just have to add a check that the loan is not called in forgive()
), however the GOVERNOR
is trusted to interact properly with the protocol as it is a very powerful role, so I doubt this situation can happen in an operational context.
eswak (sponsor) acknowledged
eswak marked the issue as disagree with severity
Trumpero changed the severity to 2 (Med Risk)
Trumpero marked the issue as satisfactory
Downgrading this issue to low severity since it represents an admin/governor mistake.
Trumpero changed the severity to QA (Quality Assurance)
Trumpero marked the issue as grade-a
Lines of code
https://github.com/code-423n4/2023-12-ethereumcreditguild/blob/2376d9af792584e3d15ec9c32578daa33bb56b43/src/loan/LendingTerm.sol#L695-L722
Vulnerability details
Impact
If
forgive()
is called by the governor on a loan currently undergoing an auction, it prevents the establishment of a new auction house through thesetAuctionHouse()
call. This issue arises because, in AuctionHouse.sol, the state variablenAuctionsInProgress
at line 54 is not decremented to zero whenforgive()
is called in LendingTerm.sol. Consequently, even in the absence of any auctions in progress,nAuctionsInProgress
remains equal to 1, leading to a revert when attempting to executesetAuctionHouse()
at lines 836-839. The following check will revert: https://github.com/code-423n4/2023-12-ethereumcreditguild/blob/2376d9af792584e3d15ec9c32578daa33bb56b43/src/loan/LendingTerm.sol#L836-L839Proof of Concept
Paste the following PoC at the end of LendingTerm.t.sol
Tools Used
Manual review
Recommended Mitigation Steps
The Governor should not have the ability to forgive a loan during an auction. Check that
loan.callTime == 0
inforgive()
function (LendingTerm.sol):require(loan.callTime == 0, "LendingTerm: auction in progress"
To forgive a loan during an auction,forgive()
can be called by anyone from AuctionHouse.sol at the end of the auction.Assessed type
DoS