-
Notifications
You must be signed in to change notification settings - Fork 425
feat: add validation for leading whitespace in BOLT 12 bech32 strings #3998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add validation for leading whitespace in BOLT 12 bech32 strings #3998
Conversation
|
👋 I see @joostjager was un-assigned. |
24d25bb to
cc0947a
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3998 +/- ##
==========================================
- Coverage 88.97% 88.94% -0.04%
==========================================
Files 174 174
Lines 124161 124593 +432
Branches 124161 124593 +432
==========================================
+ Hits 110470 110814 +344
- Misses 11216 11285 +69
- Partials 2475 2494 +19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
cc0947a to
45afedb
Compare
Found through differential fuzzing between C-Lightning and rust-lightning: rust-lightning incorrectly accepted offers starting with whitespace when continuation characters (+) were present, while C-Lightning correctly rejected them per BOLT 12 specification. - Add InvalidLeadingWhitespace error variant to Bolt12ParseError - Validate that bech32 strings don't start with whitespace characters - Separate validation logic for first chunk vs continuation chunks - Add test case for leading whitespace validation
45afedb to
29dfc1f
Compare
TheBlueMatt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
|
👋 The first review has been submitted! Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer. |
Through differential fuzzing between C-Lightning and rust-lightning, I discovered that rust-lightning incorrectly accepts BOLT 12 offers that start with whitespace when they contain continuation characters (+).
Expected behavior: Both implementations should reject this offer
Actual behavior:
This pr check that the first chunk doesn't contain whitespace characters without trimming it.