Submitted by hansfriese
https://github.com/code-423n4/2022-05-backd/tree/main/protocol/contracts/StakerVault.sol#L95
https://github.com/code-423n4/2022-05-backd/tree/main/protocol/contracts/tokenomics/LpGauge.sol#L52-L63
Strategy in StakerVault.sol can steal more rewards even though its designed strategies shouldnt get rewards.
Also there will be a problem with a rewarding system in LpGauge.sol so that some normal users wouldnt get rewards properly.
Solidity Visual Developer of VSCode
I think there will be two methods to fix.
Method 1 is to forbid a transfer between strategy and non-strategy so that strategy cant move funds to non-strategy.
Method 2 is to update StakerVault.strategiesTotalStaked and StakerVault._poolTotalStaked correctly so that strategy wont claim more rewards than he should even though he claims rewards using non-strategy.
Method 1.
You need to modify two functions. StakerVault.transfer(), StakerVault.transferFrom().
Method 2.
Ive explained about this method in my medium risk report StakerVault.unstake(), StakerVault.unstakeFor() would revert with a uint underflow error of StakerVault.strategiesTotalStaked, StakerVault._poolTotalStaked
I will copy the same code for your convenience.
You need to modify 3 functions. StakerVault.addStrategy(), StakerVault.transfer(), StakerVault.transferFrom().
chase-manning (Backd) confirmed, but disagreed with severity and commented:
Alex the Entreprenerd (judge) decreased severity to Medium and commented:
