This repository has been archived by the owner on Jan 7, 2024. It is now read-only.
0x52 - MarginAccountHelper will be bricked if registry.marginAccount or insuranceFund ever change #170
Labels
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
Medium
A valid Medium severity issue
Reward
A payout will be made for this issue
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Won't Fix
The sponsor confirmed this issue will not be fixed
0x52
medium
MarginAccountHelper will be bricked if registry.marginAccount or insuranceFund ever change
Summary
MarginAccountHelper#syncDeps causes the contract to refresh it's references to both marginAccount and insuranceFund. The issue is that approvals are never made to the new contracts rendering them useless.
Vulnerability Detail
MarginAccountHelper.sol#L82-L87
When syncDeps is called the marginAccount and insuranceFund references are updated. All transactions require approvals to one of those two contract. Since no new approvals are made, the contract will become bricked and all transactions will revert.
Impact
Contract will become bricked and all contracts that are integrated or depend on it will also be bricked
Code Snippet
MarginAccountHelper.sol#L82-L87
Tool used
Manual Review
Recommendation
Remove approvals to old contracts before changing and approve new contracts after
The text was updated successfully, but these errors were encountered: