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.
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
- An attacker with WithdrawCap can continue to withdraw funds even when the system is in a paused state
- This could be exploited during emergency situations when the system should be completely paused
- The attacker could withdraw funds from gateway vaults while legitimate deposits are blocked
Impact
- Withdrawals can continue even when the system should be completely paused
- 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.
assert!(!gateway.paused, EPaused);
This will ensure that withdrawals are properly paused when the system is in a paused state.
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
- An attacker with WithdrawCap can continue to withdraw funds even when the system is in a paused state
- This could be exploited during emergency situations when the system should be completely paused
- 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.