fix(tray): isolate Windows tray host from proxy sockets - #752
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
|
NEEDS-SECURITY-REVIEW, then LAND — the mechanism holds up. I checked this against #733 rather than taking the description on faith, and the isolation is real rather than cosmetic. Passing the executable and CLI paths through environment variables instead of interpolating them into the encoded PowerShell program is the right call, and clearing those three variables at The regression at Two things before merge. This changes an executable-launch trust boundary and deliberately invokes the Windows shell, which puts it under "other security-boundary changes" in The PR is still a draft and merges cleanly against the current What happens next: mark it ready when you are satisfied, get Windows CI green, and request security review. I found no code blocker in the isolation itself. |
|
Closing as superseded. #733 is closed with that evidence. |
Summary
ProcessStartInfo.UseShellExecute=truePowerShell broker instead of spawning it directly from the live Bun proxy process tree.safePathrules, and values are passed through environment variables.&and%TEMP%.Fixes #733.
Root cause and scope
On Windows, Bun 1.3.14 and the tested Bun 1.4 canary can pass an inheritable proxy listen socket through the current
proxy -> tray action -> detached tray hostprocess lineage. The old proxy can then exit while the long-lived tray host keeps the socket handle open, leaving the prior port unavailable.This change isolates only the long-lived tray host. It does not change tray registration, registry ownership rules, UAC/elevation behavior, heartbeat semantics, or the tray host's command-line contract. The existing heartbeat remains the authority for whether startup succeeded.
The relevant upstream Bun handle-list work (oven-sh/bun#33160) is currently open and not suitable as a released dependency, so this PR keeps the workaround local and removable.
Verification
bun run typecheck: passed on Bun 1.3.14 and Bun 1.4.0-canary.1.bun run privacy:scan: passed.git diff --check: passed.Draft status
This remains a draft pending an explicit review of the ShellExecute/environment boundary, AppLocker or EDR compatibility, and a final Windows full-suite run. Those checks are intentionally deferred rather than treated as complete here.
Checklist