Skip to content
DoS Audit finding Intermediate

An attacker can lock operator out of the pod by setting gas limit that’s higher than the block gas limit of dest chain

A user can set an arbitrarily high gas limit for a cross-chain job, exceeding the destination chain's block gas limit, causing the operator's execution to fail. This locks the operator out of the pod, preventing them from executing further jobs and recovering their bond.

0xA5DF Follow

Originally disclosed on Code4rena

Submitted by 0xA5DF, also found by 0x52

HolographOperator.sol#L415

When a beaming job is executed, there’s a requirement that the gas left would be at least as the gasLimit set by the user. Given that there’s no limit on the gasLimit the user can set, a user can set the gasLimit to amount that’s higher than the block gas limit on the dest chain, causing the operator to fail to execute the job.

Impact

Operators would be locked out of the pod, unable to execute any more jobs and not being able to get back the bond they paid.

The attacker would have to pay a value equivalent to the gas fee if that amount was realistic (i.e. gasPrice * gasLimit in dest chain native token), but this can be a relative low amount for Polygon and Avalanche chain (for Polygon that’s 20M gas limit and 200 Gwei gas = 4 Matic, for Avalanche the block gas limit seems to be 8M and the price ~30 nAVAX = 0.24 AVAX). Plus, the operator isn’t going to receive that amount.

Proof of Concept

The following test demonstrates this scenario:

diff --git a/test/06_cross-chain_minting_tests_l1_l2.ts b/test/06_cross-chain_minting_tests_l1_l2.ts
index 1f2b959..a1a23b7 100644
--- a/test/06_cross-chain_minting_tests_l1_l2.ts
+++ b/test/06_cross-chain_minting_tests_l1_l2.ts
@@ -276,6 +276,7 @@ describe('Testing cross-chain minting (L1 & L2)', async function () {
             gasLimit: TESTGASLIMIT,
           })
         );
+        estimatedGas = BigNumber.from(50_000_000);
         // process.stdout.write('\n' + 'gas estimation: ' + estimatedGas.toNumber() + '\n');

         let payload: BytesLike = await l1.bridge.callStatic.getBridgeOutRequestPayload(
@@ -303,7 +304,8 @@ describe('Testing cross-chain minting (L1 & L2)', async function () {
             '0x' + remove0x((await l1.operator.getMessagingModule()).toLowerCase()).repeat(2),
             payload
           );
-
+        estimatedGas = BigNumber.from(5_000_000);
+
         process.stdout.write(' '.repeat(10) + 'expected lz gas to be ' + executeJobGas(payload, true).toString());
         await expect(
           adminCall(l2.mockLZEndpoint.connect(l2.lzEndpoint), l2.lzModule, 'lzReceive', [
@@ -313,7 +315,7 @@ describe('Testing cross-chain minting (L1 & L2)', async function () {
             payload,
             {
               gasPrice: GASPRICE,
-              gasLimit: executeJobGas(payload),
+              gasLimit: 5_000_000,
             },
           ])
         )

The test would fail with the following output:

  1) Testing cross-chain minting (L1 & L2)
       Deploy cross-chain contracts via bridge deploy
         hToken
           deploy l1 equivalent on l2:
     VM Exception while processing transaction: revert HOLOGRAPH: not enough gas left

Recommended Mitigation Steps

Limit the gasLimit to the maximum realistic amount that can be used on the dest chain (including the gas used up to the point where it’s checked).

ACC01ADE (Holograph) confirmed and commented:

Good idea to generally limit the maximum gas allowed in an operator job.

Feature/HOLO-604: implementing critical issue fixes


The original report as published on Code4rena, by 0xA5DF. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The contract does not cap the user-supplied gas limit to a realistic maximum for the destination chain.

Impact

Operators are locked out of the pod, unable to execute jobs or recover their bond; the attacker must pay a gas fee that may be relatively low on some chains.

What the attacker needed

Ability to initiate a cross-chain job; pay gas fee equivalent to gasPrice * gasLimit

The fix

Limit the gas limit to the maximum realistic amount that can be used on the destination chain, including gas used up to the check.

How it was found

  1. Set a gas limit higher than the destination chain's block gas limit when initiating a cross-chain job.
  2. The operator attempts to execute the job but fails due to insufficient gas left.
  3. The operator is locked out of the pod and cannot recover their bond.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

In a cross-chain system, an operator processes jobs and must ensure enough gas remains. If a user sets a gas limit higher than the destination chain's block gas limit, the operator's transaction always fails, locking the operator out and trapping their bond.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by 0xA5DF

View all

35 more disclosed reports, best first.

More from Holograph contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.