# theft of funds for new depositers if sUSP can not absorb entire losses

ParetoDollarQueue.requestRedeem records 1 USP = 1 collateral even after bad debt, so new depositors absorb unabsorbed losses from prior epochs.

- Payout: Audit contest
- Severity: medium
- Program: Pareto Contest
- Found by: Atharv
- Disclosed: 2025-04-22
- Write-up quality: 7/10
- Original: https://github.com/sherlock-audit/2025-04-pareto-contest-judging/issues/305
- Library page: https://bugbountylibrary.com/r/sherlock%3A2025-04-pareto-contest%3AM-2
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:sherlock sev:medium tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:business-logic vuln:dos

**Target:** ParetoDollarQueue.requestRedeem / redeemFunds epoch accounting
**Root cause:** requestRedeem stores the full USP burn amount in userWithdrawalsEpochs and epochPending without checking whether totalCollateralScaled can cover it, assuming 1 USP = 1 underlying even when a yield source has lost value.
**Steps:**
1. Users A and B deposit 10k and 5k USDS, minted to USP, deposited into sUSDS 4626 vault.
2. User B stakes 1k USP in sUSP.
3. Vault incurs 10% loss (~1500); owner emergencyWithdraws and burns 1k from sUSP, leaving 500 bad debt.
4. A and B call `requestRedeem` for full balances: userWithdrawalsEpochs[userA][1] = 10k, userWithdrawalsEpochs[userB][1] = 4k, epochPending[1] = 14k.
5. Manager advances epoch and calls `redeemFunds`; user C deposits 2k in epoch 2.
6. redeemFunds redeems 13500, epochPending[1] = 14k - 13500 = 500; stopEpoch reverts NotReady.
7. Manager calls `depositFunds(0)`; unlent balance 15500 > totReservedWithdrawals 14k + epochPending[2] 0, so epochPending[1] reset to 0.
8. A and B call `claimRedeemRequest` and receive full 10k and 4k; queue left with 1500, so user C bears the 500 loss.
**How found:** Code reading of requestRedeem noting it credits _amount directly without consulting getTotalCollateralsScaled, then reasoning about a 4626 vault with negative APY or CV default exceeding sUSP buffer.
**Exploitation:** No attacker action required; any new depositor entering the epoch after a loss exceeding sUSP absorption subsidizes prior LPs' withdrawals because requestRedeem overstates their claim relative to actual collateral.
**Escalation:** If no new depositor arrives, epochPending[1] stays nonzero and depositFunds reverts, permanently blocking A and B withdrawals (DoS).
**Insight:** In epoch-based redemption queues, check whether the recorded withdrawal claim is denominated in shares or in nominal underlying; if nominal, any loss between request and claim shifts the shortfall onto whoever deposits next.

