{
 "number": 36374,
 "input_hash": "1fce85ccdf068dfe",
 "model": "ledger",
 "prompt_hash": null,
 "created": "2026-10-22T01:15:57+00:00",
 "result": {
  "summary": "Escapes backslashes in the Tor control port `AUTHENTICATE` command when using `HASHEDPASSWORD` authentication. Also adds functional test coverage with a mock Tor control server verifying backslash and quote escaping.",
  "problem": "Bitcoin Core sends `AUTHENTICATE \"<password>\"` under `HASHEDPASSWORD` authentication but only escapes double quotes. Tor treats backslashes in quoted strings as escape characters according to the control specification, causing passwords containing backslashes to be corrupted or malform the command syntax, which fails authentication and prevents onion service creation.",
  "card": "Escapes backslashes before quotes when transmitting -torpassword in the Tor control AUTHENTICATE command under HASHEDPASSWORD authentication. Currently, Bitcoin Core only escapes quotation marks, which causes Tor's control-spec QuotedString parser to treat backslashes as escape characters; this corrupts the password or breaks command syntax and prevents onion service creation. The author verified against Tor 0.4.9.12 that a password with backslashes fails authentication on master and succeeds with this patch.",
  "evidence": [
   "PR description: '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.'",
   "PR description notes that with '-torpassword=pa\\ss\"word\\', master sends 'AUTHENTICATE \"pa\\ss\\\"word\\\"' whereas the fix sends 'AUTHENTICATE \"pa\\\\ss\\\"word\\\\\"'."
  ],
  "scope_notes": "",
  "changed_since_previous": "No substantive changes to the code or test logic compared to the previous version (likely a rebase or commit message edit).",
  "thread": {
   "last_event_at": "2026-10-21T16:28:16Z",
   "events": 7,
   "head_sha": "9c9bd8cab0f8f5dfebf8d709e0588b42cbdf57fe",
   "schema_floor": 2,
   "schema": 2
  },
  "waiting_on": [
   {
    "at": null,
    "id": "",
    "on": "nothing",
    "url": null,
    "what": "no pending items"
   }
  ],
  "risk": {
   "level": "low",
   "touches": [
    "other",
    "tests"
   ],
   "why": "A mistake in escaping could cause Tor control port authentication to fail, preventing automatic Tor onion service setup."
  },
  "discussion": {
   "author_status": "last statement processed 2026-10-21",
   "open_concerns": [],
   "resolved_concerns": [
    "fjahr: Coordinate with the author of #35292 on existing test coverage (answered by 0xShadowX 2026-09-28)",
    "fjahr: Install Tor and test against it (answered by 0xShadowX 2026-09-28)",
    "winterrdog: Drop -debug=tor from the test case since it only asserts commands received by the mock (fixed by 0xShadowX 2026-10-06)"
   ]
  },
  "reviewability": {
   "state": "Ready",
   "label": "Ready",
   "reason": "Nothing known that would invalidate a review now."
  },
  "agreement": {
   "state": "Strong",
   "summary": "Strong: substantive support, no open objection (winterrdog, winterrdog)",
   "reason": "Added jpk68's ACK of 9c9bd8ca.",
   "evidence": [
    "winterrdog: Approach ACK \u2014 Verified that backslashes are not escaped on master causing the test to fail, verified requirement in TorControl spec, and agreed this PR should land before #35292",
    "winterrdog: Tested ACK \u2014 successfully built and tested with clang++-19 on FreeBSD 15.0/x86_64 and Linux/x86_64 with clang++-18, reproduced test failure on master, and verified successful authentication with local Tor daemon",
    "jpk68: ACK"
   ],
   "objections": [
    {
     "reviewer": "fjahr",
     "association": "MEMBER",
     "type": "suggestion",
     "kind": "approach",
     "harm": "",
     "request": "Coordinate with the author of #35292 on existing test coverage",
     "question": "",
     "text": "Coordinate with the author of #35292 on existing test coverage",
     "clears_with": "answer",
     "blocking": false,
     "status": "answered",
     "status_note": "author replied they would coordinate; winterrdog confirmed consensus that this PR should go first",
     "cleared": true,
     "author_replied": true,
     "others_replied": true,
     "fix_pushed": false,
     "replies": [
      "c:5877717694",
      "r:5429583170"
     ],
     "evidence": "2026-09-28: 'There is already test coverage suggested for this in #35292, please coordinate with the author there how to proceed.'",
     "url": "https://github.com/bitcoin/bitcoin/pull/36374#issuecomment-5876898982",
     "id": "c:5876898982",
     "at": "2026-09-28",
     "status_at": "2026-09-28",
     "status_by": "0xShadowX",
     "resolution_evidence": "2026-09-28: 0xShadowX: 'I'll ask in #35292 how to combine the test coverage.'",
     "pin": null,
     "from_schema": 2
    },
    {
     "reviewer": "fjahr",
     "association": "MEMBER",
     "type": "suggestion",
     "kind": "approach",
     "harm": "",
     "request": "Install Tor and test against it",
     "question": "",
     "text": "Install Tor and test against it",
     "clears_with": "answer",
     "blocking": false,
     "status": "answered",
     "status_note": "author installed Tor 0.4.9.12 and tested against it",
     "cleared": true,
     "author_replied": true,
     "others_replied": false,
     "fix_pushed": false,
     "replies": [
      "c:5877717694"
     ],
     "evidence": "2026-09-28: 'You should install it and then test it.'",
     "url": "https://github.com/bitcoin/bitcoin/pull/36374#issuecomment-5876898982",
     "id": "c:5876898982#2",
     "at": "2026-09-28",
     "status_at": "2026-09-28",
     "status_by": "0xShadowX",
     "resolution_evidence": "2026-09-28: 0xShadowX: 'Installed Tor 0.4.9.12 and tested against it with `HashedControlPassword`'",
     "pin": null,
     "from_schema": 2
    },
    {
     "reviewer": "winterrdog",
     "association": "CONTRIBUTOR",
     "type": "suggestion",
     "kind": "maintenance",
     "harm": "",
     "request": "Drop -debug=tor from the test case since it only asserts commands received by the mock",
     "question": "",
     "text": "Drop -debug=tor from the test case since it only asserts commands received by the mock",
     "clears_with": "answer",
     "blocking": false,
     "status": "fixed",
     "status_note": "author dropped -debug=tor in 9c9bd8ca",
     "cleared": true,
     "author_replied": true,
     "others_replied": false,
     "fix_pushed": true,
     "replies": [
      "rc:4200274220"
     ],
     "evidence": "2026-10-06: '-debug=tor only enables debug-level logs (_not needed in this case_) and can be dropped here'",
     "url": "https://github.com/bitcoin/bitcoin/pull/36374#discussion_r4196260980",
     "id": "rc:4196260980",
     "at": "2026-10-06",
     "status_at": "2026-10-06",
     "status_by": "0xShadowX",
     "resolution_evidence": "2026-10-06: 0xShadowX: 'Dropped it in 9c9bd8cab0f8f5dfebf8d709e0588b42cbdf57fe, thanks.'",
     "pin": null,
     "from_schema": 2
    }
   ],
   "support": [
    {
     "reviewer": "winterrdog",
     "reason": "Verified that backslashes are not escaped on master causing the test to fail, verified requirement in TorControl spec, and agreed this PR should land before #35292",
     "substantive": true,
     "verdict": "Approach ACK",
     "id": "r:5429583170",
     "url": "https://github.com/bitcoin/bitcoin/pull/36374#pullrequestreview-5429583170",
     "at": "2026-10-06",
     "association": "CONTRIBUTOR",
     "evidence": "both",
     "areas": []
    },
    {
     "reviewer": "winterrdog",
     "reason": "successfully built and tested with clang++-19 on FreeBSD 15.0/x86_64 and Linux/x86_64 with clang++-18, reproduced test failure on master, and verified successful authentication with local Tor daemon",
     "substantive": true,
     "verdict": "Tested ACK",
     "id": "r:5443278358",
     "url": "https://github.com/bitcoin/bitcoin/pull/36374#pullrequestreview-5443278358",
     "at": "2026-10-07",
     "association": "CONTRIBUTOR",
     "evidence": "tested",
     "areas": []
    },
    {
     "reviewer": "jpk68",
     "reason": "",
     "substantive": false,
     "verdict": "ACK",
     "id": "c:6321018221",
     "url": "https://github.com/bitcoin/bitcoin/pull/36374#issuecomment-6321018221",
     "at": "2026-10-21",
     "association": "CONTRIBUTOR",
     "evidence": "none",
     "areas": []
    }
   ],
   "participants": [
    {
     "login": "fjahr",
     "stance": "neutral",
     "note": "suggested coordinating test coverage with #35292 and testing with Tor installed",
     "association": "MEMBER",
     "comments": 1,
     "first": "2026-09-28",
     "last": "2026-09-28"
    },
    {
     "login": "winterrdog",
     "stance": "support",
     "note": "Approach ACK and Tested ACK; verified against TorControl spec, reproduced failure on master, and verified with live Tor daemon on FreeBSD and Linux",
     "association": "CONTRIBUTOR",
     "comments": 3,
     "first": "2026-10-06",
     "last": "2026-10-07"
    },
    {
     "login": "jpk68",
     "stance": "support",
     "note": "ACKed commit 9c9bd8ca",
     "association": "CONTRIBUTOR",
     "comments": 1,
     "first": "2026-10-21",
     "last": "2026-10-21"
    }
   ],
   "derivation": "substantive support, no open objection (winterrdog, winterrdog)",
   "model_state": null,
   "corrections": [],
   "notes": "Added jpk68's ACK of 9c9bd8ca."
  },
  "dependencies": {
   "depends_on": [],
   "enables": []
  },
  "categories": [
   {
    "name": "p2p",
    "member": true,
    "evidence": "Modifies src/torcontrol.cpp, which implements Tor control port integration covered by P2P.",
    "band": "P3",
    "reason_tag": "bug fix",
    "score": 0.4,
    "factors": {
     "bug_severity": 1,
     "leverage": 0,
     "performance": 0,
     "security_stability": 1,
     "user_value": 1
    },
    "rationale": "Fixes Tor control authentication failure when passwords contain backslashes. Without escaping, 'Tor treats backslashes in quoted strings as escape characters', causing authentication to fail and preventing onion service creation via ADD_ONION."
   }
  ],
  "confidence": "high",
  "uncertainties": [],
  "needs": []
 },
 "cost_usd": 0.0,
 "source": {
  "record": "2026-10-22T01:15:57+00:00",
  "code": "2026-10-08T01:23:07+00:00",
  "judgments": 1
 }
}