Universal XSS Vulnerability Discovered in uBlock Origin

AI-generated image · Bay Street Wire
A security flaw in the Firefox version of the popular ad-blocker allowed malicious sites to inject arbitrary JavaScript via trusted filters.
A one-click universal cross-site scripting (UXSS) vulnerability was identified in the Manifest V2 Firefox version of uBlock Origin, as iter.ca first reported. A similar, though less severe, issue also affected the Manifest V3 version, uBO Lite.
The flaw centered on the extension's element picker, which allows users to create filter rules to block page elements. As detailed by iter.ca, a malicious website could leak the extension's internal UUID—a random identifier—by hooking an XHR request triggered by a specific uAssets filter rule.
Once the UUID was obtained, an attacker could embed the element picker in an invisible iframe and use a MessageChannel to send messages to the picker. By manipulating the "opt" field in these messages, the attacker could inject a newline character to bypass restrictions and add arbitrary trusted filters. Because filters created via the element picker are treated as trusted, the attacker could execute arbitrary JavaScript in the context of any website.
The attack would be completed by tricking a user into clicking a hidden "Create" button overlaid on the page. According to iter.ca, the vulnerability has been fixed. One of the implemented fixes involves requiring a secret password, provided by the content script, to be sent in the initial postMessage to ensure the element picker only accepts legitimate requests.

