In _sendTokenToBribesProcessor(), it sends tokens to bribesProcessor. It seems to be ok because claimBribesFromHiddenHand() will confirm that bribesProcessor is not address(0). sweepRewardToken() also triggers _sendTokenToBribesProcessor(). But it doesn’t check bribesProcessor’s address. Which could cause permanent loss of reward tokens if bribesProcessor hasn't been set.
Lines of code
https://github.com/Badger-Finance/vested-aura/blob/v0.0.2/contracts/MyStrategy.sol#L421-L425 https://github.com/Badger-Finance/vested-aura/blob/v0.0.2/contracts/MyStrategy.sol#L107-L113 https://github.com/Badger-Finance/vested-aura/blob/v0.0.2/contracts/MyStrategy.sol#L411 https://github.com/Badger-Finance/vested-aura/blob/v0.0.2/contracts/MyStrategy.sol#L290
Vulnerability details
Impact
In
_sendTokenToBribesProcessor()
, it sends tokens tobribesProcessor
. It seems to be ok becauseclaimBribesFromHiddenHand()
will confirm thatbribesProcessor
is notaddress(0)
.sweepRewardToken()
also triggers_sendTokenToBribesProcessor()
. But it doesn’t checkbribesProcessor
’s address. Which could cause permanent loss of reward tokens ifbribesProcessor
hasn't been set.Proof of Concept
In
_sendTokenToBribesProcessor()
, it sends tokens tobribesProcessor
without any check. https://github.com/Badger-Finance/vested-aura/blob/v0.0.2/contracts/MyStrategy.sol#L421-L425claimBribesFromHiddenHand()
will confirm thatbribesProcessor
is notaddress(0)
https://github.com/Badger-Finance/vested-aura/blob/v0.0.2/contracts/MyStrategy.sol#L290But
sweepRewardToken()
doesn’t checkbribesProcessor
’s address https://github.com/Badger-Finance/vested-aura/blob/v0.0.2/contracts/MyStrategy.sol#L107-L113Tools Used
None
Recommended Mitigation Steps
Add check in
_sendTokenToBribesProcessor()
or
sweepRewardToken()