Open code423n4 opened 1 year ago
JeffCX marked the issue as primary issue
LybraFinance marked the issue as sponsor disputed
This is not a problem. The daily dividend distribution is limited, so users who want to perform such an operation would need to stake a large amount of LBR, which can be costly.
0xean changed the severity to QA (Quality Assurance)
LybraFinance marked the issue as sponsor acknowledged
Lines of code
https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/ProtocolRewardsPool.sol#L168
Vulnerability details
Impact
ProtocolRewardsPool incentives is not time-weighted, but calculated instantaneously, which reduces the user's willingness to stake. Because instead of staking in advance and expecting the incentive at an unknown time, it is better to directly listen and frontrun the tx of notifyRewardAmount in mempool and steal most of the incentive through the instantaneous stake, which will lead to a large loss of staking users, and the searcher extracts MEV.
Proof of Concept
Here is a POC to show how arbitrager extract most of the incentives, resulting in the loss of interest for users who staking in advance. And there is another bug that needs to be fixed before POC can take effect:
With the instantaneous stake, the user stole 909 ether from the 1000 ether incentive.
Tools Used
Foundry
Recommended Mitigation Steps
Like other incentive pools, use time-weight to calculate user rewards
Assessed type
MEV