30825 - [SC - Critical] Users can get unlimited amounts of Flux tokens
Submitted on May 6th 2024 at 21:36:36 UTC by @imsrybr0 for Boost | Alchemix
Report ID: #30825
Report type: Smart Contract
Report severity: Critical
Target: https://github.com/alchemix-finance/alchemix-v2-dao/blob/main/src/FluxToken.sol
Impacts:
Manipulation of governance voting result deviating from voted outcome and resulting in a direct change from intended effect of original results
Description
Brief/Intro
Users can get unlimited amounts of Flux tokens.
Vulnerability Details
The
VotingEscrow@merge
function only checks if the token being merged votedyes
. It also merges the unclaimed Flux earnings of the merge tokens.The
Voter@reset
function :Doesn't check if the given token id has any votes to reset before doing so.
Votes
no
on theVotingEscrow
Accrues Flux earning for the given token id
Under those conditions, a user can :
Start by locking an amount of tokens in
VotingEscrow
and getToken ID N
in returnCall
Voter@reset
forToken ID N
to accrue Flux earning for that token.Lock a dust amount of tokens in
VotingEscrow
and getToken ID M
in returnCall
VotingEscrow@merge
to mergeToken ID N
intoToken ID M
which will add the first token unclaimed Flux earning to the second one.
Steps 2), 3) and 4) can be repeated as needed carrying over unclaimed Flux earnings from the previous token to the next one and accruing them again.
Impact Details
Artificially boost voting power for gauges voting.
Claim Flux ERC20 tokens to :
Sell them
Use them to ragequit for free
References
https://github.com/alchemix-finance/alchemix-v2-dao/blob/main/src/VotingEscrow.sol#L618-L651
https://github.com/alchemix-finance/alchemix-v2-dao/blob/main/src/Voter.sol#L183-L192
https://github.com/alchemix-finance/alchemix-v2-dao/blob/main/src/FluxToken.sol#L180-L185
Proof of Concept
Results
Last updated