Skip to content

security: cross-chain retry may mask permanent insufficient funds error #11

@owenwahlgren

Description

@owenwahlgren

Description

The isRetryableImportError function in pkg/crosschain/transfer.go uses string matching to classify errors as retryable. The pattern "insufficient funds" could match both transient UTXO propagation issues and permanent balance insufficiency.

Current behavior

retryablePatterns := []string{
    "not found",
    "no utxos",
    "insufficient funds", // May occur if UTXOs haven't propagated
    "missing utxo",
}

If a user truly has insufficient funds, the CLI retries multiple times before failing, wasting time.

Suggested improvements

  • Check for specific SDK error types instead of string matching
  • Add max retry duration in addition to max attempts
  • Log each retry attempt so users understand what's happening
  • Consider distinguishing between "no UTXOs at all" (permanent) vs "UTXOs not yet visible" (transient)

Files affected

  • pkg/crosschain/transfer.go:164-182

Severity

Minor - causes delayed error reporting, not incorrect behavior

Source

Production readiness audit (2026-02-09)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions