Open sherlock-admin2 opened 8 months ago
The protocol team fixed this issue in the following PRs/commits: https://github.com/woonetwork/WooPoolV2/pull/112/commits/151443bf3c780f4e45796312591c61e1bd188122
Initially, it was selected as a duplicate of 141, but it's not. 141 is invalid and 85 is valid.
Escalate.
Please think about the actual impact.
You've deleted an escalation for this issue.
The Lead Senior Watson signed off on the fix.
hals
medium
WooCrossChainRouterV4.crossSwap()
doesn't correctly check for slippageSummary
WooCrossChainRouterV4.crossSwap()
doesn't correctly check for slippage, as it deducts external swapping fees after checking for the minimum bridged amount determined by the user.Vulnerability Detail
WooCrossChainRouterV4.crossSwap()
function is meant to enable users from executing a cross-chain swap, where a cross chain swap transaction may include all or some of the following steps (as per the documentation):So swapping from asset A to asset B on the source chain can be done either using a woofi pool (
WooPPV2
) viawooRouter.swap()
, or this swap can be done via an external aggregater (where 1inch aggregator is going to be used) viawooRouter.externalSwap()
that redirects the swap call to the external aggregator:where the resulted
bridgeAmount
will be checked to be >srcInfos.minBridgeAmount
in thewooRouter.externalSwap()
:Impact
But as can be noticed, an external swap fee is deducted from the
bridgeAmount
after the swap is done via an external aggregator (1inch aggregator) and after checking that thebridgeAmount
is sufficient as per detrmined by the user (> srcInfos.minBridgeAmount
), and this might result in thebridgeAmount
being less than required by the usersrcInfos.minBridgeAmount
.Code Snippet
WooCrossChainRouterV4.crossSwap function/L137-L138
Tool used
Manual Review
Recommendation
Update
WooCrossChainRouterV4.crossSwap()
to check for thebridgeAmount
being greater than the amount determined by the usersrcInfos.minBridgeAmount
after deducting the fees: