57595 sc low single tier swap path can stall core flows
Description
Brief / Intro
Vulnerability Details
// contracts/v2/platform/BelongCheckIn.sol::_buildPath
function _buildPath(
PaymentsInfo memory _paymentsInfo,
address tokenIn,
address tokenOut
) internal view returns (bytes memory path) {
// Direct pool
if (
IV3Factory(_paymentsInfo.swapV3Factory).getPool(
tokenIn,
tokenOut,
_paymentsInfo.swapPoolFees
) != address(0)
) {
path = abi.encodePacked(
tokenIn,
_paymentsInfo.swapPoolFees,
tokenOut
);
}
// tokenIn -> W_NATIVE_CURRENCY -> tokenOut
else if (
IV3Factory(_paymentsInfo.swapV3Factory).getPool(
tokenIn,
_paymentsInfo.wNativeCurrency,
_paymentsInfo.swapPoolFees
) != address(0)
) {
// @note here
path = abi.encodePacked(
tokenIn,
_paymentsInfo.swapPoolFees,//@ same swap fees
_paymentsInfo.wNativeCurrency,
_paymentsInfo.swapPoolFees,//@ same swap fees
tokenOut
);
} else {
revert NoValidSwapPath();
}
}Impact
References
Proof of Concept
Previous57425 sc low referral percentage updates are ignored due to append only storage in nftfactoryNext57008 sc critical emergencywithdraw function malfunction due to missing validation in removeanysharesfor
Was this helpful?