This repository has been archived by the owner on Jan 7, 2024. It is now read-only.
MohammedRizwan - Assets sent from MarginAccount to InsuranceFund will be locked forever #142
Labels
Excluded
Excluded by the judge without consulting the protocol or the senior
Non-Reward
This issue will not receive a payout
MohammedRizwan
medium
Assets sent from MarginAccount to InsuranceFund will be locked forever
Summary
Assets sent from MarginAccount to InsuranceFund will be locked forever
Vulnerability Detail
In MarginAccount.sol,
At L-407, the token is transferred to insuranceFund address. The collateral assets will be seized and transferred to the insuranceFund contract. However, there is no way for the liquidity providers of the insuranceFund to get back the collateral assets.
In the current implementation, these collateral assets seized during settleBadDebt() will be frozen in the contract, in essence. They belong to the liquidity providers and they should be able to retrieve them.
But the insurance fund doesn't have a way to transfer non-vusd out of the contract. Assets transferred to the InsuranceFund will be locked forever.
Impact
Assets sent from MarginAccount to InsuranceFund will be locked forever
Code Snippet
https://github.com/hubble-exchange/hubble-protocol/blob/d89714101dd3494b132a3e3f9fed9aca4e19aef6/contracts/MarginAccount.sol#L407
Reference
This similar issue is reported in V1 hubble contracts audit and it seems the mitigation is not incorporated in contracts. Please refer below link for reference-
code-423n4/2022-02-hubble-findings#128
code-423n4/2022-02-hubble-findings#101
Tool used
Manual Review
Recommendation
Have a way for governance to sweep tokens to swap them.
The text was updated successfully, but these errors were encountered: