Submitted by hyh, also found by 0x1f8b
If Bribe and Gauge constructors are run not in the same transaction, the griefing attack is possible. A malicious user can run setGauge after Bribe, but before Gauge constructor, making Bribe contract unusable. The fix here is Bribe redeployment.
Setting severity to be medium as that is temporary system breaking impact.
setGauge can be run by anyone, but only once with a meaningful gauge:
Bribe.sol#L30-L33
Now it is called in Gauge constructor:
Gauge.sol#L96-L104
This way it will not be called before Gauge constructor, but if it is not atomic with Bribe constructor, an attacker can call in-between.
Consider either running Bribe and then Gauge constructors atomically, or introducing an owner role in Bribe constructor and onlyOwner access control in setGauge, setting it manually.
pooltypes (Velodrome) confirmed and commented:
Alex the Entreprenerd (judge) commented:
