This repository has been archived by the owner on Jun 2, 2024. It is now read-only.
bughuntoor - Users can front-run calls to change_gauge_weight
in order to acquire more weight for their gauge
#16
Labels
Non-Reward
This issue will not receive a payout
bughuntoor
medium
Users can front-run calls to
change_gauge_weight
in order to acquire more weight for their gaugeSummary
Users can gain extra weight for their gauge by front-running
change_gauge_weight
Vulnerability Detail
It can be expected that in some cases calls will be made to change_gauge_weight to increase or decrease a gauge's weight. The problem is users can be monitoring the mempool expecting such calls. Upon seeing such, any people who have voted for said gauge can just remove their vote prior to change_gauge_weight. Once it executes, they can vote again for their gauge, increasing its weight more than it was expected to be:
Example:
Gauge weight was supposed to be changed from 10_000 to 15_000, but due to the user front-running, gauge weight is now 25_000
Impact
Accruing extra voting power
Code Snippet
https://github.com/sherlock-audit/2023-11-convergence/blob/main/sherlock-cvg/contracts/Locking/GaugeController.vy#L569
Tool used
Manual Review
Recommendation
Instead of having a set function, use increase/ decrease methods.
Duplicate of #122
The text was updated successfully, but these errors were encountered: