31386 - [SC - Critical] Malicious user can steal FLUX token by abusing ...

Submitted on May 17th 2024 at 22:21:25 UTC by @jasonxiale for Boost | Alchemix

Report ID: #31386

Report type: Smart Contract

Report severity: Critical

Target: https://github.com/alchemix-finance/alchemix-v2-dao/blob/main/src/Voter.sol

Impacts:

  • Theft of unclaimed yield

Description

Brief/Intro

Malicious user can steal FLUX token by abusing Voter.poke

Vulnerability Details

In Voter.poke funciton, there is not limitation how many time it can be called within one epoch, and at the end of the function, Voter._vote is called.

195     function poke(uint256 _tokenId) public {
	...
211         _vote(_tokenId, _poolVote, _weights, _boost);
212     }

In Voter._vote, IFluxToken(FLUX).accrueFlux(_tokenId); is calle to accrue Flux token in Voter.sol#L423

And in FluxToken.accrueFlux, the function will check the amount of claimable flux and than update FluxToken.unclaimedFlux

VotingEscrow.claimableFlux is defined as:

As we can see above, claimableFlux only calcuate the tokenId's voting power, it doesn't record if the Flux has been claimed already. So if a malicious user keep calling Voter.poke, his tokenId's unclaimedFlux will keeping increasing.

Impact Details

Malicious user can steal FLUX token by abusing Voter.poke

References

Add any relevant links to documentation or code

Proof of Concept

Put the following code in src/test/Voting.t.sol and run

As we can see from the above output, every time Alice calls Voter.poke, her unclaimed Flux will increase.

Last updated

Was this helpful?