Closed code423n4 closed 2 years ago
Disagree with the finding, the warden confirms there's no risk of loss as The tokens are still recoverable by calling the sweepRewardToken()
, my conclusion is there's no vulnerability here as such I must dispute
Lines of code
https://github.com/Badger-Finance/vested-aura/blob/d504684e4f9b56660a9e6c6dfb839dcebac3c174/contracts/MyStrategy.sol#L311
Vulnerability details
Impact
The function
hiddenHandDistributor.claim(_claims);
is callable by anyone so long as they have the correct merkle proof, which is publicly available. If called by an external user the rewards will be transferred to the contract beforeclaimBribesFromHiddenHand()
.The impact of this is that the balance difference for the assets will be zero since the rewards have already been transferred to
MyStrategy
. Hence,_notifyBribesProcessor()
may never be called.The tokens are still recoverable by calling the
sweepRewardToken()
. Hence, this is rated as medium severity rather than high.Note also that native ETH cannot be included in this attack since the
receive()
function reverts if we are not inclaimBribesFromHiddenHand()
becauseisClaimingBribes
is false.Proof of Concept
claimBribesFromHiddenHand()
will only account for the balance increase before and after callinghiddenHandDistributor.claim(_claims);
. Which may be zero if an attacker has already claimed the rewards.Recommended Mitigation Steps
Consider allowing
claimBribesFromHiddenHand()
to claim all tokens in the contract as bribes and transfer the entire token balance to the bribe processor. This would require ignoring allAURA
orAURABAL
bribes and instead treating these as harvestable rewards.