Repository navigation
fix: protect transaction broadcast requests against SSRF - #25
Merged
Merged
Conversation
A mempool broadcast is not a callback URL, so inheriting the administrator's LNbits callback URL rules could reject an otherwise valid public mempool endpoint (e.g. https://mempool.space) after unrelated callback settings were changed. Use SafeHttpClient(apply_callback_rules=False) for the broadcast, keeping all destination checks: private, loopback, link-local/metadata and self-targeted endpoints remain blocked. Add regression tests for the broadcast sink: - private/loopback/LAN/DNS-alias/metadata/self destinations are blocked with a generic error and no outbound request - public endpoint still works (Mainnet and Testnet paths) - restrictive admin callback rules do not affect the broadcast - backend response details are not leaked in the API error Document that broadcast requires a public mempool endpoint and that self-hosted Mempool instances need a publicly reachable URL.
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.
No description provided.