57733 sc high swapexact s slippge is not works as expected
Submitted on Oct 28th 2025 at 14:52:36 UTC by @ox9527 for Audit Comp | Belong
Report ID: #57733
Report Type: Smart Contract
Report severity: High
Target: https://github.com/immunefi-team/audit-comp-belong/blob/main/contracts/v2/platform/BelongCheckIn.sol
Impacts:
Direct theft of any user funds, whether at-rest or in-motion, other than unclaimed yield
Description
Brief / Intro
When BelongCheckIn.sol::_swapExact() is called, amountOutMinimum is first fetched from an on-chain quote and then calculated based on slippageBps.
However, when using Uniswap V3’s Quoter (or IV3Quoter / swapV3Quoter) to get the price for a specific swap path, the returned quote is calculated based on the current on-chain state of the relevant pools including the current sqrtPriceX96 (spot price), liquidity distribution, and tick states.
An attacker can front-run BelongCheckIn.sol::venueDeposit() and temporarily inject large liquidity into a Uniswap V3 pool to manipulate the quoted price. As a result, amountOutMinimum returned by the Quoter can be smaller than expected, rendering the slippage protection ineffective and allowing the attacker to cause the victim to receive far worse execution than anticipated.
Vulnerability Details
Relevant code excerpt:
function _swapExact(address tokenIn, address tokenOut, address recipient, uint256 amount)
internal
returns (uint256 swapped)
{
if (recipient == address(0) || amount == 0) {
return 0;
}
PaymentsInfo memory _paymentsInfo = belongCheckInStorage.paymentsInfo;
bytes memory path = _buildPath(_paymentsInfo, tokenIn, tokenOut);
uint256 amountOutMinimum =
IV3Quoter(_paymentsInfo.swapV3Quoter).quoteExactInput(path, amount).amountOutMin(_paymentsInfo.slippageBps); //@<amountOutMinimum is fetched from an on-chain contract (the Quoter) instead of being based on an off-chain oracle or other non-manipulable source. Because the Quoter reflects the current on-chain pool state, it can be manipulated via front-running (temporary liquidity changes), allowing an attacker to reduce the quoted amount and bypass slippage protections.
Impact Details
Escrow (or the contract performing the swap) can receive significantly fewer assets than expected — enabling theft of value from users.
Proof of Concept
References
(No additional references provided in the submitted report.)
Was this helpful?