Repository navigation
fix: don't expose chrome.webstorePrivate to web pages - #53752
Merged
Merged
Conversation
Since the webstorePrivate API moved to //extensions (CL 7874276), the core feature files expose it to web pages on the Chrome Web Store origin and the core provider registers its functions. Electron does not provide a WebstorePrivateAPIDelegate, so a webContents that navigated to chromewebstore.google.com got chrome.webstorePrivate bindings and calling into them dereferenced a null delegate in the browser process. Override the core "webstorePrivate" feature so it is unavailable in every context, and replace the core-registered functions with ones that respond with an error so a stray request cannot crash the browser.
MarshallOfSound
approved these changes
Sep 9, 2026
|
Release Notes Persisted
|
This was referenced Sep 9, 2026
Contributor
|
I have automatically backported this PR to "45-x-y", please check out #53775 |
Contributor
|
I have automatically backported this PR to "44-x-y", please check out #53776 |
0x-noad
pushed a commit
to 0x-noad/freedom-browser
that referenced
this pull request
Sep 18, 2026
…s Freedom (solardev-xyz#346) Electron 44.3.0 (Chromium 152) registers the `webstorePrivate` extension API and ships the core `_api_features.json` entry exposing it to ordinary web pages on `https://chromewebstore.google.com/*`, with no WebstorePrivateAPIDelegate behind it. The store calls `chrome.webstorePrivate.getReferrerChain()` as soon as a detail page renders, which is a null-pointer method call on CrBrowserMain — SIGSEGV, whole app gone. Fixed upstream in electron/electron#53752, backported to 44-x-y in electron/electron#53776, shipped in v44.4.0: "Fixed a crash when a webContents navigated to the Chrome Web Store and the page invoked the unsupported chrome.webstorePrivate API. #53776" 44.4.1 is the newest 44.x patch, so the pin goes there. Also: - test-e2e/live/chrome-webstore.spec.js — live regression test (the exposure is keyed on the real store origin, so no fixture can stand in for it): asserts `typeof chrome.webstorePrivate === 'undefined'` on the store front page, and that navigating to the issue's detail URL leaves the main process answering IPC for 30s afterwards. Clicks through Google's consent wall and the "switch to Chrome" promo, and pins `process.versions.electron` from inside the app. Wired into a new `e2e-chrome-webstore` CI job next to `e2e-ant`. - scripts/check-electron-version.js (+ test, + a check in check-binaries.js) — closes the Linux non-repro trap: node_modules/electron was 43.4.1 while the lockfile pinned 44.3.0, and electron-builder packages the node_modules copy (app-builder-lib's computeElectronVersion reads its package.json), so a stale tree ran and shipped a different Electron from the one CI described. - licenses-audit.json / LICENSE_AUDIT.md record the new lockfile-resolved version (licenses-audit.test.js enforces this), and comments claiming 44.3.0 is "the Electron this repo ships" are reworded to say what it shipped then.
6 of 7 tasks
DeJeune
pushed a commit
to CherryHQ/cherry-studio
that referenced
this pull request
Oct 8, 2026
<!-- Template from https://github.com/kubevirt/kubevirt/blob/main/.github/PULL_REQUEST_TEMPLATE.md?--> <!-- Thanks for sending a pull request! Here are some tips for you: 1. Consider creating this PR as draft: https://github.com/CherryHQ/cherry-studio/blob/main/CONTRIBUTING.md --> > ### Branch strategy > > - Active development targets `main`. ### What this PR does Before this PR: Chrome Web Store pages could crash Electron's browser process through unsupported `chrome.webstorePrivate` APIs. After this PR: Electron 44.4.0 includes the upstream fix, and Linux builds pin the corresponding verified SQLite artifacts. <!-- (optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: --> Fixes #: N/A ### Why we need it and why it was done in this way The following tradeoffs were made: Minimal Electron patch upgrade; existing browser controls and crash recovery policy preserved The following alternatives were considered: Application-level navigation restrictions or crash-recovery changes Links to places where the discussion took place: <!-- optional: slack, other GH issue, mailinglist, ... --> [Electron 44.4.0 release](https://github.com/electron/electron/releases/tag/v44.4.0), [upstream fix](electron/electron#53752), [verified Linux artifacts](https://github.com/CherryHQ/cherry-studio-better-sqlite3/releases/tag/better-sqlite3-v12.11.1-electron-v44.4.0-r1) ### Breaking changes <!-- optional --> If this PR introduces breaking changes, please describe the changes and the impact on users. None ### Special notes for your reviewer <!-- optional --> Validation: static checks, 12 Linux-native tests, artifact checksum/provenance checks, native BrowserView/webview isolation probes, and Agent direct/link navigation with snapshots passed; selected Vitest projects recorded 34,171 passes and two failures (system DNS resolving `.invalid` and a temporary Git repository fetch), so the full gate remains non-green. Test additions: None User guide update: Not required for this stability fix ### Checklist This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR. Approvers are expected to review this list. - [x] Branch: This PR targets `main` - [x] PR: The PR description is expressive enough and will help future contributors - [x] Code: [Write code that humans can understand](https://en.wikiquote.org/wiki/Martin_Fowler#code-for-humans) and [Keep it simple](https://en.wikipedia.org/wiki/KISS_principle) - [ ] Refactor: You have [left the code cleaner than you found it (Boy Scout Rule)](https://learning.oreilly.com/library/view/97-things-every/9780596809515/ch08.html) - [x] Upgrade: Impact of this change on upgrade flows was considered and addressed if required - [x] Documentation: A [user-guide update](https://docs.cherry-ai.com) was considered and is present (link) or not required. Check this only when the PR introduces or changes a user-facing feature or behavior. - [x] Self-review: I have reviewed my own code (e.g., via [`/gh-pr-review`](/.claude/skills/gh-pr-review/SKILL.md), `gh pr diff`, or GitHub UI) before requesting review from others ### Release note <!-- Write your release note: 1. Enter your extended release note in the below block. If the PR requires additional action from users switching to the new release, include the string "action required". 2. If no release note is required, just write "NONE". 3. Only include user-facing changes (new features, bug fixes visible to users, UI changes, behavior changes). For CI, maintenance, internal refactoring, build tooling, or other non-user-facing work, write "NONE". --> ```release-note [Browser] Prevent Chrome Web Store extension detail pages from closing Cherry Studio during Agent browser control. ``` Signed-off-by: kangfenmao <[email protected]>
4 tasks done
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.
Description of Change
Since the Chromium 152 roll (#52446), the
webstorePrivateextension API lives in//extensionsinstead of//chrome(CL 7874276). As a result, Electron now compiles and registers everywebstorePrivate.*function through the core generated registry. It also ships the core_api_features.jsonentry, which exposes the API to regular web pages onhttps://chromewebstore.google.com/*.ElectronExtensionsAPIClientdoesn't provide aWebstorePrivateAPIDelegate, and most of the browser-side functions dereference it without checking for null. If an app'swebContentsnavigates to the Chrome Web Store, the page gets realchrome.webstorePrivatebindings in the main world, and the first call the store page makes crashes the browser process.#52446 added
fix_guard_webstoreprivateapi_factory_against_null_delegate.patchto fix the startup crash caused by the same missing delegate, but it left the API exposed. This issue only affects 44-x-y and later; 43-x-y predates the roll.This PR restores the pre-152 behavior (the API isn't exposed anywhere) without adding a patch.
Checklist
npm testpassesRelease Notes
Notes: Fixed a crash when a webContents navigated to the Chrome Web Store and the page invoked the unsupported
chrome.webstorePrivateAPI.