[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 小时
- 30 天内合并 PR
- 82
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
braintrustdata/braintrust-sdk-javascript#2659 ·
维护者通常 1 天内回复
-
body-parser 2.3.0 in the published ai-dial-chat-bff image is vulnerable (CVE-2026-111181, HIGH)可能已有人在做 @illya-havsiyevych 今天认领。 未关闭bug
难度 1/5 1-3 小时 新手友好度 87/100
epam/ai-dial-chat#9566 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
はさみアイコンを修正する未关闭bug
难度 1/5 1 小时以内 新手友好度 68/100
-
area: core
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复