28988 - [SC - High] Mechanism for distributing extra reward tokens ...
Submitted on Mar 4th 2024 at 04:07:39 UTC by @MahdiKarimi for Boost | ZeroLend
Report ID: #28988
Report type: Smart Contract
Report severity: High
Target: https://github.com/zerolend/governance
Impacts:
Theft of unclaimed yield
Description
Brief/Intro
PoolVoter mechanism for distributing additional reward tokens is vulnerable and allows an attacker transfer all additional reward tokens to a desirable gauge in favor of himself.
Vulnerability Details
PoolVoter has 2 diffrent mechanism for distributing rewards, first is simple distribution which is intended to distribute main reward token, also there is a mechanism to distribute additional rewards other than main reward token through distributeEx
function, in this implementation additional reward token balance of PoolVoter has been distributed to different gauges proportion to each gauge weight and totalWeight, distributeEx
enables users to choose which pools to distribute rewards by start and end parameters, this creates a situation which enables malicious user to distribute rewards to one gauge in favor of himself and call this function again to distribute remaining balance again, and repeat this process to transfer almost all reward tokens to a specific gauge. It is recommended to ensure distributeEx
iterates through all pools and transfers additional rewards at once.
Impact Details
It enables a malicious user to transfer all additional reward tokens to one specific gauge in favor of himself, this is considered a theft of unclaimed yield.
References
https://github.com/zerolend/governance/blob/a30d8bb825306dfae1ec5a5a47658df57fd1189b/contracts/voter/PoolVoter.sol#L214-L234
Proof of Concept
Last updated