<!-- canonical: https://0xsimao.com/findings/beraborrow-i-leverage-work-recovery-mode -->

# `ManagedLeveragedVault::increaseLeverage()` will never work in Recovery mode

Low/Info · Sherlock · CDP stablecoin · 25th April, 2025

Finding L-4 of the Beraborrow Managed Dens security review.

- Protocol: https://www.beraborrow.com/
- Report: /reports/beraborrow-i
- Source: https://1570492309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FffzDCMBDa391vIMqruBP%2Fuploads%2FUKDtjc6Dkn6P6i35j5H1%2FManaged%20Leverage%20Vaults%20v0%20private%20audit%20Sherlock.pdf?alt=media&token=c7304efa-8040-4ed0-9a98-dc949af28a85

---

## Summary

Recovery mode doesn't allow Dens to decrease their ICR. Hence, `ManagedLeveragedVault::increaseLeverage()` will revert when the protocol is in Recovery mode.

## Vulnerability Detail

`ManagedLeveragedVault::increaseLeverage()` withdraws debt:
```solidity
b$.borrowerOperations.withdrawDebt(
    b$.denManager,
    address(this),
    _maxFeePercentage,
    _debtAmount,
    _upperHint,
    _lowerHint
);
```
But this is not possible in Recovery mode, as it requires that the new ICR is bigger than the old one.

## Impact

DoSed increasing leverage.

## Code Snippet

https://github.com/sherlock-audit/2025-04-beraborrow-vault-update/pull/1/files#diff-2d972f52027e0ba1065b2de2b424416244bfef9e2a79d2604e1687867f72c91eR431-R438

## Tool Used

Manual Review

## Recommendation

Nothing can be really done but it's something to keep in mind.

---

Related findings:

- [`PreDepositVault::sweep()` uses `address.transfer` which does not work for certain wallets](https://0xsimao.com/findings/gaib-deposit-sweep-transfer-wallets): GAIB Pre-Vaults
- [`PreDepositVault` will not work for USDT](https://0xsimao.com/findings/gaib-pre-deposit-work-usdt): GAIB Pre-Vaults
- [Destination Vault rewards are not added to idleIncrease when info.totalAssetsPulled > info.totalAssetsToPull](https://0xsimao.com/findings/tokemak-rewards-info-pulled-pull): Tokemak
