Submitted by unforgiven, also found by 0x52 and Picodes
Bribe.sol#L41-L60
Gauge.sol#L590-L624
Its possible to call notifyRewardAmount() in Bribe or Gauge contract with malicious tokens and contract will add them to reward tokens list and then attacker can interrupt Gauge.deliverBribes() logic (by failing all contract transaction in that malicious token). because Gauge.deliverBribes() is looping through all tokens and transferring rewards and if one of them fails whole transaction will fail.
As Gauge.deliverBribes() is called by Voter.distribute() and Voter.distribute() is called by Gauge.getReward() so functions: Voter.distribute() and Gauge.getReward() will be broke too and no one can call them for that Gauge.
This is notifyRewardAmount() code in Bribe:
As you can see its callable by anyone and it will add the new tokens to rewards list in Bribe and Gauge contract. notifyRewardAmount() in Gauge is similar to Bribes notifyRewardAmount().
This is deliverBribes() code in Gauge:
As you can see it loops through all rewards token list and calls Bribe.deliverReward() which then transfers the reward token. but if one of the tokens were malicious and revert the transaction then the whole transaction will fail and deliverBribes() logic will be blocked.
This is distribute() code in Voter:
As you can see it calls Gauge.deliverBribes(). and this is getReward() code in Gauge:
which calls Voter.distribute(). so if Gauge.deliverBribes() fails then the logic of Voter.distribute() and Gauge.getReward() will fail too and users couldnt call them and attacker can cause DOS.
Of course the team can swap those malicious reward tokens added by attacker with swapOutRewardToken() and swapOutBribeRewardToken() but for some time those logics will not work and attacker can cause DOS.
VIM
Set access levels for notifyRewardAmount() functions.
pooltypes (Velodrome) acknowledged
Alex the Entreprenerd (judge) commented:
