# Liquidation can be DOSed due to lack of liquidity on collateral asset reserve

In a multi-asset lending pool, an attacker borrows out the collateral asset reserve so liquidators cannot seize collateral, blocking liquidation and causing bad debt.

- Payout: Audit contest
- Severity: high
- Program: New Scope
- Found by: A2-security
- Disclosed: 2024-06-27
- Write-up quality: 7/10
- Original: https://github.com/sherlock-audit/2024-06-new-scope-judging/issues/198
- Library page: https://bugbountylibrary.com/r/sherlock%3A2024-06-new-scope%3AH-3
- Tags: area:web3 domain:web3 impact:dos impact:funds-loss kind:contest platform:sherlock sev:high tech:evm tech:solidity technique:chained technique:source-review vuln:business-logic vuln:dos vuln:liquidation

**Target:** Multi-asset lending pool liquidation (zerolend-one / New Scope)
**Root cause:** Collateral deposits share the same reserve liquidity as borrowable funds; the protocol only supports disabling borrowing or freezing an entire reserve, not reserving a portion of liquidity for collateral seizure, so liquidation reverts when the collateral reserve is drained.
**Steps:**
1. Deploy pool with >=2 reserves, each accepting collateral and borrowing.
2. Alice supplies tokenA collateral and borrows tokenB; oracle drops so Alice is liquidatable.
3. Carl borrows out nearly all tokenA (the collateral asset reserve) via `pool.borrowSimple(address(tokenA), carl, borrowAmountB, 0)`.
4. Bob calls `pool.liquidateSimple(address(tokenA), address(tokenB), pos, 10 ether)`; it reverts due to insufficient tokenA liquidity.
5. Alice's debt remains unchanged; bad debt accrues as collateral value falls.
**How found:** Auditor reasoned about the multi-asset design: since collateral and borrowable liquidity share a reserve and only whole-reserve freeze/borrow-disable exists, draining the collateral reserve blocks seizure. Confirmed by modifying the liquidation forge test to add a borrower who drains tokenA.
**Exploitation:** Attacker (or any borrower) drains the collateral asset reserve by borrowing it out, so when a position becomes liquidatable the liquidator cannot receive the collateral asset and the call reverts. The attacker's own borrow is never liquidated because the same reserve is empty, so they keep borrowed funds worth more than their collateral while depositors absorb bad debt.
**Escalation:** Repeated/combined with falling collateral price to convert a temporary DoS into permanent bad debt exceeding 1% loss for lenders.
**Insight:** In forked Aave-style pools, check whether liquidators can seize aTokens/representative balances instead of underlying; if the fork removed that, draining the collateral reserve is a cheap way to block all liquidations of that asset.

## Proof of concept (copied exactly from the original report)

**Test that borrows collateral reserve to block liquidation**

```
function testLiquidationSimple2() external {
    _generateLiquidationCondition();
    (, uint256 totalDebtBase,,,,) = pool.getUserAccountData(alice, 0);

    vm.startPrank(carl);
    pool.borrowSimple(address(tokenA), carl, borrowAmountB, 0); // 100 tokenA carl borrow to deduct the reserves in which the collateral is deposited
    vm.stopPrank();

    vm.startPrank(bob);
    vm.expectRevert();
    pool.liquidateSimple(address(tokenA), address(tokenB), pos, 10 ether); // Bob tries to liquidate Alice but will revert

    vm.stopPrank();

    (, uint256 totalDebtBaseNew,,,,) = pool.getUserAccountData(alice, 0);

    // Ensure that no liquidation happened and Alice's debt remains the same
    assertEq(totalDebtBase, totalDebtBaseNew, "Debt should remain the same after failed liquidation");
```

