The GaugeController contract allows users to vote for gauges that are marked as inactive (isActive = false). This enables potential manipulation of gauge weights for inactive gauges, which can distort reward distribution if the gauge is later reactivated.
Affected Code:
Explanation:
The vote() function does not check whether the target gauge is active (isActive = true). Users can vote for inactive gauges, and their voting power will still update the gauge’s stored weight in the gauges[gauge].weight state variable. While inactive gauges are excluded from reward calculations (via getTotalWeight(), which skips inactive gauges), their stored weight persists. If an admin later reactivates the gauge, its accumulated weight (from votes during inactivity) will immediately influence reward distribution, creating an unfair advantage.
Severity: Medium
Rationale:
An attacker could exploit this to:
Vote heavily for an inactive gauge (e.g., a deprecated gauge they control).
Convince/compromise an admin to reactivate the gauge.
Instantly gain disproportionately high rewards due to the pre-accumulated weight.
This violates the intended system invariant: "Only active gauges should influence rewards."
Manual code review
Slither (to detect missing access controls/state checks)
Add Activity Check in vote():
Modify the vote() function to revert if the gauge is inactive:
Reset Weight on Deactivation:
When a gauge is deactivated (toggleGaugeStatus), reset its weight to zero to prevent legacy votes from affecting future calculations:
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.