M-1: Frozen accounts can still borrow against frozen collateral
Summary:
When the governor freezes an account, the collateral becomes unavailable and cannot be liquidated. However, the current architecture still allows the account to borrow tokens, potentially bypassing the freeze's intended purpose.
Description:
The function freeze() allows freezing the assets of a user. This freeze functionality is required by the Securitize integration guide.
The freeze is intended to execute court orders or regulatory needs on an account. When frozen, an account cannot be liquidated, and eventually the governor will be responsible for unfreezing it or seizing the collateral.
However, the frozen account can still borrow on the EVK after being frozen because the EVK uses balanceOf() to determine the account balance and ignores if the assets are frozen.
This could allow a user under court order to max borrow against his collateral after being frozen and exit some liquidity, bypassing some of the intended purpose of the freeze feature.
Impact:
Medium. A frozen account can still borrow against its collateral, potentially bypassing court orders or regulatory requests.
Recommendation:
As suggested by the Euler team:
Override the balanceOf() function to return zero if the EVC checks are in progress. This will result in 0 collateral for the EVK and effectively block new borrows while still returning the correct user balance for wallets and indexers.
Developer Response:
Fixed in: bb0bb5.