Liquid Staking

Stakelink
DeFiHardhatOracle
50,000 USDC
View results
Submission Details
Severity: medium
Invalid

splitRewards should include a non-reentrant mechanism to prevent fee receivers from receiving more rewards than they should

Summary

splitRewards should include a non-reentrant mechanism to prevent fee receivers from receiving more rewards than they should

Vulnerability Details

https://github.com/Cyfrin/2024-09-stakelink/blob/f5824f9ad67058b24a2c08494e51ddd7efdbb90b/contracts/core/lstRewardsSplitter/LSTRewardsSplitter.sol#L181

As LST is an ERC677 token, in the _splitRewards(uint256 _rewardsAmount) function, lst.safeTransfer(fee.receiver, amount) is called first, followed by updating principalDeposits = lst.balanceOf(address(this)). This sequence allows the fee receivers to potentially engage in reentrancy and receive additional rewards

Impact

fee receivers got wrongly rewards

Tools Used

Manual code review

Recommendations

Include a non-reentrant mechanism in splitRewards().

Updates

Lead Judging Commences

inallhonesty Lead Judge 12 months ago
Submission Judgement Published
Invalidated
Reason: Too generic

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.