Closed code423n4 closed 1 year ago
Seems to be out of scope. Will decide after the sponsor's review.
hansfriese marked the issue as satisfactory
hansfriese marked the issue as primary issue
Out of scope, we assume competent admins.
TimTinkers marked the issue as sponsor disputed
hansfriese marked the issue as unsatisfactory: Out of scope
Lines of code
https://github.com/code-423n4/2023-03-neotokyo/blob/main/contracts/staking/NeoTokyoStaker.sol#L1708
Vulnerability details
configureLP function should check LP stakers existence before changing LP address.
Permitted users are allowed to change LP address when lpLocked is false. So this does not follow the comments above.
Proof of concept
https://github.com/code-423n4/2023-03-neotokyo/blob/main/contracts/staking/NeoTokyoStaker.sol#L1702
https://github.com/code-423n4/2023-03-neotokyo/blob/main/contracts/staking/NeoTokyoStaker.sol#L1708
It's better to check whether there are LP stakers or not before changing its address.
Tools Used
Recommended Mitigation Steps
Check the LP tokens totalPoints and if it is not 0 then revert the configureLP function. Consider adding this if check to configureLP function.