A liquidator can grieve the short record's yield if the short record goes to primary liquidation by calling flagShort()
and then doing primary liquidation.
The issue arises when the collateralization ratio (cRatio
) of a short record reaches a certain threshold, making it eligible for immediate liquidation without the need for flagging. This condition is determined by the following code snippet from _canLiquidate()
:
In this situation, a liquidator can proceed with the immediate liquidation of the short record. However, if the liquidator decides to call flagShort() before initiating the liquidation, all of the yield that should rightfully belong to the short position holder ends up being directed to the TAPP (Vault). This unintended consequence allows a malicious liquidator to disrupt the yield distribution and deprive the legitimate short position holder of their earnings.
The reason is that the liquidation calls disburseCollateral, which distributes yield to the short record owner. When a short record is liquidated, the yield is supposed to be distributed to the short record owner. However, if the short record is flagged, the yield is instead diverted to the TAPP (Vault) due to the flagging process updating the short.updatedAt variable.
The following test with comments simulate the certain malicious behavior.
The primary impact of this vulnerability is the potential griefing of the legitimate short position holder's yield. When a short record is liquidated in this manner, the yield that should rightfully belong to the short position holder is rerouted to the TAPP (Vault), effectively depriving the user of their earnings.
Manual review
To mitigate this vulnerability, it is recommended to prevent the flagging of a short record if it is eligible for immediate liquidation. This can be achieved by implementing a check similar to the following within the flagShort() function:
As something like this:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.