sequential messaging in oapp_lz_receive can be easily attacked
Summary
oapp_lz_receive.rs uses sequential messaging when receiving messages through lzReceive(). If vault_authority.order_delivery is turned on, messages can only come in order.
There are a few ways the messaging sequence can fail, such as:
Having too little tokens in vault_deposit_wallet.
user_deposit_wallet not initialized.
If either accounts are frozen.
Too little gas available.
When the messaging sequence fail, other messages cannot pass, making the whole messaging system fail.
Root Cause
In oapp_lz_receive.apply, one of the params of OAppLzReceiveParams is nonce. This nonce is used when order_delivery is set to true.
Droll Cider Armadillo
Medium
sequential messaging in oapp_lz_receive can be easily attacked
Summary
oapp_lz_receive.rs
uses sequential messaging when receiving messages throughlzReceive()
. Ifvault_authority.order_delivery
is turned on, messages can only come in order.There are a few ways the messaging sequence can fail, such as:
vault_deposit_wallet
.user_deposit_wallet
not initialized.When the messaging sequence fail, other messages cannot pass, making the whole messaging system fail.
Root Cause
In oapp_lz_receive.apply, one of the params of
OAppLzReceiveParams
isnonce
. This nonce is used whenorder_delivery
is set to true.In the LayerZero example, nonce is not used for sequential messaging.
Internal pre-conditions
No response
External pre-conditions
No response
Attack Path
No response
Impact
If one message fails, all subsequent messages cannot be read.
Setting severity as Medium as
order_delivery
can always be turned off.PoC
No response
Mitigation
Best is to allow out of order execution as messaging sequence can be easily disrupted.