Submitted by nobody2018, also found by minhtrng, Arz, gumgumzum (1, 2), windhustler, 0xnev, 0xStalin, 3docSec, Kow, perseverancesuccess, OMEN, Koolex, and rvierdiiev
v2 adapterParams are used to send messages, which means that the relayer will send native token to RootBridgeAgent before RootBridgeAgent.lzReceive is called. However, if an exception occurs inside lzReceiveNonBlocking, lzReceive will not revert (except for ARB branch). In this way, the native token sent to RootBridgeAgent will stay in RootBridgeAgent. Malicious users can steal these native tokens by sending some messages.
The messages discussed below are all sent using V2 (Airdrop):
When the cross-chain message reaches RootBridgeAgent, the relayer from layerZero will first send the native token to RootBridgeAgent and then call RootBridgeAgent.lzReceive which internally calls lzReceiveNonBlocking to process various messages.
From the above code we can see that if lzReceiveNonBlocking returns false, as long as the sender is not from getBranchBridgeAgent[localChainId](ARB branch), then tx will not revert. This means that the native token previously sent by the relayer is left in this contract (RootBridgeAgent).
In lzReceiveNonBlocking, the functions used to process messages are two _execute functions: 1, 2. The difference between the former and the latter is whether Fallback can be triggered if a failure to process the message occurs.
If the message is processed by _execute in L749, when bridgeAgentExecutorAddress.call returns false, the value sent is still in the current contract.
_hasFallbackToggled is set when the user sends a message. When bridgeAgentExecutorAddress.call returns false:
Consider the following scenario:
In lzReceive, if success is false and msg.sender is not an ARB branch, then the balance held by this should be returned to the sender address of the source message.
Context
alcueca (judge) decreased severity to Medium
0xLightt (Maia) confirmed via duplicate issue #464
0xBugsy (Maia) commented:
Note: For full discussion, see here.
