Badger rewards from Hidden Hand can permanently prevent Strategy from receiving bribes
The strategy contract sends BADGER rewards to the Badger Tree twice: once directly and once via the Vault's extra token processing. Because the second transfer fails when the balance is zero, the claim function always reverts, preventing any bribes from being claimed.
Submitted by scaraven, also found by berndartmueller, cccz, dipp, GimelSec, kenzo, kirk-baird, and unforgiven
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() in MyStrategy and again with _processExtraToken() in the BasicStrategy 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 that claimBribesFromHiddenHand() will always revert preventing any other bribes from being received.
Proof of Concept
claimBribesFromHiddenHand()is called by strategist- Multiple bribes are sent to the strategy including BADGER. For example lets say 50 USDT And 50 BADGER
- Strategy receives BADGER and calls
_handleRewardTransfer()which calls_sendBadgerToTree(). 50 BADGER is sent to the Badger Tree so balance has dropped to 0. - 50 Badger is then again sent to Vault however balance is 0 so the command fails and reverts
- No more tokens can be claimed anymore
Tools Used
VS Code
Recommended Mitigation Steps
_processExtraToken() eventually sends the badger to the badger tree through the Vault contract. Change
function _sendBadgerToTree(uint256 amount) internal {
IERC20Upgradeable(BADGER).safeTransfer(BADGER_TREE, amount);
_processExtraToken(address(BADGER), amount);
}
to
function _sendBadgerToTree(uint256 amount) internal {
_processExtraToken(address(BADGER), amount);
}
Alex the Entreprenerd (BadgerDAO) confirmed and commented:
Developer oversight yeah.
shuklaayush (BadgerDAO) commented:
Yeah, badger bribes can’t be claimed. Not sure if I’ll call it high risk but definitely an oversight.
jack-the-pug (judge) validated and decreased severity to Medium
Alex the Entreprenerd (BadgerDAO) commented:
We mitigated by fixing the mistake.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
The claim function always reverts when BADGER is among the bribes, so no bribes can be claimed, though the team considered it an oversight rather than high risk.
What the attacker needed
BADGER is included in the bribes; Strategy has no initial BADGER balance
The fix
The fix was to remove the direct transfer to the Badger Tree and rely only on _processExtraToken to send BADGER through the Vault.
How it was found
- The strategist calls claimBribesFromHiddenHand().
- Multiple bribes including BADGER are sent to the strategy.
- The strategy sends BADGER to the Badger Tree via _sendBadgerToTree(), reducing its balance to zero.
- The code then attempts to send the same BADGER amount again through _processExtraToken(), which fails because the balance is zero.
- The transaction reverts, and no further tokens can be claimed.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A smart contract handles reward tokens. When BADGER tokens arrive, the code tries to send them to two places, but it only has enough for one transfer. The second transfer fails, so the whole claim operation stops working.
What is Smart contracts?
Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.