In the BoostController contract A critical accounting mismatch exists between delegated boosts and pool statistics, allowing delegated boosts to bypass proper tracking in pool totals. This leads to incorrect boost calculations and potential manipulation of protocol metrics.
The vulnerability stems from two key flaws in the delegation logic:
Incomplete Boost Accounting in delegateBoost:
When users delegate boosts via delegateBoost(), the delegated amount is stored in userBoosts but not added to the pool's totalBoost (in poolBoosts[pool]). This creates a discrepancy between the actual delegated boost and the pool's recorded boost total.
Unsafe Subtraction in removeBoostDelegation:
The function attempts to reduce the pool's totalBoost by the delegated amount without ensuring it was previously added. Since delegated boosts are never reflected in totalBoost, this operation will often underflow (when totalBoost < delegation.amount) or leave stale data (when totalBoost == 0).
Attack Scenario:
Alice delegates 1000 boost to Pool X via delegateBoost().
userBoosts[Alice][X].amount = 1000
poolBoosts[X].totalBoost remains unchanged (e.g., 0).
After the delegation expires, Pool X calls removeBoostDelegation(Alice).
The contract tries to subtract 1000 from poolBoosts[X].totalBoost (which is 0), triggering an underflow revert (if using SafeMath) or leaving totalBoost incorrect.
Inaccurate Boost Tracking: Pools display inflated/deflated boost totals, undermining reward distribution fairness.
Protocol Manipulation: Attackers could spam delegations/removals to corrupt pool metrics, destabilizing the system.
Denial-of-Service: Underflow reverts in removeBoostDelegation() could permanently lock delegated boosts.
Severity: Medium (breaks core accounting guarantees, but requires specific user actions to exploit).
Manual code review focusing on state variable interactions.
Control flow analysis for delegation/removal logic.
Sync Delegated Boosts with Pool Totals:
Modify delegateBoost() to increment poolBoosts[to].totalBoost:
Remove Conditional Check in Removal:
Update removeBoostDelegation() to unconditionally decrease totalBoost:
Add Validation in delegateBoost:
Ensure delegations only target supported pools:
Testing:
Add unit tests validating that:
totalBoost increases/decreases correctly during delegation/removal.
Delegations to unsupported pools revert.
By aligning delegation actions with pool accounting, the protocol will maintain accurate boost tracking and prevent exploitation.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.