https://github.com/TempleDAO/temple/blob/templegold/protocol/contracts/templegold/TempleTeleporter.sol#L62-L72
https://github.com/TempleDAO/temple/blob/templegold/protocol/contracts/templegold/TempleGold.sol#L308-L332
In the TempleTeleporter
and TempleGold
contracts, the teleport
and send
functions, respectively, allow the sender to specify the gas amount for message execution on the destination chain. There is no minimum gas limit enforced for these cross-chain calls.
An attacker can exploit this by sending multiple transactions with very low gas limits, blocking cross-chain communication pathways between all chains in the TempleGold ecosystem.
LayerZero's send
function allows the sender to specify the gas amount for message execution on the destination chain. This configuration is specified in the options
parameter for TempleTeleporter and in the _fee
parameter for TempleGold.
Both TempleTeleporter.sol
and TempleGold.sol
use the _lzSend
function without enforcing a minimum gas limit:
An attacker can exploit this by:
Calling the teleport
function in TempleTeleporter
or send
function in TempleGold
multiple times.
Specifying a very low gas limit (e.g., 5k gas) in the options
or _fee
parameter for each call.
These transactions will succeed on the source chain but fail on the destination chain due to insufficient gas, resulting in blocked message pathways.
The attacker calls the teleport
or send
function multiple times on any chain.
For each call, they set the gas limit to a very low value (e.g., 5k gas) in the relevant parameter.
The transactions are executed on the source chain and delivered to the destination chain.
On the receiving chain, the transactions revert due to "out of gas" errors during execution.
The revert is caught inside the lzEndpoint catch block
resulting in StoredPayload
and blocking the pathway
This vulnerability allows an attacker to potentially block cross-chain communication pathways between all chains in the TempleGold ecosystem. By manipulating the gas parameters in cross-chain calls, an attacker can, with low cost and high frequency, block the pathway between any two chains, rendering the whole system unusable and potentially locking user funds.
Manual review
LayerZero documentation
Implement a minimum gas threshold for all LayerZero message sends:
Consider implementing a mechanism to retry failed messages with increased gas to prevent permanent blocking.
Denial of Service (DoS)
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.