# If a withdrawal executes after a bad debt auction gets created, it could cause the auction to be stuck and further bad debt auctions can’t be created

Backstop withdrawal after a bad debt auction is created leaves insufficient lot tokens, making the auction unfillable and blocking all future bad debt auctions.

- Payout: Contest reward
- Severity: medium
- Program: Blend
- Credited: rscodes
- Disclosed: 2025-08-13
- Write-up quality: 7/10
- Original: https://code4rena.com/reports/2025-02-blend-v2-audit-certora-formal-verification#m-03
- Library page: https://bugbountylibrary.com/r/c4%3A2025-02-blend-v2-audit-certora-formal-verification%3AM-03
- Tags: domain:web3 impact:dos kind:contest platform:code4rena sev:medium tech:solidity technique:race-window technique:source-review vuln:business-logic vuln:dos

**Target:** Soroban pool bad debt auction / backstop contract
**Root cause:** create_bad_debt_auction_data caps lot_amount to backstop balance at creation time, but backstop::withdraw can later reduce the balance below the auction's lot; fill_bad_debt_auction panics on insufficient tokens and there is no cancel path for bad debt auctions.
**Steps:**
1. Backstop holds 50,000e7; attacker calls `backstop_client.queue_withdrawal(samwise, pool, 9_000_0000000)` starting the 1-week lock.
2. After lock, a bad debt auction is created with lot=42,000e7 (min cap passes since balance is still 50,000e7).
3. At optimal fill block B, attacker frontruns with `backstop_client.withdraw(samwise, pool, 9_000_0000000)`, dropping balance to 41,000e7.
4. Victim's `fill_bad_debt_auction` panics on insufficient lot tokens; lot amount only increases over time so it can never be filled.
5. Existing auction blocks `create_bad_debt_auction_data`, so no new bad debt auctions can be created.
**How found:** Reasoned from three observations: lot amount is monotonically non-decreasing, bad debt auctions have no removal path and block new ones, and the min() cap only checks balance at creation time — so a later balance drop breaks the invariant.
**Exploitation:** Attacker queues a backstop withdrawal, waits for a bad debt auction to be created, then frontruns the fill transaction with the withdrawal to shrink the backstop below the auction's lot, permanently bricking the auction and the bad debt socialization mechanism.
**Insight:** When a creation-time cap (min with current balance) protects a later fill, check whether the capped resource can be drained between creation and fill; auctions without a cancel path turn a transient shortfall into a permanent DoS.
