For the complete documentation index, see llms.txt. This page is also available as Markdown.

57435 sc high missing slippage protection enables direct theft via mev sandwich attacks

Submitted on Oct 26th 2025 at 08:37:19 UTC by @Carrot for Audit Comp | Belong

  • Report ID: #57435

  • Report Type: Smart Contract

  • Report severity: High

  • Target: https://github.com/immunefi-team/audit-comp-belong/blob/main/contracts/v2/platform/BelongCheckIn.sol

  • Impacts: Theft of unclaimed yield

Description

Brief / Intro

BelongCheckIn.sol is configured with slippageBps = 999999999999999999999999999 which causes amountOutMinimum to be 0 on all Uniswap V3 swaps. This allows MEV bots to sandwich attack every swap transaction, resulting in direct theft of funds in-motion.

Vulnerability Details

The protocol performs real token swaps through Uniswap V3 in multiple critical functions:

  • venueDeposit(): Swaps USDC convenience fees to LONG

  • distributePromoterPayments(): Swaps USDC to LONG for promoter payouts

  • payToVenue(): Auto-converts LONG payments to USDC

  • _handleRevenue(): Swaps USDC to LONG for buyback mechanism

The slippage protection calculation in _swapExact() (lines referenced in the report):

With the deployed configuration:

  • BPS = 10^27

  • slippageBps = 999999999999999999999999999 (i.e., BPS - 1)

  • amountOutMin = quote * (BPS - slippageBps) / BPS = quote * 1 / 10^27 = 0

This means the protocol accepts ANY amount >= 0 as valid output.

Impact Details

HIGH - Theft of unclaimed yield:

  • Promoter rewards (unclaimed yield) stolen during LONG distribution

  • Venue convenience fee rewards stolen during swap to LONG

  • Funds being swapped through Uniswap V3 are "in-motion" and can be stolen

  • MEV bots can extract nearly 100% value during swap execution

Financial estimates (as reported):

  • Venue deposits: $500/day stolen from convenience fees

  • Promoter payouts: $2,500/day stolen from rewards

  • Total: ~$90,000/month direct loss

Attack Scenario

1

Monitor mempool

MEV bot monitors mempool for BelongCheckIn swap transactions.

2

Front-run

Front-run transaction: buy output token to manipulate pool price.

3

Swap executes with minimal protection

Protocol swap executes with amountOutMinimum = 0.

4

Back-run

Back-run transaction: sell output token at the inflated price.

5

Result

Direct theft of funds in-motion (attacker extracts value from the swap).

References

  • BelongCheckIn.sol lines 664-665 (slippage calculation)

  • Helper.sol line 131-133 (amountOutMin function)

Recommendation

Set a reasonable slippage tolerance. Example from the report:

(Adjust the exact value to an appropriate tolerance consistent with the protocol's UX and risk profile.)

Proof of Concept

Run the provided Hardhat test

Run Command:

Test file contents:

Was this helpful?