ADD_ONION assumes bitcoind to reside in hardcoded 127.0.0.1 #16693

issue henrikuittinen openend this issue on August 23, 2019
  1. henrikuittinen commented at 9:54 am on August 23, 2019: none

    https://github.com/bitcoin/bitcoin/blob/d72758c3f6c34cd835f5de3efc230964f3b1ea56/src/torcontrol.cpp#L539

    If a user is running Tor proxy outside localhost (perhaps on other host inside LAN or in containerised environment) , the automatic creation of onion services ends up creating an onion service listening to hardcored 127.0.0.1 address on the Tor proxy’s host instead of the private address of the bitcoind – effectively running an empty onion service listening the Tor proxy’s localhost.

  2. fanquake added the label P2P on Aug 23, 2019
  3. emilengler commented at 5:02 pm on August 23, 2019: contributor
    Good point but do people actually run Tor outside? Everyone who really wants to protect his privacy through Tor would never do this
  4. henrikuittinen commented at 6:05 pm on August 23, 2019: none

    Good point but do people actually run Tor outside?

    I’d say it’s relatively common to have a separate Tor proxy in your LAN somewhere, not necessarily on the same host. Especially if you’re running several hidden services in separate containers or perhaps routing traffic of all your devices through torified Raspberry Pi, for example.

  5. sipa commented at 6:14 pm on August 23, 2019: member
    @henrikuittinen Sure, but how would you be using the Tor control interface in that case?
  6. henrikuittinen commented at 6:17 pm on August 23, 2019: none

    @henrikuittinen Sure, but how would you be using the Tor control interface in that case?

    Through -torcontrol=<ip>:<port> and -torpassword=<pass>. It connects perfectly and creates a hidden service, but assumes the bitcoind is in 127.0.0.1 – which is of course hardcoded at the moment.

  7. sipa commented at 6:17 pm on August 23, 2019: member
    Oh, interesting. That sounds like a bug.
  8. henrikuittinen commented at 6:27 pm on August 23, 2019: none

    Yeah, it’s right here: https://github.com/bitcoin/bitcoin/blob/d72758c3f6c34cd835f5de3efc230964f3b1ea56/src/torcontrol.cpp#L539

    I reckon instead of hardcoding 127.0.0.1 it should take in GetBindAddress().

  9. meeDamian commented at 5:03 pm on May 3, 2020: contributor
    Wow, I’ve spent so much time trying to figure out why the bitcoind I run in a container doesn’t want to work with Tor on host, and inventing dirty hacks to go around that 😬. Needless to say, glad this issue exists :).
  10. hebasto commented at 11:12 am on September 28, 2020: member
    @henrikuittinen Mind testing #19991?
  11. henrikuittinen commented at 8:15 pm on September 28, 2020: none

    @henrikuittinen Mind testing #19991?

    Unfortunately I don’t have this setup anymore. Thanks for the PR though!

  12. laanwj closed this on Oct 2, 2020

  13. sidhujag referenced this in commit 9d14195e7b on Oct 4, 2020
  14. DrahtBot locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-07-03 16:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me