The L2TokenReceiver
contract's sendMintMessage()
function does not adequaly validates gas fees for LayerZero endpoint communication. This lack of validation poses risks of failed or stuck transactions and potential exploitation through repeated low-gas submissions.
As you can see below you can send any amount of gas through msg.value
in Distribution.sol#claim() function.
But if no minimum gas is enforced, an application that has the intention of using the NonBlockingApp can end up in a situation where there is a StoredPayload
and the pathway is blocked.
The blocking communication pathway issue in sendMintMessage()
can be understood in the context of the ILayerZeroEndpoint(config.gateway).send
function call:
// Distribution.sol :
// L1Sender.sol :
In this code:
ILayerZeroEndpoint(config.gateway).send
is used to send a message across LayerZero.
adapterParams
is passed as an empty byte array (bytes("")
), indicating no specific parameters for the message, including gas limits.
The attacker calls claim() and specifies a small amount of gas as msg.value
. The Relayer delivers the transaction with the specified gas at the destination.
The transaction is first validated through the LayerZero contracts before it reaches the lzReceive
function. The Relayer will give exactly the gas which was specified through the claim() function. The line where it happens inside the LayerZero contract is here, and {gas: _gasLimit}
is the gas the sender has paid for. The objective is that due to this small gas passed the transaction reverts somewhere inside the lzReceive function and the message pathway is blocked, resulting in StoredPayload.
In the Morpheus AI protocol, this could be exploited to frequently block communication pathways between chains by sending messages with insufficient gas, causing them to revert and thus disrupt the service.
Or a loss of funds for users that does not send enough gas through claiming process
Estimate gas fees using layerZero documentation and require user to send at least estimated fees
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.