Security News Universal XSS in uBlock Origin from website-driven element picker

lokamoka820

Level 58
Verified
Top Poster
Well-known
Earlier this month I found a one-click universal XSS issue with uBlock Origin (the MV2 Firefox version, although a similar but less problematic issue also affected the MV3 version, uBO Lite), where a malicious website could trick the extension into adding arbitrary trusted filters. Trusted filters can inject JavaScript code into pages, and so the malicious website could create a trusted filter on another website and run arbitrary JS in the context of any site. This issue is fixed now; you can read the GitHub advisory for some more details.

GPT-5.6 Sol did most of the hard work of finding the issue. I figured there might be some kind of UXSS from filter injection, so I asked it to take a look, and it found the issue. I then checked and verified the issue it proposed. I wrote all of the prose in this post myself; Claude wrote most of the code for the PoC.
 
Hi lokamoka820 — this is an interesting example of AI-assisted vulnerability research done properly: the model proposed an attack chain, but you reproduced it, checked the assumptions and disclosed it to the maintainer. The verification is what turns plausible model output into an actual finding.

The technical impact is substantial because this was not ordinary XSS confined to the malicious site’s origin. The chain crossed the extension’s trust boundary:

  1. The page obtained uBO’s internal extension UUID through page-tainted XHR methods.
  2. It embedded the web-accessible element-picker UI.
  3. It controlled that UI through messages.
  4. A newline in the picker’s opt value allowed an additional trusted scriptlet filter to be injected.
  5. Clickjacking could turn an ordinary click on the malicious page into pressing the invisible Create button.

That last condition means “one-click” is accurate, but not zero-click. Conversely, saying the victim had to deliberately operate uBO’s picker would understate it—the embedded picker could be invisible.

The GitHub advisory rates it High, lists Firefox uBO 1.75.2 and earlier as affected, and 1.75.4 as patched. Version 1.76.0 then added further filter validation and temporarily prevented war:-related filters. Firefox users should verify their version under about:addons; installing the current 1.76.4 release, rather than merely stopping at the minimum fixed version, is the sensible course.

The fixes also look appropriately layered: authenticate picker startup with a secret token, validate the completed filter at creation time, and remove the page-tainted XHR path. That addresses the trust failure rather than playing whack-a-mole with one PoC.

For anyone wondering whether an older installation means compromise: it does not. The advisory establishes capability, not observed exploitation in the wild. An unexpected trusted scriptlet in My filters would be relevant evidence, but simply having run an affected version is not. Your note about uBO Lite should also remain separate—the public advisory’s precise version boundary applies to Firefox MV2 uBlock Origin, not automatically to every uBO Lite release.

Sources
 
@lokamoka820 thanks great research👍

For uBlock Dynamic users, is not possible, see explanation (@Bot still not worried about uBO's uBOL's json-edit scriptlet family ;))

1794944589455.png


The cookie consent clicker is not vulnerable to this attack either
1794944930632.png
 
Last edited:
@lokamoka820 thanks great research👍 For uBlock Dynamic users, is not possible, see explanation (y) (@Bot still not worried about uBO's uBOL's json-edit family ;)) The cookie consent clicker is not vulnerable to this attack either


For this specific GHSA attack chain, yes—assuming the tables accurately describe the current builds, both designs break it.

For uBlock Dynamic, use_dynamic_url is useful exposure reduction, but it is not a substitute for authorization. The decisive protections are:

  • the per-session secret required to start the picker—the same class of check uBO added;
  • strict parsing of picker output as a CSS selector;
  • no compilation of scriptlet lines from that input path;
  • rejection of trusted-*, supplied code and external URLs.

Thus steps 2 and 3 each independently stop the published exploit. Even discovering the resource URL would not complete the chain.

The cookie-consent clicker differs more fundamentally: there is no iframeable extension picker, no page-controlled messaging entry point, and its saved-rule format is data rather than executable scriptlet syntax. A closed shadow root alone would not be a security design I would bet the farm on, but a top-layer UI combined with no page message handler and no code-capable rule format is a much stronger arrangement. Page-world auto-decline code might be interfered with by the page running it, but without extension privileges or a return channel that remains interference within that page—not universal XSS.

And yes, the json-edit tease is fair for this route. The existence of a powerful primitive was not the vulnerability; the vulnerability was an untrusted webpage gaining a path to save a trusted primitive. If uBD rejects trusted scriptlets and never executes picker/imported scriptlet lines, the family is unreachable here. Powerful features deserve scrutiny, but not guilt by family name.

Sources
 
Reinstalled Brave again to estimate its daily disk writes compared to Edge.
Until now, they are almost equal; I could not find an explanation for the significantly higher diske writes on your machine.

Regarding shields, I have noticed a significant improvement.
On resilient media piracy websites, it can block hidden scripts launching popup ad windows on clikcing empty areas, without the help of hagezi pro in dns as before.
Currently it is as effective as uBOL.
 
And yes, the json-edit tease is fair for this route. The existence of a powerful primitive was not the vulnerability; the vulnerability was an untrusted webpage gaining a path to save a trusted primitive. If uBD rejects trusted scriptlets and never executes picker/imported scriptlet lines, the family is unreachable here. Powerful features deserve scrutiny, but not guilt by family name.
Thanks for confirming, but what can´t execute can´t do wrong either. That is a much easier line to draw than we have to check and scrutinize.

I am totally opposed of injecting third-party code (by an extension) which is so powerfull as the json-edit family, which has a supply chain link also (not to speak about issues found like this one).

Again @lokamoka820 thanks for disclosing this
 
Thanks for confirming, but what can´t execute can´t do wrong either. That is a much easier line to draw than we have to check and scrutinize. I am totally opposed of injecting third-party code (by an extension) which is so powerfull as the json-edit family, which has a supply chain link also (not to speak about issues found like this one). Again @lokamoka820 thanks for disclosing this


Capability minimisation is a sound position: if an extension contains no compiler or handler for a capability, an input-validation mistake cannot unexpectedly expose that capability.

One clarification about my previous post, though: the sentence beginning “If uBD rejects…” was conditional, not an independent audit of uBlock Dynamic’s current code. Its own README says imported ABP rules can invoke uBO Lite and AdGuard scriptlets, so uBD is not a “no scriptlets execute” design. The relevant question is exactly which scriptlets and arguments it accepts.

Three distinctions matter here:

  • This advisory was not a json-edit vulnerability. The published PoC injected trusted-rpnt through the picker. Therefore, omitting trusted-json-edit reduces capability but does not by itself prove that the vulnerable picker route is impossible. Authentication and validation of that route still matter. See the advisory.
  • The json-edit family is not all equivalent to arbitrary code execution: ordinary variants can remove selected properties, while trusted- variants can assign values. The latter plainly deserve a much tighter trust boundary.
  • The supply-chain concern is real, but “injecting third-party code” is slightly too broad. uBO normally injects scriptlet implementations bundled and vouched for by the project; a trusted list supplies the invocation and arguments. A compromised trusted list could still misuse those capabilities, so the risk has not vanished—it is simply more constrained than downloading arbitrary remote JavaScript.

So I agree with the narrower policy: omitting trusted, value-mutating scriptlets lowers both attack surface and supply-chain blast radius. I would not extend that into “therefore the picker needs no scrutiny” or “all json-edit variants are arbitrary third-party code.” Removing the gun helps; locking the door remains advisable.

Sources
 
Capability minimisation is a sound position: if an extension contains no compiler or handler for a capability, an input-validation mistake cannot unexpectedly expose that capability.

One clarification about my previous post, though: the sentence beginning “If uBD rejects…” was conditional, not an independent audit of uBlock Dynamic’s current code. Its own README says imported ABP rules can invoke uBO Lite and AdGuard scriptlets, so uBD is not a “no scriptlets execute” design. The relevant question is exactly which scriptlets and arguments it accepts.
Scriptlets rejected:
1. Requiring trust
2. Accepting raw JS as input
3. Accepting long parameters as input
 
Scriptlets rejected: 1. Requiring trust 2. Accepting raw JS as input 3. Accepting long parameters as input


That fills in the missing detail. uBlock Dynamic supports a restricted scriptlet allowlist; it does not accept every capability exposed by the upstream engines.

For this advisory:

  1. Rejecting scriptlets requiring trust is decisive. It excludes the published trusted-rpnt payload and the trusted json-edit family.
  2. Rejecting raw JavaScript prevents imported rules from becoming an arbitrary-code channel.
  3. Limiting parameter length is useful defence-in-depth against oversized input and parser/resource abuse, though it is not a capability boundary by itself—a dangerous instruction can be short.

So my earlier conditional can be stated more firmly: uBD’s importer cannot execute the trusted payload used by this UXSS chain. It still makes sense to authenticate and validate the picker path, because a webpage should not be able to create even ordinary rules without authorization. Capability restriction and picker authorization are separate layers; uBD apparently has the stronger restriction on the former.

It would be worth documenting those three rejection rules in the public README, since its current phrase “processes all uBO-lite and all AdGuard scriptlets used in the AG Base filter” sounds broader than the implementation you have described.

Sources
 
@lokamoka820 again thanks for using this angle. I applied more hardening precautions to the power tools (I had not though of this point of attack entry).
  1. Import and Restore now use the same checks as the pickers
    A user can save/restore its settings, I assumed because they were saved by the user the restored/imprted rules were correct also (thanks again)
  2. externally_connectable is closed (no extensions, no web pages).
    Without it, any other extension could message uBD. uBD never listens to them, so nothing changes in practice.
  3. Stricter extension-page CSP:script-src 'self'; object-src 'none'; base-uri 'none'; form-action 'none'.
    • This is tighter than Chrome’s default, which also allows WebAssembly; uBD uses none.
    • I checked every extension page for forms, <base> tags, plugin objects and inline scripts; none use them.
 
Last edited:

MalwareTips community

Join the discussion

Create a free account to reply to this thread, ask your own questions and get help from the community.

  • Reply and ask questions
  • Get alerts when someone answers
  • Free malware removal help

Join 75,660 members who help each other for free, since 2010.

Create free account
or continue with

Recently browsing

Members and guests who viewed this thread in the last 5 minutes

Back
Top