Due to a bug with the slippage configuration it is possible to make a call to the harvest method do a swap with 0 BALETH_BPT tokens.
Proof of Concept
According to the balancer documentation the limit argument represents:
limit: The meaning of limit depends on the value of singleSwap.kind
GIVEN_IN: The minimum amount of tokens we would accept to receive from the swap.
So if an attacker detects the harvest transaction in the memory pool, and configures two transactions to perform a sadwitch attack, the contract will perform a swap with an expected minimum of 0 tokens.
Lines of code
https://github.com/Badger-Finance/vested-aura/blob/d504684e4f9b56660a9e6c6dfb839dcebac3c174/contracts/MyStrategy.sol#L249 https://dev.balancer.fi/resources/swaps/single-swap#swap-function
Vulnerability details
Impact
Due to a bug with the slippage configuration it is possible to make a call to the
harvest
method do a swap with 0BALETH_BPT
tokens.Proof of Concept
According to the balancer documentation the
limit
argument represents:So if an attacker detects the
harvest
transaction in the memory pool, and configures two transactions to perform a sadwitch attack, the contract will perform a swap with an expected minimum of 0 tokens.Reference:
Affected source code:
Recommended Mitigation Steps