Improper ETH Refund Handling in GatewaySend.onRevert()
The GatewaySend contract's onRevert() function uses an ERC20 transfer helper to refund native ETH, which fails because ETH is not an ERC20 token. As a result, ETH from failed cross-chain transactions remains trapped in the contract, preventing users from recovering their funds.
Source: https://github.com/sherlock-audit/2025-05-dodo-cross-chain-dex-judging/issues/905
Found by
0xEkko, 0xc0ffEE, 0xlucky, Abhan1041, AnomX, AshishLac, ChaosSR, Goran, IvanFitro, Kirkeelee, Ob, PratRed, SafetyBytes, X0sauce, benjamin_0923, hunt1, radevweb3, roadToWatsonN101, rsam_eth, shushu, tyuuu
Summary
The GatewaySend contract’s onRevert() function mishandles native ETH refunds for failed cross-chain transactions by using TransferHelper.safeTransfer(), which is designed exclusively for ERC20 tokens. When the function attempts to refund ETH, it tries to call an ERC20 transfer() method on this non-existent contract address, causing the transaction to fail. As a result, ETH remains trapped in the contract, preventing users from recovering their funds.
Root Cause
Internal Pre-conditions
N/A
External Pre-conditions
N/A
Attack Path
A user attempts to bridge 3 ETH from Ethereum to polygon Chain via depositAndCall(). The transaction fails on the destination chain, and the ZetaChain Gateway returns the ETH to GatewaySend. The onRevert() function tries to refund the ETH using TransferHelper.safeTransfer(ETH_ADDRESS, user, 3 ETH), which fails because ETH_ADDRESS is not an ERC20 contract. The ETH remains stuck in the contract, leaving the user unable to recover their funds.
Impact
Fund Lockup: ETH from failed transactions becomes trapped, causing permanent loss for users.
User Experience Degradation: Inability to recover funds undermines trust in the bridging system.
PoC
No response
Mitigation
native transfer should be handle in onRevert()
Discussion
sherlock-admin2
The protocol team fixed this issue in the following PRs/commits: https://github.com/Skyewwww/omni-chain-contracts/pull/26
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 onRevert() function uses TransferHelper.safeTransfer() for native ETH, which is designed for ERC20 tokens and cannot handle ETH transfers.
Impact
ETH from failed transactions becomes permanently trapped in the contract, causing loss for users and undermining trust in the bridging system.
What the attacker needed
User bridges ETH via depositAndCall(); Transaction fails on destination chain
The fix
The protocol team fixed this issue by handling native transfers in onRevert().
How it was found
- A user calls depositAndCall() to bridge 3 ETH from Ethereum to Polygon.
- The transaction fails on the destination chain.
- The ZetaChain Gateway returns the ETH to GatewaySend.
- The onRevert() function attempts to refund the ETH using TransferHelper.safeTransfer(ETH_ADDRESS, user, 3 ETH).
- The transfer fails because ETH_ADDRESS is not an ERC20 contract.
- The ETH remains stuck in the contract.
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.
When a cross-chain transaction fails, the contract tries to give the user their ETH back. But it uses a method meant only for tokens like USDC, not for ETH itself. So the refund fails and the ETH gets stuck in the contract forever.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.