torcontrol: escape backslashes in -torpassword #36374

Closed
0xShadowX wants to merge 1 commit from fix-torpassword-backslash into master AGit
0xShadowX commented 2026-09-28 17:47:02 +00:00 (Migrated from github.com)

With HASHEDPASSWORD authentication, TorController::protocolinfo_cb sends the password as a quoted string, AUTHENTICATE "<password>" (torcontrol.cpp:667). It escapes " but not \.

Tor parses that argument as a control-spec QuotedString, where a backslash escapes the next character. So:

  • -torpassword=pa\ss reaches Tor as pass, authentication fails and no onion service is created
  • -torpassword=pass\ escapes the closing quote, so the command is malformed

This escapes backslashes before quotes.

The new test_password_escaping in feature_torcontrol.py uses the mock control server with HASHEDPASSWORD and -torpassword=pa\ss"word\, and checks the exact AUTHENTICATE line. On master it gets AUTHENTICATE "pa\ss\"word\", with the fix AUTHENTICATE "pa\\ss\"word\\".

Tested against Tor 0.4.9.12 with HashedControlPassword set for pa\ss"word\: on master bitcoind logs "tor: Authentication failed", with this change authentication succeeds and ADD_ONION creates the onion service.

AI tools were used to help find this issue and to prepare the patch and test.

With `HASHEDPASSWORD` authentication, `TorController::protocolinfo_cb` sends the password as a quoted string, `AUTHENTICATE "<password>"` (torcontrol.cpp:667). It escapes `"` but not `\`. Tor parses that argument as a control-spec QuotedString, where a backslash escapes the next character. So: - `-torpassword=pa\ss` reaches Tor as `pass`, authentication fails and no onion service is created - `-torpassword=pass\` escapes the closing quote, so the command is malformed This escapes backslashes before quotes. The new `test_password_escaping` in `feature_torcontrol.py` uses the mock control server with `HASHEDPASSWORD` and `-torpassword=pa\ss"word\`, and checks the exact `AUTHENTICATE` line. On master it gets `AUTHENTICATE "pa\ss\"word\"`, with the fix `AUTHENTICATE "pa\\ss\"word\\"`. Tested against Tor 0.4.9.12 with `HashedControlPassword` set for `pa\ss"word\`: on master bitcoind logs "tor: Authentication failed", with this change authentication succeeds and ADD_ONION creates the onion service. AI tools were used to help find this issue and to prepare the patch and test.
DrahtBot commented 2026-09-28 17:47:09 +00:00 (Migrated from github.com)

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

External sites

Reviews

See the guideline and AI policy for information on the review process.

Type Reviewers
Stale ACK winterrdog, jpk68

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #36637 (torcontrol: send -torpassword hex-encoded to avoid escaping bugs by jpk68)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/36374 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/36374.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/36374#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. | Type | Reviewers | | ---- | --------- | | Stale ACK | [winterrdog](https://github.com/bitcoin/bitcoin/pull/36374#pullrequestreview-5443278358), [jpk68](https://github.com/bitcoin/bitcoin/pull/36374#issuecomment-6321018221) | If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore. <!--174a7506f384e20aa4161008e828411d--> ### Conflicts Reviewers, this pull request conflicts with the following ones: * [#36637](https://github.com/bitcoin/bitcoin/pull/36637) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36637.svg"></sub> (torcontrol: send -torpassword hex-encoded to avoid escaping bugs by jpk68) If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. <!--5faf32d7da4f0f540f40219e4f7537a3-->
First-time contributor

🟠 Minor · Exercise the successful hashed-password flow in the mock

feature_torcontrol.py:115-124: HashedPasswordTorControlServer passes the quoted AUTHENTICATE to the base mock, which replies 510 (lines 102-112). auth_cb then logs a failure, so the new test never covers successful HASHEDPASSWORD authentication or the ADD_ONION that should follow.

Location: test/functional/feature_torcontrol.py:102 (head).

🔵 Suggestion · Quoted authentication retains an avoidable escaping dependency

The new escaping is correct, but sending the password as hex would avoid the order-dependent replacements and keep password bytes out of the line-based command syntax.

Location: src/torcontrol.cpp:696 (head).

🔵 Suggestion · Backslash-workaround configurations need upgrade guidance

Operators who doubled backslashes in -torpassword as a workaround can lose their automatic onion service after upgrading; no affected configuration has been identified.

Location: src/torcontrol.cpp:696 (head).

Review coverage was incomplete.


Reviewed: a00b063137c7 · Full review report · Previous reports

permalink

<!-- forgejo-review-bot:bitcoin/bitcoin --> <!-- ralph-engine:current:4d44b6ffa09c54db24f8f0ab27ae388beae06a733efcae741ca64db76bb1c938:7efd3c3ba41667382004cfa7a7db56605da7d8f9b7ab69bc483f27117390ba48 --> <!-- ralph-base:7ce161872ebd2475a2359336206c8b20814f073a --> <!-- ralph-head:a00b063137c73f1899d4a448900e7fb8527a1f82 --> <!-- ralph-case:d947316aed1c1999cbb706196b882c7ffb55222dc5cc03f9d350013a88bd33f2 --> **🟠 Minor · Exercise the successful hashed-password flow in the mock** feature_torcontrol.py:115-124: HashedPasswordTorControlServer passes the quoted AUTHENTICATE to the base mock, which replies 510 (lines 102-112). auth_cb then logs a failure, so the new test never covers successful HASHEDPASSWORD authentication or the ADD_ONION that should follow. Location: [`test/functional/feature_torcontrol.py:102`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/a00b063137c73f1899d4a448900e7fb8527a1f82/test/functional/feature_torcontrol.py#L102>) (head). **🔵 Suggestion · Quoted authentication retains an avoidable escaping dependency** The new escaping is correct, but sending the password as hex would avoid the order-dependent replacements and keep password bytes out of the line-based command syntax. Location: [`src/torcontrol.cpp:696`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/a00b063137c73f1899d4a448900e7fb8527a1f82/src/torcontrol.cpp#L696>) (head). **🔵 Suggestion · Backslash-workaround configurations need upgrade guidance** Operators who doubled backslashes in -torpassword as a workaround can lose their automatic onion service after upgrading; no affected configuration has been identified. Location: [`src/torcontrol.cpp:696`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/a00b063137c73f1899d4a448900e7fb8527a1f82/src/torcontrol.cpp#L696>) (head). Review coverage was incomplete. <!-- Review tier: sensitive --> --- Reviewed: [`a00b063137c7`](<https://git.fish.foo/bitcoin/bitcoin/commit/a00b063137c73f1899d4a448900e7fb8527a1f82>) · [Full review report](<https://review.fish.foo/traces/36374-a00b063137c73f1899d4a448900e7fb8527a1f82-2219-6.html>) · [Previous reports](<https://review.fish.foo/traces/36374/>) [permalink](<https://review.fish.foo/traces/36374-a00b063137c73f1899d4a448900e7fb8527a1f82-2219-6.html>)
fjahr commented 2026-09-28 19:24:10 +00:00 (Migrated from github.com)

There is already test coverage suggested for this in #35292, please coordinate with the author there how to proceed.

I don't have Tor installed here, so this checks the escaping against the control-spec rules rather than a live Tor.

You should install it and then test it.

There is already test coverage suggested for this in #35292, please coordinate with the author there how to proceed. > I don't have Tor installed here, so this checks the escaping against the control-spec rules rather than a live Tor. You should install it and then test it.
0xShadowX commented 2026-09-28 20:16:54 +00:00 (Migrated from github.com)

Installed Tor 0.4.9.12 and tested against it with HashedControlPassword for pa\ss"word\: on master bitcoind gets "tor: Authentication failed", with this change authentication succeeds and ADD_ONION creates the service. I'll ask in #35292 how to combine the test coverage.

Installed Tor 0.4.9.12 and tested against it with `HashedControlPassword` for `pa\ss"word\`: on master bitcoind gets "tor: Authentication failed", with this change authentication succeeds and ADD_ONION creates the service. I'll ask in #35292 how to combine the test coverage.
winterrdog (Migrated from github.com) reviewed 2026-10-06 19:09:40 +00:00
winterrdog (Migrated from github.com) left a comment

approach ACK


backslashes are not escaped on present master. to confirm, i ran the test introduced in this PR on master and it failed with:

test output log
2026-10-03T17:16:33.504732Z TestFramework (ERROR): Unexpected exception:
Traceback (most recent call last):
  File "/home/madman/Documents/btc/btc-core/my-btc-fork/test/functional/test_framework/test_framework.py", line 145, in main
    self.run_test()
  File "/home/madman/Documents/btc/btc-core/my-btc-fork/build/test/functional/feature_torcontrol.py", line 366, in run_test
    self.test_hashedpassword_auth()
  File "/home/madman/Documents/btc/btc-core/my-btc-fork/build/test/functional/feature_torcontrol.py", line 319, in test_hashedpassword_auth
    assert_equal(mock_tor.received_commands[1], escaped_auth)
  File "/home/madman/Documents/btc/btc-core/my-btc-fork/test/functional/test_framework/util.py", line 94, in assert_equal
    raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
AssertionError: not(AUTHENTICATE "pa\ss\"word\" == AUTHENTICATE "pa\\ss\"word\\")
2026-10-03T17:16:33.559119Z TestFramework (INFO): Not stopping nodes as test failed. The dangling processes will be cleaned up later.

also, i verified that this PR's motivation is valid and is required by the TorControl spec:

...
In QuotedStrings, backslashes and quotes must be escaped; other characters need not be escaped.

from https://spec.torproject.org/control-spec/message-format.html#description-format.


reply-to: https://github.com/bitcoin/bitcoin/pull/36374#issuecomment-5876898982

There is already test coverage suggested for this in #35292, please coordinate with the author there how to proceed.

yes, we had an exchange and reached consensus here: https://github.com/bitcoin/bitcoin/pull/35292#issuecomment-5971847668

since this PR fixes a bug and adds the fix's regression test, while #35292 is test-only, has a larger diff, and covers more test cases, i think it makes sense for this one to go first. it is smaller and should be easier to review, with fewer conflicts with #35292

neither PR depends on the other, so i can rebase on top of this PR. the remaining conflicts should be straightforward to resolve, and i can handle them afterwards as proposed here: https://github.com/bitcoin/bitcoin/pull/35292#issuecomment-5970759968

thanks for bringing this to my attention, @fjahr

approach ACK --- backslashes are _not_ escaped on present [`master`](https://github.com/bitcoin/bitcoin/commit/aef8a04966d7ab6c04edc5d19b733e78205405de). to confirm, i ran the test introduced in this PR on `master` and it failed with: <details> <summary>test output log </summary> ```text 2026-10-03T17:16:33.504732Z TestFramework (ERROR): Unexpected exception: Traceback (most recent call last): File "/home/madman/Documents/btc/btc-core/my-btc-fork/test/functional/test_framework/test_framework.py", line 145, in main self.run_test() File "/home/madman/Documents/btc/btc-core/my-btc-fork/build/test/functional/feature_torcontrol.py", line 366, in run_test self.test_hashedpassword_auth() File "/home/madman/Documents/btc/btc-core/my-btc-fork/build/test/functional/feature_torcontrol.py", line 319, in test_hashedpassword_auth assert_equal(mock_tor.received_commands[1], escaped_auth) File "/home/madman/Documents/btc/btc-core/my-btc-fork/test/functional/test_framework/util.py", line 94, in assert_equal raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args)) AssertionError: not(AUTHENTICATE "pa\ss\"word\" == AUTHENTICATE "pa\\ss\"word\\") 2026-10-03T17:16:33.559119Z TestFramework (INFO): Not stopping nodes as test failed. The dangling processes will be cleaned up later. ``` </details> --- also, i verified that this PR's motivation is valid and is required by the TorControl spec: > ... > In QuotedStrings, backslashes and quotes must be escaped; other characters need not be escaped. from https://spec.torproject.org/control-spec/message-format.html#description-format. --- reply-to: https://github.com/bitcoin/bitcoin/pull/36374#issuecomment-5876898982 > There is already test coverage suggested for this in #35292, please coordinate with the author there how to proceed. yes, we had an exchange and reached consensus here: https://github.com/bitcoin/bitcoin/pull/35292#issuecomment-5971847668 since this PR fixes a bug and adds the fix's regression test, while #35292 is test-only, has a larger diff, and covers more test cases, i think it makes sense for this one to go first. it is smaller and should be easier to review, with fewer conflicts with #35292 neither PR depends on the other, so i can rebase on top of this PR. the remaining conflicts should be straightforward to resolve, and i can handle them afterwards as proposed here: https://github.com/bitcoin/bitcoin/pull/35292#issuecomment-5970759968 thanks for bringing this to my attention, @fjahr
winterrdog (Migrated from github.com) commented 2026-10-06 14:05:57 +00:00

nit: this case only asserts the commands received by the mock, and
does not inspect the test node's debug log. -debug=tor only
enables debug-level logs (not needed in this case) and can be dropped
here

**nit**: this case only asserts the commands received by the mock, and does not inspect the test node's debug log. `-debug=tor` only enables debug-level logs (_not needed in this case_) and can be dropped here
0xShadowX (Migrated from github.com) reviewed 2026-10-06 20:46:25 +00:00
0xShadowX (Migrated from github.com) commented 2026-10-06 20:46:25 +00:00

Dropped it in 9c9bd8cab0, thanks. The test still fails on master and passes with the fix.

Dropped it in 9c9bd8cab0f8f5dfebf8d709e0588b42cbdf57fe, thanks. The test still fails on master and passes with the fix.
winterrdog (Migrated from github.com) reviewed 2026-10-07 13:47:58 +00:00
winterrdog (Migrated from github.com) left a comment

tACK 9c9bd8cab0

successfully built and tested with clang++-19 on FreeBSD 15.0, targeting x86_64


i git-applyied feature_torcontrol.py's patch from this PR onto current master at 9dfde64cc3, and the test failed with:

output
...
2026-10-07T11:03:15.999507Z TestFramework (INFO): PRNG seed is: 8666784833934009101
2026-10-07T11:03:16.050000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_wwb8jpcz
2026-10-07T11:03:16.874367Z TestFramework (INFO): Test Tor control basic functionality
2026-10-07T11:03:18.980178Z TestFramework (INFO): Test that -torpassword is sent as a correctly escaped quoted string
2026-10-07T11:03:20.142646Z TestFramework (ERROR): Unexpected exception:
Traceback (most recent call last):
  File "/home/madman/Documents/btc/btc-core/my-btc-fork/test/functional/test_framework/test_framework.py", line 146, in main
    self.run_test()
  File "/home/madman/Documents/btc/btc-core/my-btc-fork/./build/test/functional/feature_torcontrol.py", line 304, in run_test
    self.test_password_escaping()
  File "/home/madman/Documents/btc/btc-core/my-btc-fork/./build/test/functional/feature_torcontrol.py", line 298, in test_password_escaping
    assert_equal(mock_tor.received_commands[1], 'AUTHENTICATE "pa\\\\ss\\"word\\\\"')
  File "/home/madman/Documents/btc/btc-core/my-btc-fork/test/functional/test_framework/util.py", line 94, in assert_equal
    raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
AssertionError: not(AUTHENTICATE "pa\ss\"word\" == AUTHENTICATE "pa\\ss\"word\\")
2026-10-07T11:03:20.193788Z TestFramework (INFO): Not stopping nodes as test failed. The dangling processes will be cleaned up later.
2026-10-07T11:03:20.193916Z TestFramework (WARNING): Not cleaning up dir /tmp/bitcoin_func_test_wwb8jpcz
2026-10-07T11:03:20.193981Z TestFramework (ERROR): Test failed. Test logging available at /tmp/bitcoin_func_test_wwb8jpcz/test_framework.log
2026-10-07T11:03:20.194073Z TestFramework (ERROR):
2026-10-07T11:03:20.194185Z TestFramework (ERROR): Hint: Call /home/madman/Documents/btc/btc-core/my-btc-fork/test/functional/combine_logs.py '/tmp/bitcoin_func_test_wwb8jpcz' to consolidate all logs
2026-10-07T11:03:20.194235Z TestFramework (ERROR):
2026-10-07T11:03:20.194285Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2026-10-07T11:03:20.194353Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues
2026-10-07T11:03:20.194400Z TestFramework (ERROR):
[node 0] Cleaning up leftover process

i also tested on TOR running locally with a bitcoind binary built from master with password as pa\ss"word\ and it failed with:

debug log
...
2026-10-07T13:27:26Z torcontrol thread start
2026-10-07T13:27:26Z [tor] Entering Tor control thread
2026-10-07T13:27:26Z [tor] Attempting to connect to Tor control port 127.0.0.1:9051
2026-10-07T13:27:26Z [tor] Successfully connected to Tor control port
2026-10-07T13:27:26Z Bound to 127.0.0.1:8334
2026-10-07T13:27:26Z Bound to [::]:8333
2026-10-07T13:27:26Z Bound to 0.0.0.0:8333
2026-10-07T13:27:26Z [tor] Connected to Tor version 0.5.0.0-alpha-dev
2026-10-07T13:27:26Z [tor] Supported authentication method: HASHEDPASSWORD
...
...
2026-10-07T13:27:26Z [tor] Using HASHEDPASSWORD authentication
2026-10-07T13:27:26Z [warning] tor: Authentication failed
...

then, i tested with this PR's patch applied and i got these logs:

debug log
...
2026-10-07T13:32:46Z torcontrol thread start
2026-10-07T13:32:46Z [tor] Entering Tor control thread
2026-10-07T13:32:46Z [tor] Attempting to connect to Tor control port 127.0.0.1:9051
2026-10-07T13:32:46Z [tor] Successfully connected to Tor control port
2026-10-07T13:32:46Z Bound to 127.0.0.1:8334
2026-10-07T13:32:46Z Bound to [::]:8333
2026-10-07T13:32:46Z [tor] Connected to Tor version 0.5.0.0-alpha-dev
2026-10-07T13:32:46Z Bound to 0.0.0.0:8333
2026-10-07T13:32:46Z [tor] Supported authentication method: HASHEDPASSWORD
2026-10-07T13:32:46Z [tor] Using HASHEDPASSWORD authentication
...
...
2026-10-07T13:32:46Z [tor] Authentication successful
...

the TOR daemon version details used (built from source -- main at 84caa7e47b1a60c4):

Tor version 0.5.0.0-alpha-dev (git-84caa7e47b1a60c4).
Tor is running on Linux with Libevent 2.1.12-stable, OpenSSL 3.0.13, Zlib 1.3, Liblzma 5.4.5, Libzstd 1.5.5 and Glibc 2.39 as libc.
Tor compiled with GCC version 14.2.0

the command i used to run bitcoind:

# used linux's default RAMdisk mount (/dev/shm) just to gain a "little" speed. for other systems that do not have it, "/tmp" will do just fine
./build/bin/bitcoind \
  -regtest \
  -datadir=/dev/shm/bitcoin-tor-test \
  -torcontrol=127.0.0.1:9051 \
  -torpassword='pa\ss"word\' \
  -listenonion=1 \
  -printtoconsole=1 \
  -debug=tor
tACK 9c9bd8cab0f8f5dfebf8d709e0588b42cbdf57fe successfully built and tested with `clang++-19` on FreeBSD `15.0`, targeting `x86_64` --- i `git-apply`ied `feature_torcontrol.py`'s patch from this PR onto current `master` at 9dfde64cc3262329051fd05fffe40eecc786a99f, and the test failed with: <details><summary>output</summary> ```text ... 2026-10-07T11:03:15.999507Z TestFramework (INFO): PRNG seed is: 8666784833934009101 2026-10-07T11:03:16.050000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_wwb8jpcz 2026-10-07T11:03:16.874367Z TestFramework (INFO): Test Tor control basic functionality 2026-10-07T11:03:18.980178Z TestFramework (INFO): Test that -torpassword is sent as a correctly escaped quoted string 2026-10-07T11:03:20.142646Z TestFramework (ERROR): Unexpected exception: Traceback (most recent call last): File "/home/madman/Documents/btc/btc-core/my-btc-fork/test/functional/test_framework/test_framework.py", line 146, in main self.run_test() File "/home/madman/Documents/btc/btc-core/my-btc-fork/./build/test/functional/feature_torcontrol.py", line 304, in run_test self.test_password_escaping() File "/home/madman/Documents/btc/btc-core/my-btc-fork/./build/test/functional/feature_torcontrol.py", line 298, in test_password_escaping assert_equal(mock_tor.received_commands[1], 'AUTHENTICATE "pa\\\\ss\\"word\\\\"') File "/home/madman/Documents/btc/btc-core/my-btc-fork/test/functional/test_framework/util.py", line 94, in assert_equal raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args)) AssertionError: not(AUTHENTICATE "pa\ss\"word\" == AUTHENTICATE "pa\\ss\"word\\") 2026-10-07T11:03:20.193788Z TestFramework (INFO): Not stopping nodes as test failed. The dangling processes will be cleaned up later. 2026-10-07T11:03:20.193916Z TestFramework (WARNING): Not cleaning up dir /tmp/bitcoin_func_test_wwb8jpcz 2026-10-07T11:03:20.193981Z TestFramework (ERROR): Test failed. Test logging available at /tmp/bitcoin_func_test_wwb8jpcz/test_framework.log 2026-10-07T11:03:20.194073Z TestFramework (ERROR): 2026-10-07T11:03:20.194185Z TestFramework (ERROR): Hint: Call /home/madman/Documents/btc/btc-core/my-btc-fork/test/functional/combine_logs.py '/tmp/bitcoin_func_test_wwb8jpcz' to consolidate all logs 2026-10-07T11:03:20.194235Z TestFramework (ERROR): 2026-10-07T11:03:20.194285Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log. 2026-10-07T11:03:20.194353Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues 2026-10-07T11:03:20.194400Z TestFramework (ERROR): [node 0] Cleaning up leftover process ``` </details> --- i also tested on TOR running locally with a `bitcoind` binary built from `master` with password as `pa\ss"word\` and it failed with: <details><summary>debug log</summary> ```text ... 2026-10-07T13:27:26Z torcontrol thread start 2026-10-07T13:27:26Z [tor] Entering Tor control thread 2026-10-07T13:27:26Z [tor] Attempting to connect to Tor control port 127.0.0.1:9051 2026-10-07T13:27:26Z [tor] Successfully connected to Tor control port 2026-10-07T13:27:26Z Bound to 127.0.0.1:8334 2026-10-07T13:27:26Z Bound to [::]:8333 2026-10-07T13:27:26Z Bound to 0.0.0.0:8333 2026-10-07T13:27:26Z [tor] Connected to Tor version 0.5.0.0-alpha-dev 2026-10-07T13:27:26Z [tor] Supported authentication method: HASHEDPASSWORD ... ... 2026-10-07T13:27:26Z [tor] Using HASHEDPASSWORD authentication 2026-10-07T13:27:26Z [warning] tor: Authentication failed ... ``` </details> --- then, i tested with this PR's patch applied and i got these logs: <details><summary>debug log</summary> ```text ... 2026-10-07T13:32:46Z torcontrol thread start 2026-10-07T13:32:46Z [tor] Entering Tor control thread 2026-10-07T13:32:46Z [tor] Attempting to connect to Tor control port 127.0.0.1:9051 2026-10-07T13:32:46Z [tor] Successfully connected to Tor control port 2026-10-07T13:32:46Z Bound to 127.0.0.1:8334 2026-10-07T13:32:46Z Bound to [::]:8333 2026-10-07T13:32:46Z [tor] Connected to Tor version 0.5.0.0-alpha-dev 2026-10-07T13:32:46Z Bound to 0.0.0.0:8333 2026-10-07T13:32:46Z [tor] Supported authentication method: HASHEDPASSWORD 2026-10-07T13:32:46Z [tor] Using HASHEDPASSWORD authentication ... ... 2026-10-07T13:32:46Z [tor] Authentication successful ... ``` </details> --- the TOR daemon version details used (built from source -- `main` at `84caa7e47b1a60c4`): ```text Tor version 0.5.0.0-alpha-dev (git-84caa7e47b1a60c4). Tor is running on Linux with Libevent 2.1.12-stable, OpenSSL 3.0.13, Zlib 1.3, Liblzma 5.4.5, Libzstd 1.5.5 and Glibc 2.39 as libc. Tor compiled with GCC version 14.2.0 ``` the command i used to run `bitcoind`: ```bash # used linux's default RAMdisk mount (/dev/shm) just to gain a "little" speed. for other systems that do not have it, "/tmp" will do just fine ./build/bin/bitcoind \ -regtest \ -datadir=/dev/shm/bitcoin-tor-test \ -torcontrol=127.0.0.1:9051 \ -torpassword='pa\ss"word\' \ -listenonion=1 \ -printtoconsole=1 \ -debug=tor ```
jpk68 commented 2026-10-21 16:28:16 +00:00 (Migrated from github.com)
ACK 9c9bd8cab0f8f5dfebf8d709e0588b42cbdf57fe
sedited commented 2026-11-05 10:59:29 +00:00 (Migrated from github.com)

Ping for rebase.

Ping for rebase.
maflcko commented 2026-11-07 11:28:54 +00:00 (Migrated from github.com)
Can this be closed for https://github.com/bitcoin/bitcoin/pull/36637 ?
0xShadowX commented 2026-11-07 12:48:14 +00:00 (Migrated from github.com)

Sure, closing in favor of #36637, which avoids the escaping entirely by sending the password hex-encoded.

Sure, closing in favor of #36637, which avoids the escaping entirely by sending the password hex-encoded.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!36374
No description provided.