Repository navigation
Publish a fresh peer-link pipe name per bind on Windows - #1252
Conversation
On Windows the VS Code peer link no longer binds a pipe name derived from the storage path, which another account could create first. Every bind takes a fresh random name, published by an exclusive create of burrow.peer-endpoint in the extension's storage; windows find the broker only through that file. A published bind is believed only once the file still names it, and a name that twice fails to yield a verified broker is retired, so a dead broker's name taken by someone else holds nobody off. The broker also listens on the old derived name so windows on an older build join it rather than electing a second Burrow. Unix keeps bind-as-lease on its derived path in the per-user directory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploying mouseterm with
|
| Latest commit: |
cea1a5b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a7267943.mouseterm.pages.dev |
| Branch Preview URL: | https://peer-pipe-random-name.mouseterm.pages.dev |
dormouse-bot
left a comment
There was a problem hiding this comment.
Retiring a published name on any failure can replace a broker that is alive but stalled, and the stalled broker never stands down afterwards. That leaves two Burrows under one burrowId until a window reloads, not "until the hung one recovers" (inline). Whether to accept this or narrow the retirement rule is a design call.
A broker stalled behind a busy extension host answers a dial with silence, exactly like a squatter holding a dead broker's name. Replacing it left two Burrows under one enrollment once it caught up, since a broker never stands down. The endpoint file now records the broker's pid, and silence retires a published name only once that process is gone; a refusal or a holder that cannot prove the token still retires it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dormouse-bot
left a comment
There was a problem hiding this comment.
The pid wait checks only the second dial, but vscode.md says "unless both dials met only silence", and S274 fails if a window keeps dialing a name "whose holder ... failed to prove the token". With the code as written, a first dial that gets a bad proof followed by a silent second dial, while the recorded pid is alive, keeps the name, which is the case the audited rule names. In practice a live pid means the broker still holds its name, so this is hard to reach, but the auditor reads the code against the FAIL IF. The suggestions below make the code match the spec. The alternative is to reword both rules to "the second dial".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There are no existing installations to stay compatible with, so a Windows broker no longer listens on the old derived pipe name and no window dials it. Tests and spec text that existed only for that path go with it, and the derived name is now unix-only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Removed the compatibility path for older builds in c9baad3, since there are no existing users. A Windows broker no longer listens on the old derived pipe name and no window dials it. The tests and spec text that existed only for it are gone. The rest of the design is unchanged. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closes the Windows peer-link pipe squat recorded in #1241.
On Windows every VS Code window used to bind one pipe name derived from the extension's storage path. Windows lists every pipe to every account, so another account could create that name first after a restart, and every window's bind then failed: remote control and peer surfaces stayed down (the mutual token handshake still served it nothing).
Design (Windows only)
\\.\pipe\dormouse-peer-<32 random hex>(128 CSPRNG bits,freshEndpointNamein the newvscode-ext/src/peer-endpoint.ts), so nobody can create it in advance.wxcreate ofburrow.peer-endpoint, mode0600, besideburrow.peer-tokenin the extension's global storage, under the same protection as the token. Other windows find the broker only through that file.RECLAIM_VERIFY_MS, since a window retiring a stale file can remove a fresh one in between; a command landing meanwhile is held, as for unix's reclaimed bind.The handshake is unchanged. macOS and Linux are unchanged: their derived socket already sits in a per-user
0700directory no other account can write, and moving them to the published design would only add churn.Specs
docs/specs/vscode.md→ "Burrow: a service in the extension host": a new "Windows: a published endpoint" rule list, with the evidence invscode.rationale.md.docs/specs/security-local.md: a new audited section "The VS Code peer link" withFAIL IFS274, claimed bylocal-terminalin.github/audit/local.md.docs/specs/security.md→ "What is not defended": the Record the Windows peer-link pipe squat as not defended #1241 entry is rewritten to the one residual. Another account can hold a dead broker's name silently while one of its processes reuses that broker's pid, which keeps windows waiting.security-local.md(6100) andvscode.md(4500).Tests
vscode-ext/test/peer-endpoint.test.tsruns the Windows arbitration over unix sockets (a per-windowvi.doMockofpeer-endpoint.tskeeps the real name's random part; on Windows it uses real pipes). It covers:0600modeEach test went red with its part of the fix reverted. In
peer-link.test.ts, the derived path is now unix-only. The handshake tests dial the published name on Windows. The two squatter tests on the derived name and the delayed-answer test, which fakes a broker there, are unix-only. The Windows-only derived-pipe reclaim test is replaced by the new suite.🤖 Generated with Claude Code