Skip to content
Access control Audit finding Intermediate

Inconsistent Pause Mechanism Allows Withdrawals During Emergency Pause

The withdraw_impl function in gateway.move lacks a pause check, unlike deposit functions. An attacker with a valid WithdrawCap could withdraw funds even when the system is paused.

0xC2939291 Follow with Al-Qa-qa, Alpha and 5 others

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2025-04-zetachain-cross-chain-judging/issues/410

Found by

0xC2939291, Al-Qa-qa, Alpha, Goran, Laksmana, ifeco445, pks_, zanderbyte

Summary

The withdraw_impl function in gateway.move lacks a pause mechanism, unlike the deposit functionality which has proper pause checks. This creates an inconsistency in the security controls and could allow withdrawals to continue even when the system should be paused.

Root Cause

The withdraw_impl function does not have a pause flag, while the deposit functions (check_receiver_and_deposit_to_vault) have the flag. This creates a security gap where withdrawals can continue even when deposits are paused.

https://github.com/sherlock-audit/2025-04-zetachain-cross-chain/blob/main/protocol-contracts-sui/sources/gateway.move#L271-L282

Internal Pre-conditions

  • The caller must have a valid WithdrawCap
  • The coin type must be whitelisted
  • The nonce must match the current gateway nonce

External Pre-conditions

  • The caller must have permission to call the function
  • The system(gateway vault) must have sufficient balance for the withdrawal

Attack Path

  1. An attacker with WithdrawCap can continue to withdraw funds even when the system is in a paused state
  2. This could be exploited during emergency situations when the system should be completely paused
  3. The attacker could withdraw funds from gateway vaults while legitimate deposits are blocked

Impact

  1. Withdrawals can continue even when the system should be completely paused
  2. Different security controls for deposits and withdrawals create confusion and potential vulnerabilities

PoC

No response

Mitigation

Add a paused variable to Gateway struct and use this check in both deposits and withdrawals.

MOVE
assert!(!gateway.paused, EPaused);

This will ensure that withdrawals are properly paused when the system is in a paused state.

The original report as published on Sherlock, by 0xC2939291. 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

Impact

Withdrawals can continue even when the system should be completely paused, potentially allowing an attacker with WithdrawCap to withdraw funds during an emergency.

What the attacker needed

Caller has a valid WithdrawCap; coin type is whitelisted; nonce matches current gateway nonce; gateway vault has sufficient balance

The fix

Add a paused variable to the Gateway struct and check it in both deposits and withdrawals.

How it was found

  1. An attacker with WithdrawCap can continue to withdraw funds even when the system is in a paused state
  2. This could be exploited during emergency situations when the system should be completely paused
  3. The attacker could withdraw funds from gateway vaults while legitimate deposits are blocked

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 smart contract has a pause feature to stop all activity in an emergency. The deposit function respects this pause, but the withdrawal function does not. So someone with permission to withdraw could still take funds out while the system is supposed to be frozen.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More from ZetaChain Cross-Chain

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.