In case Stake token and reward token are the same on MlumStaking, the contract will pay out staked tokens as rewards
Summary
In case the admin sets stake token and reward token to be the same in MlumStaking, the contract will pay out the staked tokens of other users as rewards.
Vulnerability Detail
The MlumStaking contract uses balanceOf to determine the amount of rewards in the contract:
Icy Basil Seal
Low/Info
In case Stake token and reward token are the same on MlumStaking, the contract will pay out staked tokens as rewards
Summary
In case the admin sets stake token and reward token to be the same in MlumStaking, the contract will pay out the staked tokens of other users as rewards.
Vulnerability Detail
The MlumStaking contract uses balanceOf to determine the amount of rewards in the contract:
In case the reward token is the staked token, the contract will treat the staked as the reward and pay these out.
Impact
Other users tokens are used as rewards in case someone withdraws
Code Snippet
https://github.com/sherlock-audit/2024-06-magicsea/blob/main/magicsea-staking/src/MlumStaking.sol#L82-L97
Tool used
Manual Review
Recommendation
Check in constructor that stake token != reward token.