# AuraVault::claim reward calculation does not deduct fees from reward amount, causing DoS or extra rewards lost

AuraVault.claim sends the full reward amount to the caller without subtracting the locker fee already transferred, causing DoS or over-payment of rewards.

- Payout: Audit contest
- Severity: high
- Program: LoopFi
- Found by: crypticdefense
- Disclosed: 2025-02-17
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2024-07-loopfi-findings/issues/401
- Library page: https://bugbountylibrary.com/r/c4%3A2024-07-loopfi%3AH-01
- Tags: area:web3 domain:web3 impact:dos impact:funds-loss kind:contest platform:code4rena sev:high tech:solidity technique:source-review vuln:accounting-error vuln:dos vuln:fee-bypass

**Target:** AuraVault::claim reward distribution
**Root cause:** The locker incentive fee is transferred to lockerRewards but not deducted from the amount transferred to msg.sender, so total outflows exceed the claimed reward amount.
**Steps:**
1. Set lockerIncentive=1000, INCENTIVE_BASIS=10000 (10% fee).
2. Call `claim([100e18,100e18], maxAmountIn)` so getReward() makes contract hold 100e18 BAL/AURA.
3. Contract sends `100e18*1000/10000=10e18` BAL to lockerRewards, leaving 90e18.
4. Contract then attempts `safeTransfer(msg.sender, 100e18)` BAL, reverting on insufficient balance (DoS) or over-paying if balance suffices.
**How found:** Code reading of claim's distribution logic: noticed the fee transfer to lockerRewards was not subtracted from the subsequent transfer of the full amounts[0]/amounts[1] to msg.sender.
**Exploitation:** Attacker calls claim with reward amounts near the vault's full reward balance; the fee transfer plus full payout either reverts (griefing/DoS of claim) or, when extra rewards exist, drains more than entitled, stealing other users' rewards.
**Insight:** In reward-claim functions, verify that fee/treasury transfers are subtracted from the user payout; check that sum of outgoing transfers equals the claimed amount, not amount+fee.

## Proof of concept (copied exactly from the original report)

**claim() transfers full reward amount plus fee**

```
IERC20(BAL).safeTransfer(_config.lockerRewards, (amounts[0] * _config.lockerIncentive) / INCENTIVE_BASIS);
@>      IERC20(BAL).safeTransfer(msg.sender, amounts[0]);

        // Distribute AURA rewards
        if (block.timestamp <= INFLATION_PROTECTION_TIME) {
@>          IERC20(AURA).safeTransfer(_config.lockerRewards, (amounts[1] * _config.lockerIncentive) / INCENTIVE_BASIS);
@>          IERC20(AURA).safeTransfer(msg.sender, amounts[1]);
```

