L-1: Same-chain order submissions can retain accidental native sent with the transaction
Description:
Both submission entrypoints, submitOrder() and submitOrderWithPermit(), are payable because cross-chain orders use msg.value to pay LayerZero fees.
Both functions delegate to _submitOrder(). When quote.route.destEID == thisChainEID, _submitOrder() queues the order locally through _pushOrder() and does not call _sendOrder(), the only branch that forwards msg.value to LayerZero with msg.sender as the refund recipient.
The same-chain branch has no msg.value check and does not refund native. Any native accidentally attached to a local submission remains as stray contract balance and can later be swept to the owner through recoverETH(), not to the original submitter.
Impact:
Low. Users or integrations can accidentally lose native ETH attached to same-chain submissions. The loss is limited to accidental msg.value, and funds are recoverable only by the privileged owner path.
Recommendation:
Reject native for same-chain submissions:
if (quote.route.destEID == thisChainEID && msg.value != 0) revert UnexpectedMsgValue();
Alternatively, immediately refund the full msg.value to msg.sender before queuing the local order.
Developer Response:
Fixed in commit cff03ae.