fix(nut17): decode notification payloads with subscription kind#2210
Merged
Conversation
3 tasks
b25772f to
8b002eb
Compare
Collaborator
Author
|
@cdk-bot review |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2210 +/- ##
==========================================
- Coverage 72.95% 72.93% -0.02%
==========================================
Files 359 359
Lines 79276 79452 +176
==========================================
+ Hits 57834 57952 +118
- Misses 21442 21500 +58 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
cdk-bot
reviewed
Jul 7, 2026
cdk-bot
left a comment
Collaborator
There was a problem hiding this comment.
Verified findings approved for disclosure:
- Kind-aware notification decoding rejects case-insensitive PaymentMethod values (low) - A notification payload with a semantically matching but non-lowercase standard method, such as
"BOLT11"for abolt11_mint_quotesubscription, is rejected beforePaymentMethodcan normalize it. In the wallet subscription stream this parsing error is propagated, terminating message processing for that stream.
Additional locations included in summary:- crates/cashu/src/nuts/nut17/mod.rs:318
8b002eb to
419878e
Compare
Collaborator
Author
|
@cdk-bot review |
NUT-17 notification payloads are ambiguous without the subscription kind. Quote response shapes overlap and tolerate unknown fields, so shape-based decoding can select the wrong payload variant. Add a kind-aware payload decoder and use it in the wallet subscription client while preserving the existing generic payload deserialization surface for backports. This prevents onchain and custom quote notifications from being decoded as the wrong payload variant.
419878e to
ba17883
Compare
Collaborator
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin v0.17.x
git worktree add -d .worktree/backport-2210-to-v0.17.x origin/v0.17.x
cd .worktree/backport-2210-to-v0.17.x
git switch --create backport-2210-to-v0.17.x
git cherry-pick -x ba17883082b80be99b293c1bf4537533aa915ecd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NUT-17 notification payloads are ambiguous without the subscription kind. Quote response shapes overlap and tolerate unknown fields, so shape-based decoding can select the wrong payload variant.
Add a kind-aware payload decoder and use it in the wallet subscription client while preserving the existing generic payload deserialization surface for backports.
This prevents onchain and custom quote notifications from being decoded as the wrong payload variant.
Description
Notes to the reviewers
Suggested CHANGELOG Updates
CHANGED
ADDED
REMOVED
FIXED
Checklist
just quick-checkbefore committingcrates/cdk-ffi)