
Beraborrow Managed Dens audit
A private security review of Beraborrow (CDP stablecoin), conducted with Sherlock and completed on 25th April 2025 over 6 days. 0xSimao disclosed 19 findings: 1 high severity, 8 medium and 10 low.
What Beraborrow is
Beraborrow is a CDP stablecoin on Berachain: NECT is minted against collateral held in dens, and managed leveraged vaults open, lever and unwind those positions on depositors' behalf, with withdrawals settling through epoch-based queues against what the vault actually holds.
Scope
The Sherlock review covered the blockend repository's managed-den machinery: deposit and withdrawal flows with their slippage controls, the epoch accounting that matches exiting depositors to unwound debt, leverage adjustments, and the ICR checks that keep a managed den solvent through partial exits.
High severity findings
Medium severity findings
ManagedLeveragedVault.sol::deposit()is missing slippage control- DoSed withdrawals due to
ManagedLeveragedVault::executeWithdrawalEpoch()repaying debt above limit ManagedLeveragedVault::executeWithdrawalEpoch()will never work becausecd.prevICRis not setManagedLeveragedVault::increaseLeverage()fails when the debt is closed to the limitManagedLeveragedVault::decreaseLeverage()will not work when it goes below the minimum debt- Protocol will need to donate minimum debt for all new ManagedLeveragedVaults
- Missing several
safeERC20functions ManagedLeveragedVault::executeWithdrawalEpoch()incorrect ICR and DoSed withdrawals due to not accouting for fees
Low severity findings
- Unused/useless code
- Hints on withdrawal may fail as the ICR changes between claiming collateral surplus and repaying debt
ManagedLeveragedVault::deposit()slippage control oncollVaultSharesis not intuitive- Incorrect
ERC4626ExceededMaxRedeemevent onManagedLeveragedVault.sol:: cancelWithdrawalIntent() ManagedLeveragedVault::increaseLeverage()will never work in Recovery modeManagedLeveragedVault::getAvailableDebt()used inManagedLeveragedVault::increaseLeverage()is incorrectManagedLeveragedVault::donateCollateral()is missing a slippage check- Some view functions will not work under certain conditions
ManagedLeveragedVault::getDebtToUnwindAndCollRequested()is inaccurate when there are surplus tokens- Most
ManagedLeveragedVaultfunctions are DoSed due to bad debt check
The report