The LSTRewardsSplitter contract lacks adequate access control, allowing unauthorized users to invoke critical functions such as performUpkeep, splitRewards, and indirectly _splitRewards. This vulnerability can lead to unauthorized manipulation of reward distributions.
During testing, it was observed that unauthorized accounts were able to call the performUpkeep and splitRewards functions without proper access restrictions. This lack of access control permits any user to initiate reward splitting processes, potentially leading to unauthorized rewards being distributed to unintended recipients.
Please paste this test to lst-rewards-splitter.test.ts
PoC
Unauthorized Signer: I added signers[2] as an unauthorized signer who is trying to access the critical functions.
performUpkeep: The unauthorized signer tries to call the performUpkeep function, but it should revert with a SenderNotAuthorized() error.
splitRewards: Similarly, the unauthorized signer attempts to call splitRewards directly on the splitter, but it should also revert with the appropriate error.
Final Assertions: After attempting unauthorized access, we check that no rewards were transferred to the accounts.
But in the end it does not revert.
This vulnerability poses a significant risk to the integrity of the reward distribution mechanism. Unauthorized users could exploit this flaw to siphon rewards intended for legitimate recipients, resulting in financial losses and undermining trust in the system. If exploited, this could lead to severe reputational damage and loss of user confidence.
Manual review
Implement robust access control mechanisms to ensure that only authorized users can invoke critical functions like performUpkeep and splitRewards.
https://github.com/Cyfrin/2024-09-stakelink/blob/f5824f9ad67058b24a2c08494e51ddd7efdbb90b/contracts/core/lstRewardsSplitter/LSTRewardsSplitter.sol#L101
https://github.com/Cyfrin/2024-09-stakelink/blob/f5824f9ad67058b24a2c08494e51ddd7efdbb90b/contracts/core/lstRewardsSplitter/LSTRewardsSplitter.sol#L116
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.