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.
195functionpoke(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
377functionclaimableFlux(uint256_tokenId) publicviewreturns (uint256) {378// If the lock is expired, no flux is claimable at the current epoch379if (block.timestamp > locked[_tokenId].end) {380return0;381 }382383// Amount of flux claimable is <fluxPerVeALCX> percent of the balance 384return (_balanceOfTokenAt(_tokenId, block.timestamp) * fluxPerVeALCX) / BPS;385 }
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