You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add validation for leading whitespace in BOLT 12 bech32 strings
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
let encoded_offer = "lno1pqps7sjqpgtyzm3qv4uxzmtsd3jjqer9wd3hy6tsw35k7msjzfpy7nz5yqcnygrfdej82um5wf5k2uckyypwa3eyt44h6txtxquqh7lz5djge4afgfjn7k4rgrkuag0jsd5xvxo";
0 commit comments