The protocol maintains an accepted tokens array to identify eligible collateral tokens. However, an issue arises when a token, previously accepted and used as collateral, is removed from this list. The SmartVaultV3 contract fails to account for such tokens in its collateral calculations and transfers post-removal. This allows users to obtain free tokens, exploiting the system.
The SmartVaultV3 contract triggers a liquidation for undercollateralized positions based on the euroCollateral() function, which calculates collateral value using the tokens returned by the getAcceptedTokens() function.
During a liquidation, all collateral tokens are sent to the liquidationPoolManager contract. Both the collateral valuation and transfer processes rely on the accepted tokens array. Thus, if a token is removed from this array, any position holding it becomes undercollateralized yet exempt from liquidation, creating a loophole.
Additionally, the removeAsset function allows users to withdraw tokens outside the eligible tokens list, further exploiting the problem.
This could lead to substantial losses for the protocol, as it prevents the full liquidation of positions containing the removed token, leaving associated debts unpaid.
Moreover, informed users can exploit this flaw in the following way:
User A, anticipating the removal of Token X from the list of accepted collateral, mints a substantial amount of tokens using Token X as collateral.
The protocol proceeds to remove Token X from the list of accepted collateral.
Following this removal, User A's position becomes undercollateralized. However, due to the nature of the vulnerability, this under collateralization does not trigger the usual liquidation process, leaving User A's collateral unaffected.
User A then calls the removeAsset function to withdraw all of their Token X collateral from the position.
Note: A flash loan can be used to sandwich the removal call to maximize the exploit.
Manual analysis
Hardhat
When considering the removal of a token, the protocol should assess its impact on existing positions that are utilizing it. One approach could be to disallow the use of the token for collateral in new borrowings while maintaining its validity for existing positions to ensure they remain adequately collateralized. This token can then be gradually phased out.
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.