1 postMessage, every site: uBlock Origin's picker XSS
1 postMessage, every site: uBlock Origin's picker XSS One postMessage with a stolen extension UUID was enough to drive uBlock Origin's element picker from any website — and the picker would then install a trusted scrip
1 postMessage, every site: uBlock Origin's picker XSS
One postMessage with a stolen extension UUID was enough to drive uBlock Origin's element picker from any website — and the picker would then install a trusted scriptlet filter that runs JavaScript on any site the attacker chose. I traced the whole chain in the source, and the fix is three commits totalling 19 lines.
The chain, as reported
The bug was reported by email on November 1, 2026, by a researcher going by "syvb", and disclosed publicly on November 15 in a writeup by the same author. The writeup credits GPT-5.6 Sol with most of the hard work of finding it — the researcher suspected a filter-injection UXSS was possible, asked the model to look, and verified what it proposed. The advisory is GHSA-cmqw-9r2w-6wv2, rated high, with no CVE assigned.
The attack has four steps, and I verified each one against the code at the parent of the fix:
1. Learn the extension's random UUID. On Firefox, uBlock Origin's internal UUID is random per install, and you need it to build the picker URL. The leak comes from uBO's own filter list: a lootdest.*##+js(no-fetch-if, adsbygoogle, war:googlesyndication_adsbygoogle.js) rule replaces ad-server JavaScript fetches with a dummy script by making an XHR to moz-extension://<UUID>/web_accessible_resources/googlesyndication_adsbygoogle.js from inside the fetch hook. A malicious page hooks XMLHttpRequest.prototype.open, triggers fetch('/adsbygoogle.js'), and reads the UUID out of the intercepted URL. The writeup notes this is only one of several leak paths.
2. Iframe the picker. The element picker lives at moz-extension://<UUID>/web_accessible_resources/epicker-ui.html — a web-accessible resource, so any page can embed it in an invisible iframe.
3. Drive it with postMessage. This is the core defect. Here is the pre-fix message listener in src/js/epicker-ui.js, verbatim from the parent of the fix commit:
globalThis.addEventListener('message', ev => {
const msg = ev.data || {};
if ( msg.what !== 'epickerStart' ) { return; }
if ( Array.isArray(ev.ports) === false ) { return; }
if ( ev.ports.length === 0 ) { return; }
pickerContentPort = ev.ports[0];
...
startPicker();
pickerContentPort.postMessage({ what: 'start' });
}, { once: true });
No origin check. No secret. Any page that could guess the URL could send { what: 'epickerStart' } with a MessageChannel port and the picker would talk to it. The picker then accepts showDialog and resultsetDetails messages over that port. The resultsetDetails handler does this:
case 'resultsetDetails': {
resultsetOpt = msg.opt;
msg.opt is attacker-controlled, stored raw, and later appended to the filter being created:
if ( resultsetOpt !== undefined ) {
opts.push(resultsetOpt);
}
if ( opts.length ) {
filter += '$' + opts.join(',');
}
So opt set to "image\ngoogle.com##+js(trusted-rpnt, script, ...)" turns one network filter into two lines — the second a trusted scriptlet filter for an arbitrary domain. The picker normally refuses scriptlet filters; the newline smuggles one past that restriction. Filters added by the element picker are treated as trusted, so the injected scriptlet runs JavaScript in the context of any site.
4. Get the click. The attacker still needs the user to press the picker's Create button once. The writeup's author didn't implement this part, but the options are the usual ones: overlay page content on the invisible iframe, or set its opacity to 0 and let any click on the page land on it. One click, and the trusted filter is installed. Editing custom filters later would trigger a recompile and clear the trust — but the attacker can open the victim page immediately, so that barely matters.
The fix: a password, then a parser
Raymond Hill fixed it in three commits across three releases, and the commit messages read like a checklist of the chain above:
-
1.75.2, November 2 —
bf69cf7, "Avoid use of potentially tainted XHR methods in scriptlets". This closes the UUID leak path: scriptlets no longer use XHR methods a page can hook to learn the extension UUID. -
1.75.4, November 3 —
9859477, "Launch element picker only with a verified secret token". The background page generatesself.crypto.randomUUID()once per session and hands it only to the real content script over extension messaging. The content script passes it in theepickerStartpostMessage, and the picker UI now verifies it before accepting the port:
const epickerPassword = await vAPI.messaging.send('elementPicker', {
what: 'elementPickerPassword'
});
if ( msg.password !== epickerPassword ) { return; }
An attacker page can't learn the password — it never crosses a web page boundary — so step 3 dies even if the UUID leaks again.
-
1.76.0, November 8 —
b1f7d27, "Validate about to be created filter in element picker", plus150df12, "Prevent war:-related filters for the time being". Even with a valid session, the filter the picker is about to create is now run through the static filter parser (parseRawFilter) and rejected if it isn't a well-formed network or cosmetic filter. The newline injection fails at this layer even if the password check is ever bypassed.
The numbers that stayed with me: the vulnerable listener was 12 lines, the password fix is 19 lines across 3 files, and the whole window — report on November 1 to the defense-in-depth fix on November 8 — was 7 days. The MV3 build, uBO Lite, had a similar but less severe variant of the same issue.
What I take from this
The bug is not really "the picker trusted postMessage". It's that a privileged UI was reachable from the web at all: a web-accessible HTML page that accepts commands over postMessage('*') is a web page with extension privileges, and the only thing separating it from every site on the internet was a random UUID that the extension itself leaked through a scriptlet. The fix's shape is the lesson — Hill didn't just add the password. He fixed the leak (1.75.2), added the authentication (1.75.4), and then validated the output anyway (1.76.0), because each layer assumed the previous one would hold, and the previous one hadn't.
If you run uBlock Origin on Firefox, check you're on 1.76.0 or later. If you build extensions, the audit question is one sentence: is there any web-accessible page of yours that acts on postMessage without a secret only your content script can know? If the answer is yes, you have this bug — you just haven't been emailed about it yet.
Sources: Universal XSS in uBlock Origin from website-driven element picker (November 15, 2026); GHSA-cmqw-9r2w-6wv2 (high, published November 15, 2026); fix commits bf69cf7, 9859477, b1f7d27 and summary cbb22a5 in gorhill/uBlock. All code quoted above was read from the repository at the parent of each fix commit.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.