31071 - [SC - Critical] User can steal bribes and prevent other users f...
Description
Brief/Intro
Vulnerability Details
// ...
contract Voter is IVoter {
// ...
function claimBribes(address[] memory _bribes, address[][] memory _tokens, uint256 _tokenId) external {
require(IVotingEscrow(veALCX).isApprovedOrOwner(msg.sender, _tokenId));
for (uint256 i = 0; i < _bribes.length; i++) {
IBribe(_bribes[i]).getRewardForOwner(_tokenId, _tokens[i]); // <==== Audit
}
}
function distribute() external {
uint256 start = 0;
uint256 finish = pools.length;
for (uint256 x = start; x < finish; x++) {
// We don't revert if gauge is not alive since pools.length is not reduced
if (isAlive[gauges[pools[x]]]) {
_distribute(gauges[pools[x]]); // <==== Audit
}
}
IMinter(minter).updatePeriod();
}
function _distribute(address _gauge) internal {
// Distribute once after epoch has ended
require(
block.timestamp >= IMinter(minter).activePeriod() + IMinter(minter).DURATION(),
"can only distribute after period end"
);
uint256 _claimable = claimable[_gauge];
// Reset claimable amount
claimable[_gauge] = 0;
_updateFor(_gauge);
if (_claimable > 0) {
IBaseGauge(_gauge).notifyRewardAmount(_claimable);
}
IBribe(bribes[_gauge]).resetVoting(); // <==== Audit
emit DistributeReward(msg.sender, _gauge, _claimable);
}
// ...
}Impact Details
References
Proof of Concept
Results
Previous31042 - [SC - High] Claiming alchemic-token rewards can fail for so...Next31076 - [SC - Critical] checkpointTotalSupply can checkpoint before a t...
Last updated
Was this helpful?