Repository navigation
Description
What's the problem
Several outbound clients treat "no proxy" as "connect directly", so a single empty setting turns a Tor-only box into one that leaks.
bounded_getandbounded_requestin the dashboard HTTP helper passproxiesstraight torequestsand never look at the URL. Nothing stops a public URL going out without a proxy.requeststreats an empty-string proxy as no proxy.tari_healthbuildsproxies={"http": TOR_SOCKS_PROXY, "https": TOR_SOCKS_PROXY}with no guard. A test with an empty string produced a plain direct connection, so it is confirmed fail-open, not just likely.TOR_SOCKS_PROXYdefaults from the environment and can be set empty. Many callers then branch on it:xvb_clientandnotify_sinksuseproxy if tor_proxy else None, andupdate_checker,price_feed,healthchecksand the Telegram clients take the proxy as a parameter and pass it on.- The OS update verbs have a test seam: a file named
os-update-test-basein the working directory, owned by the running user, switches the release lookup and the bundle download to a plaincurlwith no Tor. Production builds ship the seam. - Every caller uses the same SOCKS credentials, so one purpose cannot be told apart from another at Tor.
What it impacts
Both appliance and DIY owners. A bad env value, a typo or a planted file sends update checks, price lookups, notifications and the OS bundle fetch straight to the home IP, which breaks the outbound-is-Tor-only promise. The seam needs a planted file, so it is a smaller risk, but it should not exist in a shipped image. The Healthchecks ping already goes over Tor today; it only needs the shared guard, not a route change.
How I found it
Code read of origin/develop plus the research for the Tor-only egress plan, checked by a second reviewer: dashboard/mining_dashboard/helper/http.py (no URL or proxy check), service/health/tari_health.py line 64 (unguarded proxy), client/xvb_client.py and service/notify/notify_sinks.py (if ... else None), and lib/pithead/47-os-update-helpers.sh (os_update_test_base, an ownership check on a file in $PWD). The empty-string behaviour of requests was tested directly. The reviewer also corrected an earlier claim: the direct branch in the OS download verb is only reachable through the seam, so the fix is gating the seam, not deleting a branch.
How important is it
High for 2.0.5. The owner ruled on 2026-11-16 ("all as recommended") that outbound is Tor only, and a client that fails open breaks that on its own, whatever the firewall does. This is step 2 of the rollout and must land before the firewall enforces (#4154 (step 9: enforce the firewall)), so a missed client shows up as an error, not as a silent leak. It needs no new infrastructure.
Acceptance criteria
bounded_getandbounded_requestrefuse any URL whose host is not a private IP literal (LAN, ULA, CGNAT) when no proxy is given, and raise before any socket opens.- An empty-string proxy, whether
"",{"https": ""}or{"http": ""}, is treated as no proxy by that check. - The dashboard fails at import time with a clear message if
TOR_SOCKS_PROXYis empty or unset. - No caller keeps its own "use a proxy if set" branch. A grep for
if tor_proxy else Noneandif self.tor_proxy else Nonefinds nothing in the dashboard source. - A unit test sets the proxy empty and asserts zero sockets are opened for each caller, including
tari_health,xvb_client,update_checker,price_feed,healthchecks,notify_sinksand both Telegram clients. - With the test seam file present in a production-built image,
os-checkandos-downloadstill go over Tor, and a shell test with an empty socks value exits non-zero with no connection. The seam still works in the KVM test builds. - Each outbound purpose (updates, probes, dashboard calls, notifications) uses its own SOCKS username, and a test shows two purposes get different circuits at Tor.
- Run through [benchmark] Stability and mining impact of Tor-only egress #4155 (benchmark) (hours per arm, at most 24 h per run), hashrate, share acceptance and dashboard data freshness are unchanged and there are no new dashboard errors, compared with the control arm.
Possible solutions
- Put the URL and proxy check inside
bounded_requestso every caller gets it with no per-caller change, then delete the caller branches. - Read
TOR_SOCKS_PROXYonce at import into a validated setting, and pass that setting everywhere instead of the raw string. - Gate the seam on a build flag or a compile-time marker written only into KVM test images, not on a file in
$PWD. Remove the seam from the production image entirely if the KVM battery can use the build flag instead. - Per-purpose credentials: set a distinct
user:isolatepair per client, the waytor_healalready does for circuit rotation. Tor isolates by SOCKS auth by default, so this only helps once callers actually differ. The Tor-side policy (SocksPolicy, SafeSocks, dedicated ports) is Harden the Tor container: SOCKS policy, SafeSocks, dedicated ports, no bridge control listener #4152 (step 7: Tor hardening). - Unknown: whether any caller relies on a hostname for a LAN target. If so, the private-IP carve-out in Remove the clearnet switches, accept only private IP literals for remote nodes, and turn IPv6 off on the uplink #4147 (step 3: remove clearnet switches) must cover it. Sequence with that step. The RigForge side of this step is Make tor_socks5 the default and fail-closed on appliance rigs, and refuse DONATION above 0 on a Tor-only rig rigforge#696 (rigforge defaults) in p2pool-starter-stack/rigforge.
Activity
pithead-developer commentedon Nov 16, 2026
Note for the fail-closed seam: the #4139 backport brings lib/pithead/47a-os-update-channel.sh to develop, and it also calls
os_update_test_base. If #4139 lands first, gate that call too. If this lands first, #4139 has to.pithead-architect commentedon Nov 17, 2026
A local session judged this too big for one local session (Too big for one local session: pithead#4146 bundles four independent objectives across roughly 14 source files — a fail-closed guard in the dashboard HTTP helper, a mechanical sweep removing proxy branches from ~11 caller modules with zero-socket tests per caller, gating the OS-update test seam on a). The runner filed 4 chunks as sub-issues and marked this issue a tracker, so it is not picked again:
os tests: give the native Quadlet proof's dashboard probe the Tor SOC…
os tests: fix #4346 — name the failing step of the native Quadlet Mon…
pithead-architect commentedon Dec 1, 2026
Owner decision 2026-12-01: closing. All four parts (#4206, #4207, #4208, #4209) are merged. The one acceptance item no child covered, the benchmark run of up to 24 hours per arm with hashrate and share acceptance unchanged, is tracked in #4155. Closing this releases #4147 and the chain behind it.
Models: claude-opus-5-5 (architect)