# Users are forced to swap all reward tokens with no slippage protection

AuraSpell swaps all reward tokens to debt token with minOut=0, letting attackers sandwich every deposit and steal the swapped value.

- Payout: Contest reward
- Severity: high
- Program: Blueberry
- Credited: 0x52
- Disclosed: 2023-04-07
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2023-04-blueberry-judging/issues/121
- Library page: https://bugbountylibrary.com/r/sherlock%3A2023-04-blueberry%3AH-3
- Tags: domain:web3 impact:funds-loss kind:contest platform:sherlock sev:high tech:evm tech:solidity technique:source-review vuln:business-logic vuln:oracle-manipulation

**Target:** AuraSpell.sol reward-token swap loop in blueberry-core
**Root cause:** The reward-token swap loop calls swapExactTokensForTokens with amountOutMin=0 and no user-supplied slippage bound, so any MEV searcher can sandwich the swap.
**Steps:**
1. User calls AuraSpell deposit/liquidation path that triggers reward harvesting.
2. Loop iterates rewardTokens, calls `_doCutRewardsFee` then `_ensureApprove(rewardTokens[i], swapRouter, rewards)`.
3. Calls `swapRouter.swapExactTokensForTokens(rewards, 0, swapPath[i], address(this), type(uint256).max)` with minOut=0.
4. Attacker front-runs by moving the pool price against the swap, back-runs to restore, capturing the difference.
**How found:** Code review of AuraSpell reward-swap loop; noticed hardcoded 0 for amountOutMin and absence of any user slippage parameter.
**Exploitation:** MEV searcher observes the pending AuraSpell transaction, front-runs the reward-token swap to depress output price, lets the victim swap at minOut=0, then back-runs to restore price and pockets the spread.
**Insight:** In spell/strategy contracts, audit every swapRouter call for hardcoded zero minOut and confirm slippage is user-supplied per reward token, not just for the main debt swap.
