A critical race condition exists in GaugeController.sol gauge weight update mechanism that allows malicious actors to manipulate gauge weights. The vulnerability arises from lack of proper synchronization between gauge type weight updates and period updates.
The GaugeController contract has two key functions that can race with each other:
The vulnerability exists because:
No atomic lock between type weight updates and period initialization
Race condition possible between average calculation and new weight application
Lack of synchronization mechanism between type weight changes and period updates
This proof of concept demonstrates how an attacker can exploit a race condition in the GaugeController contract to manipulate gauge weights and unfairly increase rewards.
The attacker first calls updatePeriod(), which sets the gauge weight based on the current state.
Before the period update is finalized, the attacker front-runs a setTypeWeight() transaction, changing the gauge type’s weight.
The attacker then back-runs another updatePeriod() transaction, locking in the manipulated weight for the new period.
As a result, the final gauge weight is artificially increased, leading to higher rewards for the attacker at the expense of other participants.
The manipulated gauge weight results in inflated rewards for the attacker’s chosen gauge.
The protocol distributes more tokens to the attacker's gauge than intended.
Other participants receive less than their fair share of the rewards.
By exploiting this vulnerability, an attacker can continuously increase their share of protocol rewards, leading to economic imbalance within the system.
Manual Code Review: To identify logic flaws and race conditions in smart contracts.
Hardhat & Ethers.js: Used for writing and executing the Proof of Concept (PoC).
The vulnerability allows attackers to:
Manipulate gauge weights leading to unfair reward distribution
Extract excess rewards through weight manipulation
Disrupt the intended voting power mechanics
Potentially drain protocol rewards over time
Implement mutex locking:
Add synchronization for weight updates:
Add period update batching:
Impact: Critical - Direct economic damage through reward manipulation
Likelihood: Medium - Requires precise transaction timing but is automatable
Overall: Critical
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.