auraBAL can be stuck into the Strategy contract
The strategy contract calculates rewards by comparing token balances before and after claiming, so any auraBAL sent to the contract outside that claim window is not counted and becomes stuck. An attacker can call the public reward claim function for the strategy, causing auraBAL to be transferred but not harvested, and since auraBAL is a protected token it cannot be swept.
Originally disclosed on Code4rena
Submitted by PumpkingWok, also found by kirk-baird, rfa, tabish, and unforgiven
https://github.com/Badger-Finance/vested-aura/blob/v0.0.2/contracts/MyStrategy.sol#L220-L228
https://github.com/Badger-Finance/vested-aura/blob/v0.0.2/contracts/MyStrategy.sol#L288
Impact
The internal _harvest() function defined is responsible to claim auraBAL from the aura locker and within the function it swaps them to auraBAL -> BAL/ETH BPT -> WETH -> AURA, finally it locks AURA to the locker to increase the position. For claiming auraBAL it calls LOCKER.getReward(address(this)) and it calculates the tokes earned, checking the balance before and after the claiming.
The function to get the rewards is public and any address can call it for the strategy address, and it will transfer all rewards tokens to the strategy, but in this scenario the auraBAL will remain in stuck into the contract, because they won’t be counted as auraBAL earned during the next _harvest(). Also they could not sweep because auraBAL is a protected token.
Also, the aura Locker will be able to add other token as reward apart of auraBAL, but the harvest function won’t be able to manage them, so they will need to be sweep every time.
The same scenario can happen during the claimBribesFromHiddenHand() call, the IRewardDistributor.Claim[] calldata _claims pass as input parameters could be frontrunned, and another address can call the hiddenHandDistributor.claim(_claims) (except for ETH rewards) for the strategy address, and like during the _harvest() only the tokens received during the call will be counted as earned. However every token, except auraBAL can be sweep, but the _notifyBribesProcessor() may never be called.
Proof of Concept
At every _harvest() it checks the balance before the claim and after, to calculate the auraBAL earned, so every auraBAL transferred to the strategy address not during this call, won’t be swapped to AURA.
Recommended Mitigation Steps
Instead of calculating the balance before and after the claim, for both harvest≠ andclaimBribesFromHiddenHand()`, the whole balance could be taken, directly after the claim.
Alex the Entreprenerd (BadgerDAO) confirmed and commented:
Mitigated by refactoring from a delta of balance to absolute balances
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
Root cause
The contract calculates earned rewards as the difference in token balance before and after a claim, so tokens received outside that specific call are not recognised and become stuck.
Impact
auraBAL rewards can become permanently stuck in the strategy contract, and other reward tokens may also require manual sweeping; the text does not claim direct theft of funds.
What the attacker needed
Attacker can call the public claim function; strategy has pending rewards
The fix
The contract was fixed by refactoring the reward calculation to use absolute balances instead of a before-and-after delta.
How it was found
- An attacker calls the public reward claim function for the strategy address.
- The claim transfers auraBAL to the strategy contract.
- The next harvest only counts auraBAL earned during its own claim call, so the transferred auraBAL is not swapped.
- The auraBAL remains stuck because it is a protected token and cannot be swept.
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.
This contract tries to measure new rewards by checking the balance before and after a claim. If someone else triggers the claim first, the balance change happens outside the contract's measurement, so the reward tokens are left sitting in the contract and cannot be moved out. The fix is to stop measuring only the change and instead use the full balance after claiming.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.