Comment

Comment by Andrews54757

Requirements as listed by the article:

1. Browser extension has a wildcard pattern for content script.

2. Content script passes postMessage messages to the background script using sendMessage.

3. Background script passes the message to native application using sendNativeMessage.

4. Native application handles the message dangerously, leading to code execution.

Requirement 2 seems to be the most important. postMessage messages should never be passed to sendMessage raw without validation. Fortunately, this should be a rare occurrence in the wild. It only provides very specific benefits to use postMessage in an extension to begin with, and developers who do need to use it are more likely to be aware of the potential vulnerability.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton