Suspended PartyBs can bypass the withdrawal restriction by exploiting `fillCloseRequest`
Suspended PartyBs can bypass the withdrawal restriction by exploiting `fillCloseRequest` function. Thus, an attacker can transfer the ill-gotten gains out of the protocol, leading to a loss of assets for the protocol and its users.\\n```\\nFile: AccountFacet.sol\\n    function withdraw(uint256 amount) external whenNotAccountingPaused notSuspended(msg.sender) {\\n        AccountFacetImpl.withdraw(msg.sender, amount);\\n        emit Withdraw(msg.sender, msg.sender, amount);\\n    }\\n\\n    function withdrawTo(\\n        address user,\\n        uint256 amount\\n    ) external whenNotAccountingPaused notSuspended(msg.sender) {\\n        AccountFacetImpl.withdraw(user, amount);\\n        emit Withdraw(msg.sender, user, amount);\\n    }\\n```\\n\\nWhen a user is suspended, they are not allowed to call any of the `withdraw` functions (withdraw and withdrawTo) to `withdraw` funds from their account. These withdrawal functions are guarded by the `notSuspended` modifier that will revert if the user's address is suspended.\\n```\\nFile: Accessibility.sol\\n    modifier notSuspended(address user) {\\n        require(\\n            !AccountStorage.layout().suspendedAddresses[user],\\n            "Accessibility: Sender is Suspended"\\n        );\\n        _;\\n    }\\n```\\n\\nHowever, suspected PartyBs can bypass this restriction by exploiting the `fillCloseRequest` function to transfer the assets out of the protocol. Following describe the proof-of-concept:\\nAnyone can be a PartyA within the protocol. Suspended PartyBs use one of their wallet addresses to operate as a PartyA.\\nUse the PartyA to create a new position with an unfavorable price that will immediately result in a significant loss for any PartyB who takes on the position. The `partyBsWhiteList` of the new position is set to PartyB address only to prevent some other PartyB from taking on this position.\\nOnce PartyB takes on the position, PartyB will immediately incur a significant loss, while PartyA will enjoy a significant gain due to the zero-sum nature of this game.\\nPartyA requested to close its position to lock the profits and PartyB will fill the close request.\\nPartyA calls the deallocate and withdraw functions to move the assets/gains out of the protocol.
Add the `notSuspended` modifier to the `openPosition` and `fillCloseRequest` functions to block the above-described attack path.\\n```\\nfunction fillCloseRequest(\\n    uint256 quoteId,\\n    uint256 filledAmount,\\n    uint256 closedPrice,\\n    PairUpnlAndPriceSig memory upnlSig\\n// Remove the line below\\n ) external whenNotPartyBActionsPaused onlyPartyBOfQuote(quoteId) notLiquidated(quoteId) {\\n// Add the line below\\n ) external whenNotPartyBActionsPaused onlyPartyBOfQuote(quoteId) notLiquidated(quoteId) notSuspended(msg.sender) {\\n ..SNIP..\\n}\\n```\\n\\n```\\nfunction openPosition(\\n    uint256 quoteId,\\n    uint256 filledAmount,\\n    uint256 openedPrice,\\n    PairUpnlAndPriceSig memory upnlSig\\n// Remove the line below\\n ) external whenNotPartyBActionsPaused onlyPartyBOfQuote(quoteId) notLiquidated(quoteId) {\\n// Add the line below\\n ) external whenNotPartyBActionsPaused onlyPartyBOfQuote(quoteId) notLiquidated(quoteId) notSuspended(msg.sender) {\\n    ..SNIP..\\n}\\n```\\n
In the event of an attack, the protocol will suspend the malicious account and prevent it from transferring ill-gotten gains out of the protocol. However, since this restriction can be bypassed, the attacker can transfer the ill-gotten gains out of the protocol, leading to a loss of assets for the protocol and its users.
```\\nFile: AccountFacet.sol\\n    function withdraw(uint256 amount) external whenNotAccountingPaused notSuspended(msg.sender) {\\n        AccountFacetImpl.withdraw(msg.sender, amount);\\n        emit Withdraw(msg.sender, msg.sender, amount);\\n    }\\n\\n    function withdrawTo(\\n        address user,\\n        uint256 amount\\n    ) external whenNotAccountingPaused notSuspended(msg.sender) {\\n        AccountFacetImpl.withdraw(user, amount);\\n        emit Withdraw(msg.sender, user, amount);\\n    }\\n```\\n