Skip to content

Implement cryptographic signature verification for wallet linking endpoint #70

@coderabbitai

Description

@coderabbitai

Description

The wallet linking endpoint at app/api/reputation/link-wallet/route.ts currently has signature verification mocked with isValidSignature = true (line 22). This needs to be replaced with real cryptographic verification before production release.

Context

Currently, any authenticated user can link any wallet address without proving ownership, which creates a security vulnerability.

Tasks

  • Implement real signature verification using verifyMessage from ethers or viem
  • Verify the recovered address matches the provided address
  • Handle verification failures with appropriate 403 error responses
  • Add proper error handling for invalid signatures

Related

Priority

This is a security issue and should be addressed before the reputation system goes to production.

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