57290 sc high mev sandwich attack vulnerability no user controlled slippage protection in token swaps
Description
Brief/Intro
Vulnerability Details
function _swapExact(address tokenIn, address tokenOut, address recipient, uint256 amount)
internal
returns (uint256 swapped)
{
// ... [initialization code]
PaymentsInfo memory _paymentsInfo = belongCheckInStorage.paymentsInfo;
bytes memory path = _buildPath(_paymentsInfo, tokenIn, tokenOut);
// VULNERABLE: Uses global slippageBps from contract storage
uint256 amountOutMinimum = IV3Quoter(_paymentsInfo.swapV3Quoter)
.quoteExactInput(path, amount)
.amountOutMin(_paymentsInfo.slippageBps);
IV3Router.ExactInputParamsV1 memory swapParamsV1 = IV3Router.ExactInputParamsV1({
path: path,
recipient: recipient,
deadline: block.timestamp,
amountIn: amount,
amountOutMinimum: amountOutMinimum // Uses globally configured tolerance
});
// ... [swap execution]
} Attack Mechanics
Impact Details
Direct Financial Loss to Users
Proof of Concept
References
Previous57374 sc low staking tier misclassificationNext57327 sc medium title front running leads to denial of service and unauthorized referral farming in creation functions
Was this helpful?