fix(browser-capture): stop silently elevating CA install/uninstall#67
Merged
Conversation
The Windows CA installer used to fall through from a user-store certutil call to a UAC-elevated machine-store call whenever the first attempt returned a non-zero exit code (including the user clicking "No" on Windows' standard root-trust dialog). Combined with a 2.5-6s poll of `proxyCaRefresh`, this produced the surprise "asks to install, then asks to uninstall" experience users reported. - Make install/uninstall scope-explicit (`user` | `machine`); never auto-escalate. Mac/Linux paths take the same scope arg so user-mode installs no longer require sudo. - Distinguish "cert not in this store" from "command failed" so the uninstall path doesn't trigger UAC when there's nothing to remove. - Throttle the proxy/CA status poll to 15s and only run while the proxy is actually running. - Add a confirm dialog before triggering install/uninstall so a stale toggle state can't silently invoke the system trust prompt. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Windows CA installer used to fall through from a user-store
certutilcall to a UAC-elevated machine-store call whenever the first attempt returned a non-zero exit code — including the case where the user just clicked "No" on Windows' standard root-trust dialog. Combined with a 2.5–6 s poll ofproxyCaRefreshthat could flip the install/uninstall toggle, users reported a surprise "asks to install, then asks to uninstall" sequence with multiple system prompts per click.This PR removes the silent elevation, distinguishes "cert not in this store" from "command failed", throttles the polling, and adds a confirm dialog so a stale toggle state can never silently invoke the system trust prompt.
main-src/browser/browserCaInstaller.tsinstall/uninstallnow take an explicitscope: 'user' | 'machine'. They never auto-escalate.sudo); onlymachinescope goes throughsudo-prompt.certutiland (formachine) without triggering UAC.main-src/ipc/handlers/browserHandlers.tsbrowserCapture:proxyCaInstall/proxyCaUninstallnow accept{ scope }(defaults touser).src/AgentBrowserWindowSurface.tsxproxyCaRefreshpoller now runs only while the proxy is actively running and at a 15 s cadence (was 2.5 s while running, 6 s while idle).window.confirmwith localized copy before invoking the IPC.src/i18n/messages.{en,zh-CN}.tsbrowserCaptureCaInstallConfirm,browserCaptureCaInstallMachineConfirm,browserCaptureCaUninstallConfirm,browserCaptureCaInstallMachine.Test plan
certutiland without UAC.sudo-prompt; uninstall on a fresh system is a no-op.proxyCaRefreshpoll only runs while the proxy is up; closing the proxy stops the timer.🤖 Generated with Claude Code