Repository navigation
Reject LSPS1 orders with the wrong refund address - #1131
Merged
tnull merged 1 commit intoOct 8, 2026
Merged
Conversation
|
👋 Thanks for assigning @tnull as a reviewer! |
tnull
reviewed
Oct 7, 2026
| fn check_refund_address<'a>( | ||
| payment_options: &'a LSPS1PaymentInfo, expected: &bitcoin::Address, | ||
| ) -> Result<(), &'a bitcoin::Address> { | ||
| match payment_options.onchain.as_ref().and_then(|o| o.refund_onchain_address.as_ref()) { |
Collaborator
There was a problem hiding this comment.
Can we just inline these 4 lines? Also no need to add 5 lines of comments for it.
When we create an LSPS1 order, we now check the refund address in the LSP's response. If the LSP returns an on-chain payment option whose refund_onchain_address doesn't match the one we sent, we reject the order. A response without the field is still accepted, since the field is optional. This guards against buggy or misconfigured LSPs. It isn't theft protection: a malicious LSP can just decline to refund. Reported by Project Loupe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
benthecarman
force-pushed
the
lsps1-refund-address-validation
branch
from
October 7, 2026 18:32
406b838 to
6b07d50
Compare
tnull
approved these changes
Oct 8, 2026
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.
When we create an LSPS1 order, we now check the refund address in the LSP's response. If the LSP returns an on-chain payment option whose
refund_onchain_addressdoesn't match the one we sent, we reject the order. A response without the field is still accepted, since the field is optional.This guards against buggy or misconfigured LSPs. It isn't theft protection: a malicious LSP can just decline to refund.
Reported by Project Loupe.