Submitted by unforgiven
BridgeFacet.sol#L526-L616
BridgeFacet.sol#L753-L803
BridgeFacet.sol#L398-L428
BridgeFacet.sol#L345-L351
Routers pay for transaction in destination domain then nomad messages come and routers get paid again. but the amount routers pay in execute() are what transaction sender signed and the amount routers receive is what nomad sends and handles in _reconcile() but this two amount can be different because of slippage and swap that happens in xcall() because the amount sent in nomad message is the result of swapToLocalAssetIfNeeded().
So its possible for routers to lose funds if some slippage happens in that swap.
This is xcall() code:
As you can see it swaps what user sent to LoccalAsset which the amount is bridgedAmt and then send value of bridgedAmt to nomad bridge message = _formatMessage(_args, bridged, transferId, bridgedAmt).
But the amount user signed in _args.amount is different and that what user sends to contract.
The reasons that bridgedAmt could be different than _args.amount is:
1- deflationary tokens in transferring from user.
2- slippage in swap to local token.
This is _reconcile() code:
As you can see it uses amount in message to calculate what router should receive.
This is _handleExecuteLiquidity() code which is used in execute():
As you can see it uses the amount defined in ExecuteArgs to see how much routers should pay.
Because of these two issues (deflationary tokens and swap slippage) attacker could fool protocol to spend more than what he transferred to protocol. This could be seen as two bugs.
VIM
Update spending amount based on  (deflationary tokens and swap slippage).
LayneHaber (Connext) disputed and commented:
0xleastwood (judge) commented:
LayneHaber (Connext) commented:
LayneHaber (Connext) resolved:
