Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[Audit] Duplicate/retried withdraw requests double-count `withdrawnAmount`

Đang mở
#1,216 6 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 7 ngày

@Martinsbab đang làm issue này rồi.

Từ ngày 29/8/2026.

  • #1 của @freebuff-web — đang mở
  • #1410 của @Martinsbab — đang mở

Đánh giá

Issue này chưa được đánh giá.

Mô tả

backend bug second-wave-audit Stellar Wave

Filed from the second-wave repository audit (issue 14/100). See the audit summary for full category context.

  • Location: backend/src/routes/v1/streams/withdraw.ts:106-144
  • Problem: sorobanWithdraw returns a deterministic, non-unique txHash ('simulated-withdraw-' + streamId), so the StreamEvent upsert (keyed on transactionHash+eventType) correctly no-ops on a retry — but the adjacent prisma.stream.update that increments withdrawnAmount is not guarded by the same dedup check and runs unconditionally on every call.
  • Evidence: StreamEvent upsert has an update: {} no-op branch; the stream.update above it has no equivalent guard.
  • Suggested implementation: Wrap both writes in one transaction gated by the same duplicate-event check, or make the balance update itself idempotent (compute from indexed on-chain state rather than incrementing).
  • Acceptance criteria: Calling withdraw twice for the same claimable window increases withdrawnAmount by the claimed amount exactly once, verified by a new integration test.
  • Difficulty: M
  • Expected impact: Fixes a real fund-accounting bug reachable via a simple double-click or client retry.
Ngôn ngữ chính
TypeScript
Star
18
Fork
250
Merge trung bình
5 ngày 6 giờ
Pull request đã merge (30 ngày)
82

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của LabsCrypt/flowfi

Tất cả issue của LabsCrypt/flowfi

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.