Quick Answer: A uBlock Origin XSS flaw let a malicious website abuse the extension's element picker to add "trusted" filters, which can inject JavaScript into any site. The attack needed one click and a leaked extension UUID. It affected the Firefox MV2 build and was fixed upstream, with the MV3 version (uBO Lite) hit by a less severe variant.

Most people treat an ad blocker as the safest thing in their browser. It sits between you and the web, so it must be trustworthy. That assumption is what makes this bug interesting. A researcher found that a random web page could push uBlock Origin into adding filters that run code on other sites, and all it needed was a single click from you. The original write-up walks through the chain step by step, and it's a useful case study in how extension privileges can leak into the page.

Why a Filter List Is Really Code Execution

The first thing to understand is that uBlock Origin filters aren't just lists of URLs to block. Some filters are scriptlets, small JavaScript snippets that the extension injects into pages to change how they behave. Scriptlets are powerful, so uBO splits them into two trust levels. Ordinary filters run with restricted capabilities. Trusted filters, marked with the +js() syntax and the trusted- prefix, can run arbitrary code in a page's context.

That's the lever. If an attacker can get a trusted filter into your configuration, they can run JavaScript on any domain you visit. A rule like example.com##+js(trusted-rpnt, script, ...) is not a cosmetic tweak. It's code execution, and it lives in the extension's own trust boundary.

The researcher's key point is that filters added through the element picker are treated as trusted by default. The picker is meant to be a convenience for blocking a page element. In practice, it becomes a way to write privileged rules, so anyone who can drive it can write privileged rules.

How the Attack Found the Element Picker

Firefox extensions expose some internal pages through moz-extension:// URLs. Those URLs contain a UUID that's random for each installation. In theory, that makes them hard for a website to guess. In practice, it's a secret that can leak.

Here's where most people get surprised. uBO's default filter set includes a rule from the uAssets project that hooks fetch for a Google ad script and fetches a local replacement from the extension. The replacement request goes to a moz-extension://<UUID>/... URL. A web page can hook XMLHttpRequest.prototype.open before triggering that fetch, then read the UUID from the URL the extension requests. The page only has to call fetch('/adsbygoogle.js') to make the extension do the work.

This is the part practitioners don't advertise: a page doesn't need a bug in the extension's own code to learn its UUID. It only needs the extension to make a request the page can observe. Any filter rule that touches an extension resource can become a leak. The researcher noted several other ways the UUID could leak, so removing this one rule would not have closed the door.

Driving the Picker Through a Hidden Iframe

With the UUID in hand, the attack is mostly plumbing. The malicious page creates an iframe pointing at moz-extension://<UUID>/web_accessible_resources/epicker-ui.html. Because the picker is a web-accessible resource, the page can load it like any other frame.

Next comes a MessageChannel. The page sends an epickerStart message with a port, and the picker replies with its own messages. The attacker then sends a showDialog message with a filter and a resultsetDetails message that enables the Create button and sets an opt field. Normally opt holds a request type such as image, and the picker appends it to the filter as $image.

The trick is the newline. The researcher set opt to image\ngoogle.com##+js(trusted-rpnt, script, ...). The picker didn't validate it, so the newline split the output into a second, trusted rule. That's a classic injection pattern, the same family as SQL or header injection: untrusted input crosses a delimiter that the parser later treats as structure.

The root cause is simple to state. The picker accepted messages from any page that could frame it, and it trusted the content of those messages. Neither check should have been missing. A correct design would verify the sender, and it would validate every field before writing it into a filter.

Clicks, Overlays, and the Recompile Caveat

The last step is getting the click. The researcher didn't implement a full clickjacking overlay, but explained that a malicious page could place the invisible picker under a fake button, or set the iframe's opacity to 0 and align it over a real control. One click on the page is enough to press the hidden Create button.

That's a more serious problem than it looks. Many users treat a single click on a normal-looking page as low risk. Here's where it gets uncomfortable: the attacker can open the victim page directly, so the click is the only user action required.

There's a mitigating detail. Trusted status is cleared when uBO recompiles your filter lists, which happens when you edit your custom filters. The researcher pointed out that this doesn't help much, because the attacker can add the filter and use it immediately. Your protection is the fix, not the recompile.

What the Fix Changed and Where the Risk Remains

The upstream fix added a secret token. The real picker receives the token from its content script, and it must include the token in its initial postMessage. A page that hasn't seen the token can't impersonate the picker. The researcher also said the MV3 build, uBO Lite, was affected by a similar but less severe issue. Lite doesn't support the same trusted scriptlet model in the same way, so the impact is narrower.

Here's the honest caveat. A secret token closes this specific path, but it doesn't remove the underlying design. Trusted filters remain powerful, and any future bug that lets a page write to your filter configuration would be just as dangerous. If you're maintaining a privileged extension, the lesson is to limit what each internal UI can do, validate every input as if it came from the web, and assume your internal URLs will eventually leak.

What You Should Do Right Now

Update uBlock Origin to the latest release from the official Mozilla Add-ons page or the project's GitHub. If you run Firefox, check that your version includes the fix described in the GitHub advisory. Then review your custom filters for any +js() or trusted- rules you don't recognize. If you find one you didn't write and can't explain, remove it and check whether it came from a list you subscribed to.

Keep one habit in mind. Extension security is about trust boundaries, and this bug crossed one at the point where a web page could talk to an internal UI. Most people never look at those boundaries, but they're where the real risk sits.

Frequently Asked Questions

What is a uBlock Origin XSS vulnerability?

A uBlock Origin XSS vulnerability is a flaw that lets a website inject JavaScript into other sites through the extension. In this case, a malicious page drove the element picker to add a trusted filter, which runs scripts in the context of any domain. The attack required one user click and has been fixed upstream in the Firefox MV2 version.

How can I tell if uBlock Origin is updated and safe?

Check your version in the extensions manager and compare it with the latest release on the official Mozilla Add-ons page or GitHub. Updates usually install automatically in Firefox, so confirm auto-update is on. Also review your custom filters for unfamiliar +js() or trusted- rules, since those are the high-privilege entries.

Does this affect uBlock Origin Lite on Chrome?

The researcher said uBO Lite, the MV3 version, had a similar but less problematic issue. Lite's design restricts scriptlet capabilities more than the MV2 build, so the impact is narrower. You should still update to the latest release, because narrower doesn't mean zero.

Why does a random UUID not protect an extension?

A random UUID protects only as long as it stays secret. In this case, a default filter rule made a request to an extension URL that a page could observe through a hooked XHR, which leaked the UUID. Any internal resource that a page can trigger a request for can become a leak, so UUIDs should be treated as a weak defense, not a security boundary.

Update uBlock Origin today, then open your custom filters and look for any trusted rule you don't recognize. Pass this to anyone who uses Firefox with an ad blocker and assumes it can't be turned against them.