Skip to content

follow-up from #165: installed Chrome fallback, check cost, logging and candidate order #169

Open

Description

@pahud

Open MEDIUM and LOW findings from the reviews of #165 (installed Chrome fallback, closes #128). None is a HIGH finding. File references are on main.

MEDIUM

  • Sources/InstanceMCPCore/Browser/PlaywrightBackend.swift, managedTransportFor() calling ManagedPlaywrightLocator.locate(): with the installed Chrome selected, every status() (so every browser_* call, and sys_info) runs SecStaticCodeCheckValidity with nested-code and strict flags over the whole Chrome bundle, which is several hundred MB of sealed code. The latency is unmeasured and is added to each call. docs/browser-tools.md says the check runs "each time the managed child is started" and R7.3.1.5 says "before the child is launched", which is not what the code does. Fix: measure one validation, then either reword the docs to "on every browser call", or run the full check only when the spec changes or the child is about to start, with a cheap per-call identity check (device, inode, mtime of bundle and executable) that triggers a full check on change.
  • PlaywrightBackend.swift, managedTransportFor(): when locate() returns an InstalledChromeProblem during normal backend use, no browser: chrome_check_failed class=<class> event is logged. Only BrowserToolsController.requestChromeConsent() logs it, so R7.3.1.9 is not met for failures found at call time. Fix: log the fixed, path-free event whenever locate() returns one of InstalledChromeProblem.classes.
  • Sources/InstanceMCPCore/Browser/InstalledChrome.swift, check(): it takes the first Google Chrome.app that exists and checks only that one. If the /Applications copy is invalid, incomplete or fails the signature check while a valid copy sits in ~/Applications, Chrome is refused although R7.3.1.3 accepts either location. Fix: check candidates in priority order until one passes, and report a useful failure when none does.
  • Accepted risk, for the record: the signature check and the launch are separate steps, so a swap of a bundle in a user-writable folder between them cannot be excluded. The docs and R7.3.1.5 already state this. No action unless the threat model changes.

LOW

  • Test fixture (FakeInstallFixture.installer(... chromeChecker:) and PlaywrightInstaller.init): the default is the real InstalledChromeChecker over the real /Applications. Existing tests only lstat it, but a future test that confirms consent without injecting a checker would run the real Security check and could launch the owner's Chrome. Fix: default the fixture to a stub or an empty directory.
  • systemChromeSummary and the menu line show a version read from Info.plist with no signature check (display only, documented). When the check fails, sys_info still prints chrome: system <version> next to the chrome_* class, which can read as "in use". Fix: omit the version when the check fails, or label it as not verified.
  • Remove copy: it says "If you had chosen your installed Google Chrome, that choice is removed too", but with an unreadable or invalid install.json Remove leaves the file (R7.7) and the choice stays recorded. locate() already fails then, so the choice is not in effect. Fix: add "when install.json is removed" to the sentence.

Source: PR #165 review notes (opus and sol) and gate.

Activity

  1. added
    p2
    on Nov 18, 2026
  2. chaodu-agent commented on Nov 24, 2026

    @chaodu-agent
    Contributor

    Triage of this issue against main at a717a28 (the base for fix/followup-169).

    Still valid on main and planned for one PR: the logging gap at call time, the candidate order in InstalledChrome.check(), the fixture default checker, and the Remove copy.

    Open product decisions. Nothing here is decided, and no change depends on them:

    1. Cost of the signature check on every browser call (the cost item). The choice is either to reword docs/browser-tools.md to say the check runs on every browser call and accept that cost, or to cache the result behind a cheap identity check (device, inode, mtime) with a full re-check on change. The code comment in InstalledChrome.swift and R7.3.1.5 both say the result is never reused, so caching changes a stated requirement. The latency is still unmeasured and should be measured before the owner chooses.
    2. The Chrome version shown in sys_info and the menu when the signature check fails (the display item). The choice is either to omit the version or to label it as not verified.

    Both stay open until the owner decides. The PR for this issue will list them in its body.

  3. added a commit that references this issue on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    p2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions