StakingRewards.recoverERC20 allows owner to rug the rewardsToken
#69
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Lines of code
https://github.com/code-423n4/2022-02-concur/blob/main/contracts/StakingRewards.sol#L166
Vulnerability details
Impact
StakingRewards.recoverERC20
rightfully checks against thestakingToken
being sweeped away.However there's no check against the
rewardsToken
which over time will sit in this contract.This is the case of an admin privilege, which allows the owner to sweep the rewards tokens, perhaps as a way to rug depositors
Proof of Concept
calling
StakingRewards.recoverERC20(rewardsToken, rewardsToken.balanceOf(this))
enables theowner
to sweep the tokenRecommended Mitigation Steps
Add an additional check
The text was updated successfully, but these errors were encountered: