Part 2

Zaros
PerpetualsDEXFoundrySolidity
70,000 USDC
View results
Submission Details
Severity: medium
Invalid

[M-2] Missing Slippage Accumulation in Batch Swaps Enables Partial Drain at `StabilityBranch`

Summary

The StabilityBranch::initiateSwap function processes multiple swaps in a batch without cumulative slippage checks, enabling MEV on individual swaps.

Vulnerability Details

Affected Code:

// StabilityBranch.sol
for (uint256 i; i < amountsIn.length; i++) {
// Processes each swap independently
}

Exploit Scenario:

  1. User submits 10 swaps of 100 USD each with 5% slippage.

  2. Keeper front-runs each swap, extracting 1% per trade.

  3. Total 10% profit from the batch.

Impact

User Fund Loss: Up to slippage tolerance per swap.

Severity: Medium (CVSS 6.9).

Tools Used

Manual review

Foundry

Recommendations

// Add batch slippage check
uint256 totalMinOut = sum(minAmountsOut);
require(totalReceived >= totalMinOut, "Batch slippage");
Updates

Lead Judging Commences

inallhonesty Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.