[Audit] Duplicate/retried withdraw requests double-count `withdrawnAmount`
メンテナーはふだん 7 日以内に返信
評価
この issue はまだ評価されていません。
説明
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:
sorobanWithdrawreturns a deterministic, non-uniquetxHash('simulated-withdraw-' + streamId), so theStreamEventupsert (keyed ontransactionHash+eventType) correctly no-ops on a retry — but the adjacentprisma.stream.updatethat incrementswithdrawnAmountis not guarded by the same dedup check and runs unconditionally on every call. - Evidence:
StreamEventupsert has anupdate: {}no-op branch; thestream.updateabove 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
withdrawnAmountby 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
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
LabsCrypt/flowfi のほかの issue
-
backend points: 150 testing
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 7 日以内に返信
-
backend points: 150 testing
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 7 日以内に返信
-
backend points: 150 testing
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 7 日以内に返信
-
backend points: 150 testing
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 7 日以内に返信
-
backend points: 150 testing
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 7 日以内に返信
LabsCrypt/flowfi の issue をすべて見る
似ている issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 82/100
source-cooperative/docs.source.coop#41 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Nimblesite/SharpLsp#468 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
solidjs-community/solid-primitives#1082 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信