Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#1,216 コメント 6 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 7 日以内に返信

@Martinsbab がすでに取り組んでいます。

2026年8月29日 から。

  • #1 @freebuff-web による — オープン
  • #1410 @Martinsbab による — オープン

評価

この issue はまだ評価されていません。

説明

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.
主要言語
TypeScript
スター
18
フォーク
250
平均マージ
5日 6時間
マージ済み PR(30日)
82

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

LabsCrypt/flowfi のほかの issue

LabsCrypt/flowfi の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。