Submitted by MiloTruck, also found by josephdara
In WildcatSanctionsSentinel.sol, the createEscrow() function checks that msg.sender is a registered market in the WildcatArchController contract:
WildcatSanctionsSentinel.sol#L95-L102
This is meant to ensure that createEscrow() can only be called by markets deployed by the protocol, since they are registered using registerMarket().
However, such an implementation does not account for markets that are removed using the removeMarket() function.
If a market is removed, it should still be able to operate normally as a registered market would. However, due to the check shown above, any function that calls createEscrow() will always revert for removed markets, namely nukeFromOrbit() and executeWithdrawal() when they are called for sanctioned lenders.
If a market is removed, lenders that are sanctioned on Chainalysis cannot be blocked using nukeFromOrbit() since the function will always revert.
This is problematic, as sanctioned addresses will still be able to interact with the market in various ways, such as transferring market tokens, making deposits or calling queueWithdrawal(), when they should not be able to.
Sanctioned lenders will also be unable to call executeWithdrawal() to withdraw their assets from the market into their own escrows.
The following test demonstrates how nukeFromOrbit() and executeWithdrawal() will revert for sanctioned lenders when a market is removed from the WildcatArchController contract:
Consider implementing a way to track removed markets in WildcatArchController. For example, a new EnumerableSet named _removedMarkets could be added.
This can be used to allow removed markets to call createEscrow() as such:
WildcatSanctionsSentinel.sol#L95-L102
Invalid Validation
d1ll0n (Wildcat) confirmed
laurenceday (Wildcat) commented:
