Skip to content
DoS Audit finding Intermediate

ETH Address Approval Attempt Causes All Zeta Swaps to Revert

The contract unconditionally calls approve() on the ETH placeholder address, which is not a valid ERC20 contract, causing all swaps involving ETH to revert. This makes the Zeta swap functionality completely non-functional for all users.

0xc0ffEE Follow with 10ap17, AnomX and 10 others

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2025-05-dodo-cross-chain-dex-judging/issues/304

Found by

0xc0ffEE, 10ap17, AnomX, Cybrid, IvanFitro, SarveshLimaye, elolpuer, eta, farismaulana, shushu, silver_eth, the_haritz, wellbyt3

Summary

Attempting to call approve() on the ETH placeholder address will cause transaction reverts for all users trying to swap ETH as the contract treats the non-contract ETH address as an ERC20 token.

https://github.com/sherlock-audit/2025-05-dodo-cross-chain-dex/blob/main/omni-chain-contracts/contracts/GatewayTransferNative.sol#L425-L434

Root Cause

In GatewayTransferNative_doMixSwap , the contract unconditionally calls IZRC20(params.fromToken).approve(DODOApprove, amount) without checking if params.fromToken is the ETH placeholder address (0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE), which is not a valid contract.

A similar issue exists in the GatewayCrossChain contract, where approve() is also called without validating whether the token is native ETH.

Internal Pre-conditions

  1. User needs to call withdrawToNativeChain() with zrc20 parameter as _ETH_ADDRESS_
  2. The decoded message needs to contain swapData.length > 0 to trigger the swap logic

External Pre-conditions

None

Attack Path

  1. User calls withdrawToNativeChain() with ETH address and swap data
  2. Function calls _doMixSwap() with params.fromToken set to ETH address
  3. _doMixSwap() attempts to call approve() on the ETH placeholder address
  4. Transaction reverts because ETH address is not a valid ERC20 contract

Impact

All users attempting to swap Zeta cannot execute their transactions, making the Zeta swap functionality completely non-functional.

PoC

No response

Mitigation

Diff
function _doMixSwap(
    bytes memory swapData, 
    uint256 amount, 
    MixSwapParams memory params
) internal returns (uint256 outputAmount) {
    if (swapData.length == 0) {
        return amount;
    }

-   IZRC20(params.fromToken).approve(DODOApprove, amount);
+   if (params.fromToken != _ETH_ADDRESS_) {
+       IZRC20(params.fromToken).approve(DODOApprove, amount);
+   }

Discussion

sherlock-admin2

The protocol team fixed this issue in the following PRs/commits: https://github.com/Skyewwww/omni-chain-contracts/pull/28/files

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

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 check if the token address is the special ETH placeholder before calling approve() on it.

Impact

All users attempting to swap Zeta cannot execute their transactions, making the Zeta swap functionality completely non-functional.

What the attacker needed

User calls withdrawToNativeChain with ETH address; Swap data length > 0

The fix

The protocol team fixed this issue by adding a check to skip the approve call when the token is the ETH placeholder address.

How it was found

  1. User calls withdrawToNativeChain() with ETH address and swap data
  2. Function calls _doMixSwap() with params.fromToken set to ETH address
  3. _doMixSwap() attempts to call approve() on the ETH placeholder address
  4. Transaction reverts because ETH address is not a valid ERC20 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.

In blockchain, some tokens are actually just placeholders for the native currency (like ETH). The contract mistakenly tries to call a function on this placeholder as if it were a real token contract, which fails and cancels the whole transaction. This means nobody can swap ETH through this service.

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 0xc0ffEE

View all

27 more disclosed reports, best first.

More from DODO Cross-Chain DEX

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.