TON Gateway withdrawals can be DOS'd with an invalid withdrawal recipient
0x73696d616f Follow with g
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2025-04-zetachain-cross-chain-judging/issues/367
Found by
0x73696d616f, g
Summary
Unlike in Gateway contracts in other chains, there is only one way to increment the nonce in the Ton Gateway contract. The nonce is only incremented in handle_withdrawal().
Any failure in handle_withdrawal before the nonce is incremented and committed will prevent withdrawals with higher nonces from getting executed.
Root Cause
There is no way to increment the nonce other than through handle_withdrawal().
state::total_locked -= (amount + tx_fee);
state::seqno += 1;
mutate_state();
commit();
Internal Pre-conditions
None
External Pre-conditions
None
Attack Path
- A user withdraws TON coins from Zetachain, triggering an Outbound Withdrawal to TON. The Outbound Withdrawal has a nonce of 5 and a receiver of
{workchain: 1, recipient_addr: 0xted}. - An Observer executes the Outbound Withdrawal and it fails with a wrong workchain error.
- The nonce in the TON Gateway contract stays at nonce 5 because it does not get incremented and committed.
- Outbound Withdrawals with nonce greater than 5 will fail because of this check.
Impact
Withdrawals to the TON Gateway contract are DOS'd indefinitely.
PoC
No response
Mitigation
Consider applying the same increment_nonce approach that is applied to the Solana Gateway contract.
Discussion
sherlock-admin2
The protocol team fixed this issue in the following PRs/commits: https://github.com/zeta-chain/node/pull/3977
gjaldon
The issue is fixed by calling IncreaseSeqno in the Gateway when an invalid workchain is used.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is known
A medium-severity doS bug in ZetaChain Cross-Chain. Sherlock made it public on 28 May 2025. Found in the 857 audit contest (finding M-33), also found by 1 other warden.
About DoS
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
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.