hn.today

Universal XSS in uBlock Origin from website-driven element picker

iter.ca563 points161 comments
Screenshot of Universal XSS in uBlock Origin from website-driven element picker

A security flaw in uBlock Origin’s Firefox Manifest V2 version allowed a malicious website to use the extension’s element picker to add arbitrary trusted filters. Because trusted filters can inject JavaScript into webpages, an attacker could make code run in the context of other websites, creating a one-click universal cross-site scripting vulnerability. A related issue affected uBlock Origin Lite, the Manifest V3 version, but was less severe. The flaw has been fixed.

The attack exploited how the element picker works: uBlock injects an extension-hosted iframe that communicates with the extension to create filters. A site could uncover the extension’s per-installation Firefox UUID, embed the picker invisibly, and send it messages that controlled the proposed filter. By putting a newline in a field normally used for a network-request type, the attacker could bypass the picker’s restrictions and append an arbitrary trusted script-injection filter. The site could then position the hidden iframe’s Create button under a click the user was already making. Filters created this way stayed trusted until a later filter recompile, so an attacker could promptly open the targeted site and execute the injected code. The key fix was to require a secret value, supplied by the legitimate content script, before the picker accepts messages.

Read on iter.ca161 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Security

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.