Closed sherlock-admin2 closed 5 months ago
1 comment(s) were left on this issue during the judging contest.
takarez commented:
invalid because { This is invalid as that is the intended behavior of it to allow the SUPPORT_ROLE to call the function}
grearlake
medium
SUPPORT_ROLE
can steal TELCOIN by callingrecoverERC20FromStaking()
functionSummary
SUPPORT_ROLE
can steal all token by callingrecoverERC20FromStaking
function due to no restriction to call itVulnerability Detail
Function
recoverERC20FromStaking()
is used to recover erc20 token from contract:But there is no restriction for this function to withdraw token from
StakingRewards
contract. MaliciousSUPPORT_ROLE
can use this function to drain all TELCOIN.Impact
Malicious
SUPPORT_ROLE
can use this function to drain all token in theStakingRewards
contract.Code Snippet
https://github.com/sherlock-audit/2024-01-telcoin/blob/main/telcoin-audit/contracts/telx/core/StakingRewardsManager.sol#L216-#L224
Tool used
Manual Review
Recommendation
This function should be controlled by owner
Duplicate of #205