Can re-onboard a lending term which hasn't been properly cleaned up, allowing it to be immediately offboarded at any time #280
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate-1147
satisfactory
satisfies C4 submission criteria; eligible for awards
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/code-423n4/2023-12-ethereumcreditguild/blob/2376d9af792584e3d15ec9c32578daa33bb56b43/src/governance/LendingTermOffboarding.sol#L154
Vulnerability details
Impact
If a LendingTerm is re-onboarded after being offboarded but before being cleaned up with LendingTermOffboarding.cleanup, the
canOffboard[term]
mapping will be set to true, allowing the LendingTerm to be offboarded at any time by anyone. This can be done to grief borrowers and gauge voters.Proof of Concept
When a LendingTerm is offboarded, it's important that it goes through the two step process of
offboard
andcleanup
. This is necessary becausecleanup
markscanOffboard[term]
as false, preventing offboarding of the term without a successful proposal.Unfortunately, it's reasonably possible that a term gets re-onboarded without first being cleaned up because:
cleanup
can only be executed after all existing loans are called and auctionedAs a result, an unclean term could reasonably end up getting re-onboarded, in which case anyone could immediately offboard it at any time, causing loss to term participants.
Tools Used
Recommended Mitigation Steps
LendingTermOnboarding should validate that the proposed term returns false from
canOffboard[term]
.Assessed type
Invalid Validation
The text was updated successfully, but these errors were encountered: