Submitted by sirhashalot
The Vault.sol contract has two address state variables, the keeper variable and the controller variable, which are both permitted to be the zero address. If both variables are zero simultaneously, any address can burn the available funds (available funds = balance - totalDebt) by sending these tokens to the zero address with the unprotected utilitize() function. If a user has no totalDebt, the user can lose their entire underlying token balance because of this.
The problematic utilize() function is found here. To see how the two preconditions can occur:
If both address variables are left at their defaults of address(0), then the safeTransfer() call on line 348 would send the tokens to address(0).
Add the following line to the very beginning of the utilize() function:
require(address(controller) != address(0))
This check is already found in many other functions in Vault.sol, including the _unutilize() function.
oishun1112 (Insure) confirmed and resolved:
