Economic DoS (Griefing) on IBC Relayers via `memo` Callback Gas Exploitation
The IBC callbacks middleware allows a sender to specify a memo that triggers a callback contract consuming nearly the maximum allowed gas while still returning success. An attacker can repeatedly send such packets, forcing permissionless relayers to pay high gas costs with little or no fee, leading to financial losses and eventual denial of service on the channel.
- Disclosed after 34 days
Summary of Impact
This vulnerability allows an attacker to bypass the relayer's simulation defense and force permissionless relayers to execute computationally expensive, but 'successful', transactions via the memo callback feature.
This creates an asymmetric economic attack where the relayer's cost (e.g., ~1,000,000 gas) vastly exceeds their profit leading to financial losses.
Relayers will be forced to stop servicing the affected IBC channel to avoid bankruptcy, causing a Denial of Service (DoS) for all applications relying on that channel's callbacks.
Steps to Reproduce
-
Identify the Callback Gas Limit: An attacker first inspects the chain's application setup file (e.g.,
app/app.go) to find the hardcoded gas limit for the IBC Callbacks middleware. -
I have confirmed this value is set to 1,000,000 gas in the main application configuration.
-
Deploy a Malicious 'Gas Burner' Contract: The attacker deploys an EVM smart contract that performs computationally expensive operations (e.g., loops, hashing) designed to consume just under the limit (e.g., 990,000 gas) and then return 'success'.
-
This contract must not fail with 'Out of Gas' (OOG).
-
Send an IBC Packet with Malicious Memo: The attacker sends a standard IBC packet (e.g.,
MsgTransfer) and includes amemofield specifying the address of the 'Gas Burner' contract as the source callback. -
Relayer Simulation is Bypassed: A relayer bot picks up the acknowledgment (
MsgAcknowledgement) for this packet and runs a simulation. -
Because the callback consumes 990,000 gas (which is less than the 1,000,000 limit) and returns 'success', the simulation passes, falsely identifying the transaction as safe.
-
Relayer Incurs Financial Loss: The relayer broadcasts the 'successful' transaction. The chain executes it, including the 990,000 gas callback.
-
The relayer must pay the full gas cost (~1,000,000 gas) but only receives their standard fee (which is 0 if ICS-29 is not used, or ~300,000 gas if it is).
-
Result (Griefing): The attacker can repeat this process, draining the relayer's funds at minimal cost, forcing the relayer to abandon the channel.
Mitigation
-
1. Reduce the Gas Limit: The simplest mitigation is to drastically reduce the hardcoded
DefaultGasLimitForCallbackinapp/app.gofrom 1,000,000 to a value much closer to a standard relayer's profit margin. -
2. Implement Dynamic Gas (Better): A more robust solution is to require the sender of the original packet to explicitly define (and pay for) the maximum gas their callback will use, similar to ICS-29 fees.
-
3. Smarter Simulation: Relayer clients could be updated to not only check for 'success' but also to report the total gas consumed by the simulation. Relayers could then set a local policy to reject 'successful' transactions that consume an unprofitable amount of gas.
Reference
-
ICS-29 Fee Middleware: Understanding how relayers are supposed to be paid (and why their profit is often 0 or very low) is key to this economic exploit.
-
Blockchain Griefing Attacks: This is a classic example of a griefing attack, where the attacker's goal is not direct profit, but to cause financial harm to another party to disrupt the network. [Source: scsfg.io - Smart Contract Security Field Guide]
Impact
-
Immediate Relayer Bankruptcy: Any permissionless relayer servicing this chain's callback-enabled channels will be rapidly drained of funds and forced to shut down.
-
Total Channel DoS: When relayers stop servicing the channel, all cross-chain applications that depend on IBC callbacks (e.g., cross-chain DeFi, NFT transfers) will cease to function, effectively freezing assets and operations.
-
Loss of Trust: This attack breaks the fundamental economic incentive for the decentralized relayer network, demonstrating that the chain is economically unsafe to service and undermining trust in the entire IBC ecosystem connected to this chain.
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
Likely the callbacks middleware lets the sender name an arbitrary callback contract via the memo, with a hardcoded gas limit, and relayers simulate only for success, not gas cost versus fee.
Impact
Permissionless relayers could be drained of funds and forced to stop servicing the channel, causing a denial of service for all applications relying on that channel's callbacks.
What the attacker needed
Ability to send IBC packets with a memo; Deploy an EVM contract on the chain; Relayers use simulation for safety
The fix
The gas limit for callbacks should be drastically reduced, or the sender should be required to define and pay for the maximum gas their callback will use, and relayers should reject simulations that consume an unprofitable amount of gas.
How it was found
- Inspect the chain's application setup file to find the hardcoded gas limit for the IBC Callbacks middleware.
- Deploy an EVM smart contract that performs expensive operations consuming just under the limit and returns success.
- Send an IBC packet with a memo field specifying the address of the gas burner contract as the source callback.
- The relayer bot picks up the acknowledgment, runs a simulation, and the simulation passes because the callback succeeds within the gas limit.
- The relayer broadcasts the transaction, pays the full gas cost, but receives little or no fee.
- The attacker repeats the process to drain the relayer's funds and force it to abandon the channel.
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.
A relayer is a bot that delivers messages between blockchains and pays gas fees to do so. This report shows that an attacker can craft a message that makes the relayer do a lot of expensive work while the relayer earns almost nothing, so the relayer loses money and may stop working, breaking the connection.
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.