-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StakingRewardsV2
does not impose any restriction regarding esLBRBoost
unlock time
#838
Comments
JeffCX marked the issue as primary issue |
LybraFinance marked the issue as sponsor disputed |
That's how we designed it. |
@LybraFinance - your response seems different on this issue #773 |
Because the boost locking in this version is only restricted to the conversion from esLBR to LBR and does not affect the rewards claiming in StakingRewardsV2. So, this is not an unexpected issue. |
LybraFinance marked the issue as sponsor confirmed |
0xean marked the issue as duplicate of #773 |
0xean marked the issue as satisfactory |
Lines of code
https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/miner/stakerewardV2pool.sol#L101-L108
https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/miner/stakerewardV2pool.sol#L56-L66
https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/miner/stakerewardV2pool.sol#L110-L118
https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/miner/stakerewardV2pool.sol#L92-L99
https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/miner/ProtocolRewardsPool.sol#L87-L98
Vulnerability details
Impact
Users can claim rewards and withdraw their stake on
StakingRewardsV2
without any restriction, while having the incentives from the boost ofesLBRBoost
.Proof of Concept
Steps to reproduce:
esLBRBoost::setLockStatus()
StakingRewardsV2::stake()
StakingRewardsV2::getReward()
-> This will be calculated with the boostStakingRewardsV2::withdraw()
The result will be that the user will get the benefit from the boost while claiming rewards, despite not commiting to its unlock time, as there is no check on
StakingRewardsV2
to prevent it.esLBRBoost
provides a boost to rewards ongetBoost()
, which is used byearned()
, and the modifierupdateReward()
:stakerewardV2pool.sol#L101-L108
stakerewardV2pool.sol#L56-L66
getReward()
doesn't have any check to prevent the user from claiming rewards regarding the boost lock.withdraw()
doesn't have any related check either:stakerewardV2pool.sol#L110-L118
stakerewardV2pool.sol#L92-L99
For reference, this is how the current deployed version of
StakingRewardsV2
handles this for Lybra v1. It checks the unlock time via a requirementblock.timestamp >= esLBRBoost.getUnlockTime(msg.sender)
:https://etherscan.io/address/0xBAAA3053e773544561a119DB1F86985581D3fE7F?utm_source=immunefi#code#F1#L182
For reference,
ProtocolRewardsPool
on the current audit, handles it on theunstake()
function:ProtocolRewardsPool.sol#L87-L98
Tools Used
Manual review
Recommended Mitigation Steps
Depending on protocol decision, check the
esLBRBoost
unlock time inStakingRewardsV2
when trying to get rewards, or prevent them from withdrawing, forcing them to comply with their commitment.Assessed type
Invalid Validation
The text was updated successfully, but these errors were encountered: