Skip to content

fix(web-store): require the exact Chrome Web Store origin - #188

Open
alexgleason wants to merge 1 commit into
samuelmaddock:masterfrom
alexgleason:fix/webstore-exact-origin
Open

alexgleason wants to merge 1 commit into
samuelmaddock:masterfrom
alexgleason:fix/webstore-exact-origin

Conversation

@alexgleason

Copy link
Copy Markdown

The web store API is gated on a prefix match against https://chromewebstore.google.com in two places:

  • the preload injects chrome.webstorePrivate / chrome.management when location.href.startsWith('https://chromewebstore.google.com')
  • the IPC handlers accept a request when senderFrame.origin.startsWith(WEBSTORE_URL)

Both also match lookalike hosts such as https://chromewebstore.google.com.example.com. A page on such a host gets the full store API: beginInstall installs any store extension (with no confirmation unless the app passes beforeInstall), and management.getAll / management.uninstall list and remove installed extensions.

This compares origins exactly in both places instead.


✅ By sending this pull request, I agree to the Contributor License Agreement of this project.

The preload exposed chrome.webstorePrivate and chrome.management to any page
whose URL starts with https://chromewebstore.google.com, and the IPC handlers
accepted any sender origin with that prefix. Both also match lookalike hosts
like https://chromewebstore.google.com.example.com, letting such a page
install, list, and uninstall extensions.
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.

1 participant