#36170 net: require a dedicated bind for automatic Tor
| Reviewability | Reviews | Agreement | Size | ||||
|---|---|---|---|---|---|---|---|
| #36170 net: require a dedicated bind for automatic Tor | Ready | 3 | Strong | 22 + 24 tests | |||
|
|
|
|
| |||
Reviewability: ReadyStalePaused Agreement: StrongPositivePositive w/ caveatsNeutralMildDisputedBlockedCrickets Reviews: current code-review ACKs, then (+stale ACKs) and -NACKs; greener = more ACKs. Size: lines added or modified outside tests, then in tests; greener = smaller. | |||||||
Goal
Require a dedicated, non-wildcard onion bind when automatic Tor onion service listening is enabled alongside explicit `-bind` arguments. Reject startup during initialization if explicit `-bind` parameters lack a specific `-bind=<addr>=onion` listener or specify a wildcard onion bind.
Problem: When automatic onion service creation (`-listenonion`) runs without a dedicated onion bind, Tor forwards inbound traffic to the first normal P2P bind. Bitcoind cannot distinguish these from direct connections, misclassifying Tor peers by IP address and potentially granting them permissions assigned to the Tor daemon's local IP.
Evidence of importance:
- PR description: 'Tor peers arriving through shared or wildcard binds may be classified by IP and inherit address-based whitelist permissions.'
- PR description cites consensus from #34892 recommending startup rejection rather than silent fallback.
Scope: This is a breaking startup configuration change: because `-listenonion` defaults to enabled whenever listening, existing node configs specifying `-bind` without Tor options will now fail startup until they add `-bind=<addr>=onion` or `-listenonion=0`.
Risk of a mistake: medium (p2p). Nodes with existing configurations using explicit `-bind` directives will fail to start upon upgrading until their config files or startup arguments are modified.
Changed since the previous assessment: Added release notes, tor documentation updates, and co-authors to commit messages.
Reviewability
Ready
Nothing known that would invalidate a review now.
Waiting on (from the thread read):
- nothing: no pending reviewer requests or actions awaited
Agreement
Strong
substantive support, no open objection (vasild, winterrdog)
Thread notes: Added ACK from jpk68 and Tested ACK from winterrdog. winterrdog's remark regarding adding 'fixes #33458' to the description is a process suggestion and not recorded as a claim.
Objections, suggestions, and questions:
| Reviewer | Type | Harm, request, or question | Status | Must be | Author replied | Quote |
|---|---|---|---|---|---|---|
| jeanpablojp (contributor) | objection, correctness | Wildcard onion binds pass the new check but fail to tag incoming peers as onion, causing them to retain IP-network permissions such as noban | fixed · fix pushed · author implemented a wildcard-bind check and test | changed | yes | 2026-09-06: '-bind=0.0.0.0:8334=onion passes the new check while tagging nothing' Status from: 2026-09-24: l0rinc: 'added a wildcard-bind check and test' |
| jeanpablojp (contributor) | suggestion, maintenance | Explain in the -bind help and doc/tor.md when an explicit dedicated onion bind is required | fixed · fix pushed · author added explanation to -bind help and doc/tor.md | answered | yes | 2026-09-06: 'Would a line in one of the two be worth it?' Status from: 2026-09-24: l0rinc: 'added this to both the `-bind` help and section 2 of `doc/tor.md`' |
| jeanpablojp (contributor) | suggestion, style | Use assert_start_raises_init_error helper in the test to drop unused imports | fixed · fix pushed · author switched to the test helper | answered | yes | 2026-09-06: 'this could use the helper the file already uses further down' Status from: 2026-09-24: l0rinc: 'Switched to `assert_start_raises_init_error`, thanks.' |
| vasild (member) | suggestion, interface | Clarify the error message so it does not imply the requirement only applies when -bind is set | fixed · fix pushed · author shortened the error message | answered | yes | 2026-10-01: 'With this PR the automatic Tor service requires a dedicated bind, always, unconditionally. Not only "when -bind is set".' Status from: 2026-10-07: l0rinc: 'Used your shorter version, thanks.' |
| vasild (member) | suggestion, maintenance | Remove the duplicate check in AppInitParameterInteraction and keep only the check using connOptions.onion_binds | fixed · fix pushed · author removed the duplicate check | answered | yes | 2026-10-01: 'Isn't this check redundant? Seems to be the same as the added check in `AppInitParameterInteraction()`. Better have just one.' Status from: 2026-10-07: l0rinc: 'I agree that duplicating the argument parsing just for this case isn’t worth it - removed, thanks' |
| vasild (member) | suggestion, correctness | Correct the error message for wildcard onion binds because wildcard addresses still identify incoming Tor connections but Tor cannot forward to them | accepted · vasild accepted that wildcard onion binds fail to match and misclassify connections | answered | yes | 2026-10-01: 'This message is technically not correct. If wildcard address is used, incoming Tor connections will still be identified just fine.' Status from: 2026-10-19: vasild: 'I got this wrong initially, thanks for correcting me.' |
| vasild (member) | suggestion, maintenance | Clarify in the release notes that any specific address can be used, not only 127.0.0.1 | fixed · fix pushed · author clarified the release notes | answered | yes | 2026-10-01: 'The impression is that `127.0.0.1` must be used.' Status from: 2026-10-07: l0rinc: 'clarified the release notes' |
| schildbach (contributor) | objection, approach | Requiring a specific IP rather than wildcard binds conflicts with container environments where dynamic IPs are used | answered · author prefers to keep rejecting wildcard configurations in this PR and handle container support separately | answered | yes | 2026-10-06: 'when running in a container, it is considered best practise to bind to `0.0.0.0` / `[::]` rather than a specific IP.' Status from: 2026-10-07: l0rinc: 'I'd keep rejecting these configurations in this PR and handle that support separately.' |
Support:
- jeanpablojp (contributor) (Concept ACK, 2026-09-06): (no reason given) [not substantive]
- winterrdog (contributor) (Approach ACK, 2026-09-08): (no reason given) [not substantive]
- vasild (member) (Approach ACK, 2026-10-01): (no reason given) [not substantive]
- vasild (member) (ACK, 2026-10-19) [read]: adding another configuration option for containers would be overkill; docker can assign a specific IP
- jpk68 (contributor) (ACK, 2026-10-21): (no reason given) [not substantive]
- winterrdog (contributor) (Tested ACK, 2026-10-21) [tested]: successfully built & tested with `clang++-19` on FreeBSD `15.0`, targeting `x86_64`
Participants:
- jeanpablojp (contributor, objection, 3 statements 2026-09-06 to 2026-09-06): noted wildcard onion binds bypass classification checks and suggested doc updates
- winterrdog (contributor, support, 2 statements 2026-09-08 to 2026-10-21): Approach ACK and Tested ACK on FreeBSD
- vasild (member, support, 12 statements 2026-10-01 to 2026-10-19): ACK; suggested eliminating a redundant check and accepted author's rationale on wildcard misclassification
- schildbach (contributor, objection, 1 statements 2026-10-06 to 2026-10-06): noted container environments with dynamic IPs rely on wildcard binds and suggested solving via a second config option
- jpk68 (contributor, support, 1 statements 2026-10-21 to 2026-10-21): ACK
Files
26 lines under test/bench/ci.
- src/init.cpp +11/-9
- test/functional/feature_bind_extra.py +16/-0
- doc/release-notes-36170.md +8/-0
- test/functional/feature_proxy.py +5/-2
- doc/tor.md +3/-0
- test/functional/feature_torcontrol.py +2/-0
- test/functional/p2p_private_broadcast.py +1/-0
Card
The short text the ranking pass compares across PRs.
PR 36170 causes bitcoind to refuse startup if automatic Tor listening is enabled alongside explicit -bind options without a dedicated, non-wildcard onion bind (-bind=<addr>=onion). Without a dedicated bind, incoming Tor connections land on standard listening sockets where they are misclassified by IP, potentially inheriting whitelist permissions assigned to the Tor daemon. Because -listenonion is enabled by default when listening, existing node setups using -bind will fail to start until they explicitly configure an onion bind or pass -listenonion=0.
Data
thread read through 2026-10-21 (27 statements), head 5527295cb4
labels: P2P
Categories
P2P
P2 · bug fix
Prevents Tor peers from being misclassified and inheriting local IP whitelist permissions when automatic onion listening routes inbound traffic through shared binds. The PR description notes that without a dedicated bind, Tor peers 'may be classified by IP and inherit address-based whitelist permissions.'
Membership: Carries the P2P label and modifies connection handling and Tor listener binding configurations.
Factors: security/stability 2, bug 1, performance 0, user value 1, leverage 0