AccountFacet.depositAndAllocateForPartyB is missing notLiquidatedPartyB modifier
Summary
AccountFacet.depositAndAllocateForPartyB is missing notLiquidatedPartyB modifier. Hence allows allocating funds towards a liquidated partyB-partyA pair.
Vulnerability Detail
The AccountFacet.allocateForPartyB function has the notLiquidatedPartyB modifier. But that validation can be bypassed by calling depositAndAllocateForPartyB function.
Using depositAndAllocateForPartyB a partyB can allocate funds towards a liquidated partyB-partyA pair. This can severely impact liquidations as the allocated balance will get changed between the liquidatePartyB and liquidatePositionsPartyB functions.
AkshaySrivastav
medium
AccountFacet.depositAndAllocateForPartyB
is missingnotLiquidatedPartyB
modifierSummary
AccountFacet.depositAndAllocateForPartyB
is missingnotLiquidatedPartyB
modifier. Hence allows allocating funds towards a liquidated partyB-partyA pair.Vulnerability Detail
The
AccountFacet.allocateForPartyB
function has thenotLiquidatedPartyB
modifier. But that validation can be bypassed by callingdepositAndAllocateForPartyB
function.Impact
Using
depositAndAllocateForPartyB
a partyB can allocate funds towards a liquidated partyB-partyA pair. This can severely impact liquidations as the allocated balance will get changed between theliquidatePartyB
andliquidatePositionsPartyB
functions.Code Snippet
https://github.com/sherlock-audit/2023-06-symmetrical/blob/main/symmio-core/contracts/facets/Account/AccountFacet.sol#L66-L82
Tool used
Manual Review
Recommendation
Consider adding the
notLiquidatedPartyB
modifier to theAccountFacet.depositAndAllocateForPartyB
function.Duplicate of #247