Users send an arbitrary amount of fees when trying to claim their MOR rewards token. This might result in failed transactions if they send in value that is not enough. Also, this can be used to bypass paying fees by purposefully making the claim transaction fail, and reclaiming through the retryMessage function.
To claim their rewards, users call the claim function, while sending ETH. The claim function sends the mint message to the L1Sender through the sendMintMessage function.
The send mint function packages the message and sends it over to layer zero endpoint.
For context, when sending a message to the layer zero endpoint, enough gas must for the transaction to succeed. If fees aren't enough, the gas, the transaction will fail.
As can be seen from the claim function, the user is allowed to send any arbitrary amount of ETH, hence as fees.
First, allowing users to send any value might result in them not sending enough for the fees, hence their transactions will always fail. It's leads to poor user experience for the most part.
The other issue here comes from the lzReceive which is how the message will be received.
Following the function chain, the transaction goes from lzReceive to _blockingLzReceive which calls the nonblockingLzReceive function wrapped in try catch.
Due to the fees not being enough, the _blockingLzReceive will fail, causing that the message the be added to the failedMessages.
The failed message can then be retried by calling the retryMessage function to clear up the message queue, which calls the _nonblockingLzReceive function through which the tokens are finally minted.
Thus, a user can call the claim function, sending little or no ETH as fees, causing the transaction to intentionally fail. Upon message reception failure, the user can then retry the message to claim the reward tokens.
No exact knowledge of fees can cause that users who unknowingly don't send enough will have their transactions fail, and therefore cause poor user experience.
Users can intentionally send little or no fees, making the transaction fail, so that upon retrying the message, they'll be able to claim their rewards without paying fees.
Manual code review
To fix this, layerzero has an estimateFees function as described here. This should be implemented, as well as a check that msg.value sent when claiming == the fees from the estimate.
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.