Skip to content

btcpayserver: use a neutral SSRF exception example and test the internal Lightning path - #144

Merged
seberm merged 1 commit into
bitcoinix:masterfrom
ostermayer:btcpay-ssrf-docs-test
Oct 25, 2026
Merged

seberm merged 1 commit into
bitcoinix:masterfrom
ostermayer:btcpay-ssrf-docs-test

Conversation

@ostermayer

Copy link
Copy Markdown
Collaborator

Follow-up to #125, as asked there.

The docs and the 0.1.2 message showed 127.0.0.1:8080 as an ssrfexceptions example, but that is lnd's REST port. Copying it would let anyone who can set a webhook, a notification URL or a Lightning address make BTCPay send requests to lnd. Both places now show 192.168.1.50:8443;10.8.0.0/24, and docs/configuration.md says that exceptions stay narrow, never cover the ports of node services, and that a hostname entry trusts every address it resolves to.

The btcpayserver test curls lnd itself, so BTCPay's own HTTP client never ran against the internal node and "the Lightning node is unaffected" was untested. The regtest test now creates the first admin over Greenfield, reads GET /api/v1/server/lightning/BTC/info with that account and checks the block height against the mined blocks, then waits for GET /api/v1/health to report synchronized: true. The login is tried first, so a rerun of the test in a debug VM doesn't fail on the second creation.

netnsRegtest passed twice on a KVM host, once before and once after the rerun guard. The Lightning info answered in under a second with the right height and health went synchronized after about 55 seconds.

DeepSeek V4.1 Flash 1017 run at max reasoning timed out without a verdict. GLM 5.3 run at max reasoning reviewed the tree at 4ddff0e and found nothing in the files this change touches. Codex (GPT-6 Astra, xhigh) read the diff and found one thing, a rerun of the test would fail on the second admin creation, and that is fixed.

@github-actions github-actions Bot added area: ci .github/, test/, dev/ area: docs docs/, README, examples/, SECURITY.md, book.toml, assets area: modules modules/ and pkgs/lib.nix labels Oct 24, 2026
…nal Lightning path

The docs and the 0.1.2 message showed 127.0.0.1:8080 as an exception, which
is lnd's REST port. Copying it would let anyone who can set a webhook, a
notification URL or a Lightning address make BTCPay send requests to lnd.
Use a LAN host instead and say that exceptions stay narrow, never cover node
service ports, and that a hostname trusts every address it resolves to.

The btcpayserver test curls lnd itself, so BTCPay's own HTTP client never
ran against the internal node. The regtest test now creates the first admin
over Greenfield and reads the Lightning node info and the health endpoint,
which fails if the SSRF protection ever covers the Lightning client.
@seberm
seberm force-pushed the btcpay-ssrf-docs-test branch from 4ddff0e to dce7a15 Compare October 25, 2026 08:45
@seberm
seberm enabled auto-merge October 25, 2026 08:48
@seberm
seberm merged commit f6a3898 into bitcoinix:master Oct 25, 2026
12 checks passed
@ostermayer
ostermayer deleted the btcpay-ssrf-docs-test branch November 8, 2026 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci .github/, test/, dev/ area: docs docs/, README, examples/, SECURITY.md, book.toml, assets area: modules modules/ and pkgs/lib.nix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants