# Share price inflation via donation and rounding

Share math reading live balances or unverified calldata; protocol-favor rounding moving share price without a paid mint

_Area: DeFi accounting and math bugs. Seen in 3 disclosed reports; latest 2026-11-18. Updated 2026-11-28._

## How it works
Share price is assets divided by shares. That ratio is only trustworthy if every change to it comes from a paid mint or burn. The assumption that breaks: code treats the ratio as a pure function of deposits, but it also moves when (a) assets arrive without shares being minted (donation, or a swap that only checks the output token balance rose), (b) integer division rounds in the protocol's favor on both deposit and withdraw, or (c) a divisor like totalSupply or virtualSupply is allowed to shrink to ~1 unit, making the ratio hypersensitive to any tiny input. Once the ratio can be moved for free, the next depositor's shares are mispriced.

## Where it shows up
- Share/rate math reading `balanceOf(address(this))` or a live reserve instead of an accounted total.
- Swap or adapter paths that verify only the output-token delta (`minOut`) and never that the input collateral was consumed.
- Aggregator calldata with caller-chosen `executor`, `srcToken`, or recipient passed through unvalidated.
- `floor` on deposit and `ceil` on withdraw, or `ceil` on burn, with no minimum-liquidity lock.
- Rate = balance / virtualSupply with integer division; small swaps rounding output to zero.
- Premium or fee divided by `totalSupply()` (or `aToken.totalSupply()`) on a near-empty reserve.
- Batch or multi-step paths that cache a rate computed mid-sequence.

## How to review
State the invariant: assets-per-share changes only by an amount proportional to shares minted or burned in the same transaction. Check each path that writes balances or totalSupply against it. For swaps, require proof the declared input was spent (balance decrease, not just output increase) and that calldata cannot redirect the executor or source token. For rounding, confirm no sequence of deposit/withdraw (including across an interest-accrual boundary) leaves totalSupply at 1 while assets grow. For rate math, confirm the divisor cannot reach a value where one unit of input moves the index materially, and that cached rates are recomputed after each step. Confirm a minimum-liquidity lock or dead shares exist at initialization.

## How finders spotted it
- Traced `swap()` calldata into a fixed 1inch v6 adapter and saw `_execute` checked only the BOLD balance delta, not collateral consumption; knew 1inch v6 lets the caller pick the executor, so the attacker could deliver BOLD from their own funds via a substituted contract [E1](https://bugbountylibrary.com/r/dhl%3A20261118-sbold.md).
- Read `Market.sol` rounding directions line by line, noticed deposit floors and withdraw ceils, and that interest accrual lets the asymmetry repeat while totalSupply stays 1; then saw `withdraw(1)` on a 1-wei position passes the shortfall check but burns the whole share [E2](https://bugbountylibrary.com/r/sherlock%3A2024-04-interest-rate-model%3AH-1.md).
- Recognized the target as an Aave V3.0.x fork by the absence of `virtualUnderlyingBalance` in ReserveData, then saw `cumulateToLiquidityIndex` divides premium by `aToken.totalSupply()` — hypersensitive once the reserve is near-empty [E3](https://bugbountylibrary.com/r/dhl%3A20260317-dtrinitydlend.md).

## Variants seen
- Unverified aggregator calldata inflating share price, then skim via redeem [E1](https://bugbountylibrary.com/r/dhl%3A20261118-sbold.md).
- Protocol-favor rounding ping-ponged across interest accrual, plus withdraw rounding that zeroes a 1-wei position [E2](https://bugbountylibrary.com/r/sherlock%3A2024-04-interest-rate-model%3AH-1.md).
- Empty-reserve index inflation via flashloan premium divided by tiny totalSupply [E3](https://bugbountylibrary.com/r/dhl%3A20260317-dtrinitydlend.md).

## Impact and severity
Direct loss of vault or pool TVL: ~21,480 BOLD [E1](https://bugbountylibrary.com/r/dhl%3A20261118-sbold.md); full TVL drain after inflating share price, with a throwaway account borrowing all assets and abandoning the debt [E2](https://bugbountylibrary.com/r/sherlock%3A2024-04-interest-rate-model%3AH-1.md). In [E3](https://bugbountylibrary.com/r/dhl%3A20260317-dtrinitydlend.md), ~257K dUSD was borrowed against overvalued collateral (not directly lost). Impact rose when chained: flash loans and repeated cycles [E1](https://bugbountylibrary.com/r/dhl%3A20261118-sbold.md)[E3](https://bugbountylibrary.com/r/dhl%3A20260317-dtrinitydlend.md), debt abandonment via a throwaway account [E2](https://bugbountylibrary.com/r/sherlock%3A2024-04-interest-rate-model%3AH-1.md).

## Evidence
- E1: https://bugbountylibrary.com/r/dhl%3A20261118-sbold.md
- E2: https://bugbountylibrary.com/r/sherlock%3A2024-04-interest-rate-model%3AH-1.md
- E3: https://bugbountylibrary.com/r/dhl%3A20260317-dtrinitydlend.md
