fix(docs): client-side nonce in SIWE example is insecure — add server-side nonce warning
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 58/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- javascript, typescript
- Lĩnh vực
- authentication, documentation, security
Hướng nghiên cứu
Mở docs/mini-apps/quickstart/migrate-to-standard-web-app.mdx và tìm phần “Replace auth and identity” cùng ví dụ SignIn.tsx của phần đó. Xem lại disclaimer hiện có và cập nhật hướng dẫn trong ví dụ để giải thích rõ ràng rủi ro đối với cơ chế chống replay của các nonce do client tạo ra hoặc hướng người đọc đến một pattern nonce do server cấp; được xem là hoàn tất khi cảnh báo nổi bật và tài liệu được render chính xác.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- SIWE spec: https://eips.ethereum.org/EIPS/eip-4361
- Related fix merged in this repo: #1398
- Ngôn ngữ chính
- JavaScript
- Star
- 337
- Fork
- 798
- Merge trung bình
- 13 giờ 7 phút
- Pull request đã merge (30 ngày)
- 57
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của base/docs
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
area-deployment area-integrations triage:bot-seen
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 86/100
-
Issue-Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
sugarlabs/musicblocks#8924 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
ArduPilot/ardupilot_wiki#8088 ·
-
[BUG] createTool tools cannot be registered with Mastra when exactOptionalPropertyTypes is enabled Đang mởcustomer-eng status: needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100