# Flash-loan share inflation via manipulable pricing

Mint/redeem price from reserves, index, or oracle that a flash loan can move or zero out

_Area: DeFi oracles, liquidations and flash loans. Seen in 2 disclosed reports; latest 2026-04-25. Updated 2026-10-31._

## How it works
Share or collateral value is computed from a quantity an attacker can move within one transaction: a liquidity index, a reserve balance, or an oracle path. The code assumes that quantity reflects real, stable value. A flash loan breaks that assumption by supplying temporary capital to push the quantity up (or make it read zero) before minting or borrowing, then unwinding after redeeming. The invariant that fails: shares minted must cost at least the value they can redeem, and collateral value must not depend on state the borrower controls in the same tx.

## Where it shows up
- ERC4626 `totalAssets()` or share price derived from pool balances, an index, or an oracle that can be donated to or drained.
- Aave-v3-style liquidity index that accrues fees/donations while scaled supply is near zero [E1](https://bugbountylibrary.com/r/dhl%3A20250721-bojleveragemarket.md).
- Oracle config pointing at a nonexistent fee tier or zero-liquidity fallback pool, silently returning zero [E2](https://bugbountylibrary.com/r/dhl%3A20260425-singularitydynavault.md).
- Token transfer/accounting that mishandles self-transfers or repeated transfers, inflating balances [E3](https://bugbountylibrary.com/r/dhl%3A20241210-labubu.md).
- First-depositor or near-empty pool states where a small donation dominates the index.

## How to review
- Trace every price input to its source; confirm it cannot be changed by the caller within the same transaction, or is bounded by a manipulation-resistant oracle (TWAP with sufficient liquidity).
- For each oracle path, verify the pool/fee-tier actually exists and has liquidity; check what the code returns on failure (zero vs revert) [E2](https://bugbountylibrary.com/r/dhl%3A20260425-singularitydynavault.md).
- Check index/donation accrual when scaled supply is dust: does a donation or fee loop move collateral value materially? [E1](https://bugbountylibrary.com/r/dhl%3A20250721-bojleveragemarket.md).
- Confirm mint/redeem and borrow use the same price source and that rounding favors the protocol.
- Property: cost to mint N shares >= value redeemable for N shares, for all reachable states including post-flash-loan.

## Variants seen
- Fee/donation-driven index inflation with dust scaled supply [E1](https://bugbountylibrary.com/r/dhl%3A20250721-bojleveragemarket.md).
- Misconfigured oracle returning zero, undercounting reserves [E2](https://bugbountylibrary.com/r/dhl%3A20260425-singularitydynavault.md).
- Transfer-logic balance inflation via repeated self-transfers [E3](https://bugbountylibrary.com/r/dhl%3A20241210-labubu.md).

## Impact and severity
Led to borrowing against inflated collateral [E1](https://bugbountylibrary.com/r/dhl%3A20250721-bojleveragemarket.md), draining 413K USDC from a vault [E2](https://bugbountylibrary.com/r/dhl%3A20260425-singularitydynavault.md), and netting 17.4 BNB [E3](https://bugbountylibrary.com/r/dhl%3A20241210-labubu.md). Severe: direct fund loss. Worse when pools are near-empty, oracle failures are silent, and no per-tx price-deviation checks exist.

## Evidence
- E1: https://bugbountylibrary.com/r/dhl%3A20250721-bojleveragemarket.md
- E2: https://bugbountylibrary.com/r/dhl%3A20260425-singularitydynavault.md
- E3: https://bugbountylibrary.com/r/dhl%3A20241210-labubu.md
