Skip to content

Signature replay vulnerability: domain hash missing wallet identifier #14

Description

@Rapha-btc

Description:

Summary

Found a potential signature replay vulnerability in the domain hash generation. If a single pubkey controls multiple smart wallets, signatures can be replayed across wallets because the domain hash doesn't include the wallet address.

The Issue

The current domain hash doesn't bind signatures to a specific wallet. If a user deploys multiple smart wallets with the same pubkey, a valid signature for one wallet can be replayed on another.

Suggested Fix

Add contract-caller to the domain hash:

(define-read-only (get-domain-hash) 
  (sha256 (unwrap-panic (to-consensus-buff? { 
    name: "smart-wallet-standard", 
    version: "1.0.0", 
    chain-id: chain-id, 
    wallet: contract-caller,  ;; <-- Add this
  })))
)

This ensures each signature is bound to a specific wallet contract.

Proof of Concept

Mainnet txs:


Credit: Rapha.btc | fak.fun | https://pillarbtc.com/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions