31196 - [SC - Critical] Voterpoke does not check lastVoted resulting in...
Submitted on May 14th 2024 at 19:38:20 UTC by @yttriumzz for Boost | Alchemix
Report ID: #31196
Report type: Smart Contract
Report severity: Critical
Target: https://github.com/alchemix-finance/alchemix-v2-dao/blob/main/src/Voter.sol
Impacts:
Direct theft of any user funds, whether at-rest or in-motion, other than unclaimed yield
Description
Brief/Intro
In AlchemixDAO, each $veToken can vote once per epoch, and users can receive $FLUX as a reward after voting. However, the Voter.poke interface allows users to easily repeat previous votes without check whether the $veToken has already voted in the current epoch. As a result, users can call the poke interface infinitely to receive $FLUX repeatedly.
Vulnerability Details
Please see the following code. The Voter.vote interface uses the onlyNewEpoch modifier to check whether $veToken has voted in the current epoch.
///// https://github.com/alchemix-finance/alchemix-v2-dao/blob/f1007439ad3a32e412468c4c42f62f676822dc1f/src/Voter.sol#L228-L233
function vote(
uint256 _tokenId,
address[] calldata _poolVote,
uint256[] calldata _weights,
uint256 _boost
) external onlyNewEpoch(_tokenId) {However, the Voter.poke interface, which also has the voting function, does not check lastVoted, causing users to call the interface repeatedly.
Suggested fix
Check the lastVoted of the token.
Impact Details
Users can infinitely copy $FLUX causing Alchemix token economics to collapse.
References
None
Proof of Concept
The PoC patch
Run the PoC
The log
Last updated
Was this helpful?