# uBlock Origin patches one-click universal XSS flaw

> Source: <https://dev.to/randomchaos/ublock-origin-patches-one-click-universal-xss-flaw-2p2m>
> Published: 2026-11-21 06:25:21+00:00

**Recommendation:** Authenticate messages between embedded iframes and privileged extension code with a per-session secret, and never concatenate untrusted fields like `opt` into filter strings without rejecting newlines.
More in the playbook "Securing agents and AI tools": <https://wpnews.pro/playbooks/agent-security>

A malicious website could make uBlock Origin inject arbitrary JavaScript into any other site, triggered by a single click anywhere on the attacker's page. The bug was in the element picker, the tool you summon by right-clicking a page to build a filter that hides an element without reloading. The MV2 Firefox build had the one-click universal XSS; uBO Lite, the MV3 build, had a related but less severe variant. Both are now patched, and the GitHub advisory has the specifics.

The researcher credits GPT-5.6 Sol with finding the issue after being pointed at the idea that filter injection might yield UXSS, then verified it and wrote up the result, with Claude producing most of the proof-of-concept code.

The element picker is an iframe the extension injects into the page, loaded from a URL like `moz-extension://<UUID>/web_accessible_resources/epicker-ui.html`. That iframe can message the extension's background script and ask it to add a filter. Filters added this way are treated as trusted, and a trusted filter can carry a scriptlet that runs JavaScript in the target page. A website that can drive the picker and get one trusted filter committed can therefore run code on any domain.

The attack is four steps: recover the picker's URL, embed it in an invisible iframe, feed the picker the filter you want, and get the user to click the hidden Create button.

On Firefox the picker URL depends on the extension's internal UUID, which is randomized per installation. On a default install, uBO ships a filter from uAssets, `lootdest.*##+js(no-fetch-if, adsbygoogle, war:googlesyndication_adsbygoogle.js)`, that hooks `fetch`. When it fires, it makes an XHR to `moz-extension://<UUID>/web_accessible_resources/googlesyndication_adsbygoogle.js` and returns that response as the fetch body, swapping a request for ad-server JavaScript with a harmless stub that keeps the same API. The attacker's page can override `XMLHttpRequest.prototype.open`, trigger the filter with `fetch('/adsbygoogle.js').catch(() => {})`, and read the `moz-extension` URL, and with it the UUID, out of the XHR the hook makes. The researcher notes this is only one of several ways the UUID can leak.

With the URL known, the page sets an iframe's `src` to the picker and talks to it over a MessageChannel: `iframe.contentWindow.postMessage({ what: 'epickerStart' }, '*', [ch.port2])`. The picker replies with a start message; the attacker sends `showDialog` with a filter and a `resultsetDetails` message to enable the Create button and set `opt`.

The picker normally restricts what you can enter and blocks scriptlet filters. The bypass is that `opt` field in the second message. `opt` is meant to be the network-request type to match, like `image`, and gets appended to the filter after a `$`, producing `$image`. Since the attacker controls it, a newline turns one value into two lines: `"image\ngoogle.com##+js(trusted-rpnt, script, ...)"` smuggles in an arbitrary trusted filter that injects a script.

The root problem is that the picker accepted messages from whatever embedded it. One of the fixes adds a secret password that the real content script hands to the picker, which the picker includes in its opening postMessage, so an attacker's iframe cannot impersonate the legitimate initiator.

The researcher did not build the clickjacking step but describes it: overlay content on the embedded picker or set the iframe to `opacity: 0`, then position it under something the user will click. One click anywhere on the page is enough to commit the filter.

Trusted filters from the picker stay trusted until a recompile, and editing your custom filters forces a recompile that clears the trust. That does not help a victim much, because the attacker can just open the target site immediately after the filter lands.
