Skip to content

fix: protect transaction broadcast requests against SSRF - #25

Merged
talvasconcelos merged 3 commits into
mainfrom
http_fix
Nov 9, 2026
Merged

talvasconcelos merged 3 commits into
mainfrom
http_fix

Conversation

@arcbtc

@arcbtc arcbtc commented Nov 8, 2026

Copy link
Copy Markdown
Member

No description provided.

arcbtc and others added 3 commits November 8, 2026 23:10
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.
@talvasconcelos
talvasconcelos merged commit 7c77659 into main Nov 9, 2026
7 checks passed
@talvasconcelos
talvasconcelos deleted the http_fix branch November 9, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants