Submitted by Tricko.
https://github.com/code-423n4/2023-04-rubicon/blob/511636d889742296a54392875a35e4c0c4727bb7/contracts/periphery/BathBuddy.sol#L121-L135 https://github.com/code-423n4/2023-04-rubicon/blob/511636d889742296a54392875a35e4c0c4727bb7/contracts/periphery/BathBuddy.sol#L139-L155
As described in the docs, Rubicon protocol allows users to act as as liquidity providers (LPs), by providing funds and receiving bathToken in return, which can be used to obtain rewards through BathBuddy contract.  But BathBuddy internal logic allows any user to DoS reward distribution to smalls LPs by constantly calling getReward at small intervals. This is specially effective against small LPs. This finding should be classified as having medium severity, even though no funds are at risk,  the attacker can affect the protocols functionality for an indefinite period of time.
BathBuddys user rewards are calculated as shown below:
Where rewardPerToken values are updated by calling the rewardPerToken function:
As we can see in the code snippet above, if the interval between calls to rewardPerToken are small, the resulting rewardsPerToken updates will also be small. Therefore, there is the possibility of the user earned values rounding down to zero, especially if the users  bathToken balance are small compared to bathToken totalSupply().
This enables a malicious actor to block reward distribution to smalls LPs by constantly calling  getReward, to keep refreshing the global lastUpdateTime; for example, at every new block (2s on Optimism).  As gas fees are low in L2 networks, the malicious actor can DoS at little cost, while affecting many small LPs .
The following test reproduces the above scenario, demonstrating that reward distribution to users with small bathToken balances can be completely and indefinitely blocked by repeatedly calling getReward:
daoio (Rubicon) acknowledged
HickupHH3 (judge) commented:
