Closed c4-submissions closed 11 months ago
bytes032 marked the issue as insufficient quality report
GalloDaSballo (sponsor) disputed
it doesn't violate the protocol. Any cdp below 125% should be liquidated in recovery mode to push the TCR back to 125%, unless its below 103%
jhsagd76 marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/Dependencies/EbtcBase.sol#L129-L130
Vulnerability details
Impact
There are two possible cases where a
CDP
can beliquidated
:ICR
falls below theMCR
.ICR
falls below theTCR
.However, in
recovery mode
, there is a risk of accidentally liquidating aCDP
with anICR
higher than theTCR
.Proof of Concept
The
liquidation threshold check
function is as follows:As we can see, the
CDP
can always be liquidated whenICR < MCR
. However, there is ascenario
in which theTCR
is below theMCR
, indicating recovery mode (TCR < MCR < CCR
). When a user attempts toliquidate
aCDP
with anICR
betweenTCR
andMCR
(i.e.TCR < ICR < MCR
), theCDP
is possible toliquidate
due toICR < MCR
. This, however, violates theprotocol
.Tools Used
Recommended Mitigation Steps
Please modify above check as below:
Assessed type
Invalid Validation