Revertion of the liquidation function means even when most conditions are good, will make the system enter into error when the dethcollateral - eth will give a negative value thus underflowing.
Proof of Concept
If there are no sell in the market. For any reason at all the system should balance up and ensure that the liquidation function works.
If the liquidation function fails and the contract enters a negative balance, it indicates a critical problem. Negative balances are typically not permissible in financial systems as they can lead to various issues such as incorrect accounting, inability to execute transactions, or even potential exploitation by malicious actors. Note the function also reverts for other reasons.
Tools Used
manual code analysis
Recommended Mitigation Steps
review all potential point of reversion and provide a temporary solution.
for the no sell reversion the contract can use the fees collected by tapp or hold ercamounts to be used as an alternative instead of reverting the entire function.
Lines of code
https://github.com/code-423n4/2024-03-dittoeth/blob/91faf46078bb6fe8ce9f55bcb717e5d2d302d22e/contracts/facets/PrimaryLiquidationFacet.sol#L109
Vulnerability details
Impact
Revertion of the liquidation function means even when most conditions are good, will make the system enter into error when the dethcollateral - eth will give a negative value thus underflowing.
Proof of Concept
If there are no sell in the market. For any reason at all the system should balance up and ensure that the liquidation function works. If the liquidation function fails and the contract enters a negative balance, it indicates a critical problem. Negative balances are typically not permissible in financial systems as they can lead to various issues such as incorrect accounting, inability to execute transactions, or even potential exploitation by malicious actors. Note the function also reverts for other reasons.
Tools Used
manual code analysis
Recommended Mitigation Steps
review all potential point of reversion and provide a temporary solution.
Assessed type
Error