Skip to content

fix(docs): client-side nonce in SIWE example is insecure — add server-side nonce warning #1452

@maho0638

Description

@maho0638

Problem

File: docs/mini-apps/quickstart/migrate-to-standard-web-app.mdx
Section: "Replace auth and identity" → SignIn.tsx code example

The example uses generateSiweNonce() on the client side:

const nonce = generateSiweNonce();

A client-generated nonce provides no replay protection. Any attacker who
intercepts a valid SIWE message+signature pair can reuse it, because the
server has no record of which nonces it issued.

Current behavior

The nonce is generated in the browser and never validated server-side.
The existing disclaimer is easy to miss and does not explain why the
current pattern is unsafe.

Expected behavior

Add a prominent warning block above the code example explaining that
client-side nonces offer no replay protection, OR replace the example
with a server-issued nonce pattern.

Impact

Developers following this migration guide verbatim will ship apps with
broken replay protection, exposing users to signature replay attacks.

References

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