Skip to content

fix(chromium): refuse WebUI navigations that crash the browser - #41986

Open
krishpranav wants to merge 1 commit into
microsoft:mainfrom
krishpranav:fix-41935
Open

fix(chromium): refuse WebUI navigations that crash the browser#41986
krishpranav wants to merge 1 commit into
microsoft:mainfrom
krishpranav:fix-41935

Conversation

@krishpranav

Copy link
Copy Markdown

Summary

  • page.goto('chrome://extensions') segfaults the Chromium browser process. The trigger is navigating inside a CDP-created off-the-record browser context — every non-persistent context — to one of the WebUIs Chromium disallows in incognito (IsURLAllowedInIncognito). Those redirect to a normal window in the original profile, and that path null-derefs.
  • Reproducible with raw CDP and none of Playwright's launch switches, so this is upstream; the same navigation works in a regular profile, in real incognito, over connectOverCDP, and in launchPersistentContext.
  • Refuses the six affected hosts (apps, extensions, help, history, password-manager, settings) in non-persistent contexts with an error pointing at launchPersistentContext(). Hosts that do work (version, gpu, bookmarks, downloads, flags, policy, …) are untouched, as is chrome://crash.
  • Guards the page.goto path only — a click or window.location still reaches Chromium directly. Measurements and the raw-CDP repro are in [Bug]: page.goto(chrome://extensions) crashes browser #41935 (comment).

Fixes #41935

Chromium does not allow a handful of WebUI hosts in off-the-record profiles
and redirects them to a normal window in the original profile. That redirect
segfaults the browser process when the profile was created over CDP, which is
the case for every non-persistent context. Refuse the navigation instead.

Fixes: microsoft#41935
@krishpranav

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

// "chrome:" is not a special scheme, so the URL parser leaves the host case alone
// while Chromium resolves it case-insensitively.
const { protocol, hostname } = new URL(url);
if (protocol === 'chrome:' && kWebUIHostsUnavailableOffTheRecord.has(hostname.toLowerCase()))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about edge://? others?


export type WindowBounds = { top?: number, left?: number, width?: number, height?: number };

// Chromium does not allow these WebUI hosts in off-the-record profiles, and instead redirects them

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discourage heavy useless comments, make it brief.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: page.goto(chrome://extensions) crashes browser

2 participants