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.
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.
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
- User needs to call
withdrawToNativeChain()withzrc20parameter as_ETH_ADDRESS_ - The decoded message needs to contain
swapData.length > 0to trigger the swap logic
External Pre-conditions
None
Attack Path
- User calls
withdrawToNativeChain()with ETH address and swap data - Function calls
_doMixSwap()withparams.fromTokenset to ETH address _doMixSwap()attempts to callapprove()on the ETH placeholder address- 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
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
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
- User calls withdrawToNativeChain() with ETH address and swap data
- Function calls _doMixSwap() with params.fromToken set to ETH address
- _doMixSwap() attempts to call approve() on the ETH placeholder address
- 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.