audit: swap-fee math silently contributes 0 ppk for proofs on keysets unknown to the wallet's view (PoC reproduced; fix in gonuts-tollgate)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
The bug is in feesForProofs in wallet/wallet.go of the gonuts-tollgate fork (around lines 1934-1944), which adds 0 ppk for proofs whose keyset id is neither active nor in inactiveKeysets. The below-fee refusal in merchant.go (around line 1539) depends on that figure. Start by reproducing with proofs carrying unknown keyset ids, then choose refuse or worst-case counting. Done means an unknown keyset never yields a silent zero fee. The fork is not on this tracker and the design choice is open, so confirm the approach with maintainers first.
Written by the indexing model from the issue text.
Description
From the 2026-10-09 Cashu audit. PoC reproduced against fork d7591d2. Fork-first fix, tracked here (issues disabled on the fork).
Finding
Fork wallet/wallet.go feesForProofs (≈:1934-1944): a proof whose keyset id is neither the active keyset nor in inactiveKeysets adds 0 ppk silently — no error, no refusal.
cashu.Proofs{{Id:"00rotated-away",…},{Id:"00never-seen",…}} → feesForProofs = 0, nil
Path
When the mint's keyset listing prunes/hides the keyset a token's proofs carry (hostile mint, aggressive rotation), the wallet underestimates the fee → the below-fee refusal (merchant.go:1539) never fires → the swap consumes the whole note. Same family as #752's fee edges.
Minimal fix
Unknown keyset in the fee path = refuse (or count worst-case), never silently zero. CWE-682. Severity MEDIUM-LOW (precondition: mint stops listing a still-swappable keyset).
Cross-refs: #703, #752.
- Dominant language
- Go
- Stars
- 12
- Forks
- 14
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 239
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenTollGate/tollgate-module-basic-go
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
OpenTollGate/tollgate-module-basic-go#833 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
OpenTollGate/tollgate-module-basic-go#813 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
OpenTollGate/tollgate-module-basic-go#804 ·
Maintainers usually reply within 1 day
-
go-battery needs an ndsctl on PATH: TestPurchaseSessionGuardHoldsThroughTheOutcomeUnknownWindow fails on bare hosts (passes with stub)Possibly taken @Amperstrand claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OpenTollGate/tollgate-module-basic-go#726 · 2 comments ·
Maintainers usually reply within 1 day
-
rebrand-literal-gutter: uhttpd section-vocabulary check trips on a COMMENT (uhttpd.luci in 92-tollgate-admin-setup:178)Possibly taken @Amperstrand claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OpenTollGate/tollgate-module-basic-go#723 ·
Maintainers usually reply within 1 day
All issues in OpenTollGate/tollgate-module-basic-go
Similar issues
-
automation models
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/TypeScript#64758 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
SocialGouv/iterion#2369 ·
Maintainers usually reply within 1 day
-
daemon/cluster: imageWithDigestString returns the mirror error even when upstream resolves the tagOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
area/ci bug priority/p3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day