Open c4-bot-8 opened 7 months ago
raymondfam marked the issue as sufficient quality report
raymondfam marked the issue as primary issue
Will let sponsor review the coded POC and its validity.
ditto-eth (sponsor) confirmed
great find solution seems to work too
hansfriese marked the issue as satisfactory
hansfriese marked the issue as selected for report
Lines of code
https://github.com/code-423n4/2024-03-dittoeth/blob/91faf46078bb6fe8ce9f55bcb717e5d2d302d22e/contracts/facets/PrimaryLiquidationFacet.sol#L244-L247 https://github.com/code-423n4/2024-03-dittoeth/blob/91faf46078bb6fe8ce9f55bcb717e5d2d302d22e/contracts/libraries/LibSRUtil.sol#L124
Vulnerability details
Impact
Attackers can make it so that risky debts are not liquidated, and unliquidated risky debts can accumulate over the long term.
Proof of Concept
ShortRecord of TAPP can also be liquidated. If all ercDebt is liquidated,
LibShortRecord.deleteShortRecord
is called. It moves theC.SHORT_STARTING_ID
SR of TAPP to the reusing ID list and close it.Later, when user's ShortRecord is liquidated,
LibShortRecord.fillShortRecord
is called to change the status ofC.SHORT_STARTING_ID
to FullyFilled and update the value in TAPP'sC.SHORT_STARTING_ID
ShortRecord.However,
LibShortRecord.fillShortRecord
does not move theC.SHORT_STARTING_ID
that has been moved to the reusing ID list back to the active state list.If you mint a ShortRecord as NFT and transfer it, the recipient creates a new ShortRecord. If you send an NFT to TAPP,
C.SHORT_STARTING_ID
can be reused and overwrite the original value.This is PoC. Add it to LiquidationPrimary.t.sol.
Tools Used
Manual Review
Recommended Mitigation Steps
Prevents ShortRecord NFT from being sent to TAPPs.
Assessed type
Other