[WP-H7] InsuranceFund#syncDeps()
may cause users' fund loss
#100
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Lines of code
https://github.com/code-423n4/2022-02-hubble/blob/ed1d885d5dbc2eae24e43c3ecbf291a0f5a52765/contracts/InsuranceFund.sol#L116-L119
Vulnerability details
https://github.com/code-423n4/2022-02-hubble/blob/ed1d885d5dbc2eae24e43c3ecbf291a0f5a52765/contracts/InsuranceFund.sol#L116-L119
The
Governance
address can callInsuranceFund.sol#syncDeps()
to change the contract address ofvusd
anytime.However, since the tx to set a new address for
vusd
can get in between users' txs to deposit and withdraw, in some edge cases, it can result in users' loss of funds.PoC
1,000,000 VUSD
toInsuranceFund
;syncDeps()
and setvusd
to the address ofVUSDv2
;withdraw()
with all theshares
and get back0 VUSDv2
.As a result, Alice suffered a fund loss of
1,000,000 VUSD
.Recommendation
vusd
unchangeable;vusd
must be considered, consider changing thesyncDeps()
to:The text was updated successfully, but these errors were encountered: