# Perennial account users with rebalance group may suffer a donation attack

Donation of 1e-6 DSU to an empty rebalance group triggers infinite rebalance cycles, draining victim's Perennial account via keeper fees.

- Payout: Audit contest
- Severity: high
- Program: Perennial
- Found by: Oblivionis
- Disclosed: 2024-08-17
- Write-up quality: 8/10
- Original: https://github.com/sherlock-audit/2024-08-perennial-v2-update-3-judging/issues/84
- Library page: https://bugbountylibrary.com/r/sherlock%3A2024-08-perennial-v2-update-3%3AH-7
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:sherlock sev:high tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:business-logic vuln:precision-loss

**Target:** Perennial Account Controller rebalance group logic
**Root cause:** checkMarket compares only proportional deviation, not absolute value; with groupCollateral at Fixed6 precision (1e-6), targetCollateral rounds to 0, making any nonzero market collateral appear 100% off-target and rebalanceable indefinitely.
**Steps:**
1. Victim has active rebalance group with all markets at 0 collateral and funds in Perennial account.
2. Attacker donates `1e-6` DSU collateral to one market in the group via signed deposit order (allowed by InvariantLib since no position change).
3. Attacker calls `Controller_Incentivized.rebalanceGroup(owner, group)`; checkMarket returns canRebalance=true because targetCollateral rounds to 0 and pctFromTarget=1.
4. Rebalance transfers the 1e-6 back to the account, restoring empty state; repeat steps 2-3 to drain account via repeated keeper-fee-bearing rebalances.
**How found:** Reasoned about Fixed6 precision: observed that targetCollateral = groupCollateral * target rounds to 0 when groupCollateral is at minimum precision, making pctFromTarget always 1 and rebalance always permitted; combined with the invariant that anyone can donate collateral without position change.
**Exploitation:** Attacker repeatedly donates minimal collateral and triggers rebalanceGroup, each cycle paying keeper incentive from victim's account balance until DSU/USDC drained.
**Insight:** When a check compares ratios of fixed-point values, test the minimum representable unit: rounding target to zero makes any nonzero actual appear infinitely off-target, enabling repeated no-op rebalances that extract keeper fees.

