Skip to content

Contracts: Bound merkle-proof depth in register to prevent gas-exhaustion DoS #739

Description

@joelpeace48-cell

Context

campaign::register(env, participant, leaf, proof) (lib.rs ~L328) verifies a Merkle proof against a
stored root. If proof length is unbounded, an attacker can submit huge proofs to waste resources, and
roots with pathological depth can make legitimate registration too expensive.

Scope

  • Enforce a max proof length / max tree depth.
  • Reject malformed proofs early with a typed error.
  • Document the supported allowlist size vs depth.

Acceptance criteria

  • Oversized proofs revert cheaply.
  • Tests for max-depth boundary and rejection.

Activity

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

    area: smart-contractSoroban Rust contractspriority: highHigh-priority, high-impact workrustPull requests that update rust codesecuritySecurity hardening and scanning

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions