Skip to content

fix: broaden Sui signer cancel fallback to handle all withdrawAndCall build errors #4578

Open

Description

@kingpinXD

Summary

The Sui signer's broadcastWithdrawalWithFallback in signer_tx.go only catches ErrInvalidPayload and ErrObjectOwnership sentinel errors before calling broadcastCancelTx. Any other builder error falls through to case err != nil which returns without sending a cancel (nonce-increment) transaction. This freezes the Sui gateway nonce and silently blocks all subsequent outbounds.

Multiple attack vectors trigger this via generic fmt.Errorf returns:

  • Immutable object ID in payload (ZCNode-233): ExtractInitialSharedVersion returns bare fmt.Errorf
  • Invalid Sui type argument (ZCNode-245): TypeTagFromString returns bare fmt.Errorf

HackenProof reports: ZCNode-233, ZCNode-245

Affected Files

  • zetaclient/chains/sui/signer/signer_tx.go — broadcastWithdrawalWithFallback switch statement (lines 274-286)
  • pkg/contracts/sui/withdraw_and_call.go — ExtractInitialSharedVersion returns generic error
  • pkg/contracts/sui/ptb_argument.go — TypeTagFromString returns generic error

Recommended Fix

Either broaden the cancel fallback to handle all build errors:

case err != nil:
    return s.broadcastCancelTx(ctx, cancelTxBuilder)

Or wrap all builder error returns with the appropriate sentinel (ErrInvalidPayload / ErrObjectOwnership).

Impact

Externally triggerable. Any user can freeze the Sui outbound queue by submitting a withdrawAndCall with a crafted payload. No funds are extracted but all Sui outbounds are blocked until manual admin intervention.

Activity

  1. added
    zetaclient
    on Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug_bountyzetaclient

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions