# There is a calculation error in AuraVault::redeem()

AuraVault.redeem passes vault shares directly to Aura rewardPool.redeem, which treats them 1:1, so users receive fewer assets than their shares are worth.

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

**Target:** AuraVault ERC4626 vault redeem()
**Root cause:** redeem() forwards the caller's AuraVault shares to rewardPool.redeem() without converting them to underlying assets via previewRedeem; rewardPool shares are 1:1 with assets, so the vault's share/asset ratio is ignored.
**Steps:**
1. Note AuraVault share:asset ratio can differ from 1:1 (e.g. 1:2).
2. Call `redeem(shares, receiver, owner)` on AuraVault.
3. Observe `IPool(rewardPool).redeem(shares, address(this), address(this))` uses raw shares as rewardPool shares.
4. User receives `shares` assets instead of `previewRedeem(shares)` assets, losing the difference.
**How found:** Code reading of redeem() against the ERC4626 spec: noticed shares passed straight to rewardPool.redeem, then checked rewardPool's redeem/withdraw equivalence and 1:1 share ratio to confirm the unit mismatch.
**Exploitation:** Any redeeming user (or an attacker timing a ratio change) receives fewer assets than entitled; the shortfall remains in the vault, extractable by remaining/last withdrawers.
**Insight:** When a vault wraps another yield-bearing pool, verify every share<->asset conversion boundary: any place raw vault shares are forwarded to the underlying pool's share-based functions (redeem/withdraw) is a unit-confusion bug.

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

**Vulnerable AuraVault redeem passing shares to rewardPool**

```
function redeem(
        uint256 shares,
        address receiver,
        address owner
    ) public virtual override(IERC4626, ERC4626) returns (uint256) {
        require(shares <= maxRedeem(owner), "ERC4626: redeem more than max");

        // Redeem assets from Aura reward pool and send to "receiver"
@>>        uint256 assets = IPool(rewardPool).redeem(shares, address(this), address(this));

        _withdraw(_msgSender(), receiver, owner, assets, shares);

        return assets;
    }
```

**Mitigation diff converting shares via previewRedeem**

```
function redeem(
        uint256 shares,
        address receiver,
        address owner
    ) public virtual override(IERC4626, ERC4626) returns (uint256) {
        require(shares <= maxRedeem(owner), "ERC4626: redeem more than max");
+        uint256 assets = previewRedeem(shares);

        // Redeem assets from Aura reward pool and send to "receiver"
-       uint256 assets = IPool(rewardPool).redeem(shares, address(this), address(this));
+        assets = IPool(rewardPool).redeem(assets, address(this), address(this));
```

