Badger rewards from Hidden Hand can permanently prevent Strategy from receiving bribes #111
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")
valid
Lines of code
https://github.com/Badger-Finance/vested-aura/blob/d504684e4f9b56660a9e6c6dfb839dcebac3c174/contracts/MyStrategy.sol#L428-L430
https://github.com/Badger-Finance/badger-vaults-1.5/blob/3c96bd83e9400671256b235422f63644f1ae3d2a/contracts/BaseStrategy.sol#L351
https://github.com/Badger-Finance/vested-aura/blob/d504684e4f9b56660a9e6c6dfb839dcebac3c174/contracts/MyStrategy.sol#L407-L408
Vulnerability details
Impact
If the contract receives rewards from the hidden hand marketplace in BADGER then the contract tries to transfer the same amount of tokens twice to two different accounts, once with
_sendBadgerToTree()
inMyStrategy
and again with_processExtraToken()
in theBasicStrategy
contract. As it is very likely that the strategy will not start with any BADGER tokens, the second transfer will revert (as we are using safeTransfer). This means thatclaimBribesFromHiddenHand()
will always revert preventing any other bribes from being received.Proof of Concept
claimBribesFromHiddenHand()
is called by strategist_handleRewardTransfer()
which calls_sendBadgerToTree()
. 50 BADGER is sent to the Badger Tree so balance has dropped to 0.Tools Used
VS Code
Recommended Mitigation Steps
_processExtraToken()
eventually sends the badger to the badger tree through theVault
contract. Changeto
The text was updated successfully, but these errors were encountered: