MEDIUM severity: The vulnerability lies in the implementation of the `_reduceAccountDebt` function in the `VaultLiqui. The vulnerability lies in the implementation of the `_reduceAccountDebt` function in the `VaultLiquidationAction` contract. Specifically, when liquidating a vault account, the function reduces the debt of the account by setting the `accountDebtOne` and `accountDebtTwo` variables to zero. However, if...

Vulnerable code:
```\nFile: VaultSecondaryBorrow.sol\n\nfunction _setAccountMaturity(\n    VaultAccountSecondaryDebtShareStorage storage accountStorage,\n    int256 accountDebtOne,\n    int256 accountDebtTwo,\n    uint40 maturity\n) private {\n    if (accountDebtOne == 0 && accountDebtTwo == 0) {\n        if (accountDebtOne == 0 && accountDebtTwo == 0) {\n            accountStorage.maturity = 0;\n        } else {\n            accountStorage.maturity = maturity;\n        }\n    }\n```\n```\nFile: VaultLiquidationAction.sol\n\nfunction _reduceAccountDebt(\n    VaultConfig memory vaultConfig,\n    VaultState memory vaultState,\n    VaultAccount memory vaultAccount,\n    PrimeRate memory primeRate,\n    uint256 currencyIndex,\n    int256 depositUnderlyingInternal,\n    bool checkMinBorrow\n) private {\n    if (currencyIndex == 0) {\n        vaultAccount.updateAccountDebt(vaultState, depositUnderlyingInternal, 0);\n        vaultState.setVaultState(vaultConfig);\n    } else {\n        // Only set one of the prime rates, the other prime rate is not used since\n        // the net debt amount is set to zero\n        PrimeRate[2] memory pr;\n        pr[currencyIndex - 1] = primeRate;\n\n        VaultSecondaryBorrow.updateAccountSecondaryDebt(\n            vaultConfig,\n            vaultAccount.account,\n            vaultAccount.maturity,\n            currencyIndex == 1? depositUnderlyingInternal : 0,\n            currencyIndex == 2? depositUnderlyingInternal : 0,\n            pr,\n            checkMinBorrow\n        );\n    }\n}\n```\n```\nFile: VaultSecondaryBorrow.sol\n\nfunction updateAccountSecondaryDebt(\n    VaultConfig memory vaultConfig,\n    address account,\n    uint256 maturity,\n    int256 netUnderlyingDebtOne,\n    int256 netUnderlyingDebtTwo,\n    PrimeRate[2] memory pr,\n    bool checkMinBorrow\n) internal {\n    VaultAccountSecondaryDebtShareStorage storage accountStorage = \n        LibStorage.getVaultAccountSecondaryDebtShare()[account][vaultConfig.vault];\n\n    // Check maturity\n    uint256 accountMaturity = accountStorage.maturity;\n    require(accountMaturity == maturity || accountMaturity == 0);\n\n    int256 accountDebtOne = VaultStateLib.readDebtStorageToUnderlying(pr[0], maturity, accountStorage.accountDebtOne); \n    int256 accountDebtTwo = VaultStateLib.readDebtStorageToUnderlying(pr[1], maturity, accountStorage.accountDebtTwo);\n\n    if (netUnderlyingDebtOne!= 0) {\n        accountDebtOne = accountDebtOne.add(netUnderlyingDebtOne);\n\n        _updateTotalSecondaryDebt(\n            vaultConfig, account, vaultConfig.secondaryBorrowCurrencies[0], maturity, netUnderlyingDebtOne, pr[0]\n        );\n\n        accountStorage.accountDebtOne = VaultStateLib.calculateDebtStorage(pr[0], maturity, accountDebtOne)\n           .neg().toUint().toUint80();\n    }\n\n    if (netUnderlyingDebtTwo!= 0) {\n        accountDebtTwo = accountDebtTwo.add(netUnderlyingDebtTwo);\n\n        _updateTotalSecondaryDebt(\n            vaultConfig, account, vaultConfig.secondaryBorrowCurrencies[1], maturity, netUnderlyingDebtTwo, pr[1]\n        );\n\n        accountStorage.accountDebtTwo = VaultStateLib.calculateDebtStorage(pr[1], maturity, accountDebtTwo)\n           .neg().toUint().toUint80();\n    }\n\n    if (checkMinBorrow) {\n        // No overflow on negation due to overflow checks above\n        require(accountDebtOne == 0 || vaultConfig.minAccountSecondaryBorrow[0] <= -accountDebtOne, "min borrow");\n        require(accountDebtTwo == 0 || vaultConfig.minAccountSecondaryBorrow[1] <= -accountDebtTwo, "min borrow");\n    }\n\n    _setAccountMaturity(accountStorage, account\n```\n```\nstruct VaultAccountSecondaryDebtShareStorage {\n    uint40 maturity;\n    // This is stored separately from the vault account maturity to ensure that we have access to the proper state\n    // during a roll borrow position. It should never be allowed to deviate from the vaultAccount.maturity value (unless it is cleared to zero).\n    uint80 accountDebtOne;\n    uint80 accountDebtTwo;\n}\n```