Due to missing checks on minimum gas and fee passed through LayerZero, executions can fail on the destination chain
Summary
Due to missing checks on the minimum gas and fee passed through LayerZero, executions can fail on the destination chain. An attacker can exploit this vulnerability to attack the system.
Root Cause
In LayerZero, the destination chain’s function call requires a specific gas amount; otherwise, it will revert with an out-of-gas exception. It falls under the responsibility of the oApp to ensure that appropriate limits are established.
The logic of the Deposit() operation assumes that the user will first call oapp_quote() to obtain an estimated native_fee price, and then pass this parameter into the Deposit() function.
From the code, it can be seen that the function does not check the gas limit and gas fee. As a result, an attacker can exploit this by deliberately passing in a very small gas limit and gas fee, causing the message to fail execution on the EVM side due to “out of gas.”
The attacker can also pass in a very small or even zero token_amount, making the attack nearly cost-free.
Internal pre-conditions
No response
External pre-conditions
No response
Attack Path
No response
Impact
The attacker can exploit execution failures on the EVM side to block the system, causing a Denial of Service (DoS) attack.
PoC
No response
Mitigation
In the Deposit function, execute oapp_quote() internally, and use the obtained parameters for the cpi::send() call.
Fit Canvas Pangolin
Medium
Due to missing checks on minimum gas and fee passed through LayerZero, executions can fail on the destination chain
Summary
Due to missing checks on the minimum gas and fee passed through LayerZero, executions can fail on the destination chain. An attacker can exploit this vulnerability to attack the system.
Root Cause
In LayerZero, the destination chain’s function call requires a specific gas amount; otherwise, it will revert with an out-of-gas exception. It falls under the responsibility of the oApp to ensure that appropriate limits are established.
The logic of the Deposit() operation assumes that the user will first call oapp_quote() to obtain an estimated native_fee price, and then pass this parameter into the Deposit() function.
https://github.com/sherlock-audit/2024-09-orderly-network-solana-contract/blob/main/solana-vault/packages/solana/contracts/programs/solana-vault/src/instructions/vault_instr/deposit.rs#L141
From the code, it can be seen that the function does not check the gas limit and gas fee. As a result, an attacker can exploit this by deliberately passing in a very small gas limit and gas fee, causing the message to fail execution on the EVM side due to “out of gas.”
The attacker can also pass in a very small or even zero token_amount, making the attack nearly cost-free.
Internal pre-conditions
No response
External pre-conditions
No response
Attack Path
No response
Impact
The attacker can exploit execution failures on the EVM side to block the system, causing a Denial of Service (DoS) attack.
PoC
No response
Mitigation
In the Deposit function, execute oapp_quote() internally, and use the obtained parameters for the cpi::send() call.