Submitted by xiaoming90
The Gauge.notifyRewardAmount notifies the contract of a newly received rewards. This updates the local accounting and streams the reward over a preset period (Five days).
It was observed that this function is callable by anyone regardless of whether the previous reward period has already expired or not. Thus, it would be possible to exploit the system by repeatedly calling it with dust reward amount to extend an active reward period, and thus dragging out the duration over which the rewards are released.
Since Velodrome is to be deployed on Layer 2 blockchain where the gas fee tends to be cheap, the effort required to carry out this attack would be minimal.
This issue was also highlighted in Curve documentation under the ChildChainStreamer.notify_reward_amount(token: address): section.
Gauge.sol#L590
Consider implementing validation to ensure that this function is callable by anyone only if the previous reward period has already expired. Otherwise, when there is an active reward period, it may only be called by the designated reward distributor account.
For sample implementation, see here.
pooltypes (Velodrome) acknowledged
Alex the Entreprenerd (judge) commented:
