Skip to content

Bug: OTC bridge allows order cancellation by anyone who knows wallet address #4957

@508704820

Description

@508704820

Bug: OTC bridge cancel/match endpoints lack cryptographic authentication

Severity: HIGH

Description

The OTC bridge API endpoints for order matching and cancellation verify identity by wallet address only, without any cryptographic proof of ownership:

# cancel_order: Only checks if wallet matches
if order["maker_wallet"] != wallet:
    return jsonify({"error": "Only the order creator can cancel"}), 403

Impact

  1. Unauthorized cancellation: Wallet addresses are public (visible in order book). Anyone who knows a maker's wallet address can cancel their orders.
  2. Unauthorized matching: Anyone can match orders as a taker by providing any wallet address.
  3. Order manipulation: Attackers can cancel competitors' orders to manipulate the order book.
  4. Wallet validation is minimal: Only requires len(wallet) > 3 — accepts almost any string.

Suggested Fix

  1. Ed25519 signature verification — require a signed message proving wallet ownership
  2. Session-based auth — require login before trading
  3. Stricter wallet validation — verify RTC or 0x format, not just length > 3
  4. Order authentication — orders should be bound to a public key, not just a wallet string

Wallet: RTC9d7caca3039130d3b26d41f7343d8f4ef4592360

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions