30990 - [SC - Critical] Users can use Voterpoke to accrue Flux tokens i...
Submitted on May 10th 2024 at 05:45:32 UTC by @imsrybr0 for Boost | Alchemix
Report ID: #30990
Report type: Smart Contract
Report severity: Critical
Target: https://github.com/alchemix-finance/alchemix-v2-dao/blob/main/src/Voter.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 use Voter@poke to accrue Flux tokens indefinitely.
Vulnerability Details
// ...
contract Voter is IVoter {
// ...
function poke(uint256 _tokenId) public {
// Previous boost will be taken into account with weights being pulled from the votes mapping
uint256 _boost = 0;
if (msg.sender != admin) {
require(IVotingEscrow(veALCX).isApprovedOrOwner(msg.sender, _tokenId), "not approved or owner");
}
address[] memory _poolVote = poolVote[_tokenId];
uint256 _poolCnt = _poolVote.length;
uint256[] memory _weights = new uint256[](_poolCnt);
for (uint256 i = 0; i < _poolCnt; i++) {
_weights[i] = votes[_tokenId][_poolVote[i]];
}
_vote(_tokenId, _poolVote, _weights, _boost); // <=== audit
}
function _vote(uint256 _tokenId, address[] memory _poolVote, uint256[] memory _weights, uint256 _boost) internal {
// ...
IFluxToken(FLUX).accrueFlux(_tokenId); // <=== audit
// ...
}
// ...
}Since Voter@poke does not check if the given token id already voted in the current epoch, it can be repeatedly called by a user to accrue Flux tokens indefinitely.
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/Voter.sol#L195-L212
https://github.com/alchemix-finance/alchemix-v2-dao/blob/main/src/Voter.sol#L423
https://github.com/alchemix-finance/alchemix-v2-dao/blob/main/src/FluxToken.sol#L188-L192
Proof of Concept
Results
Last updated
Was this helpful?