Skip to content
DoS Disclosed report Intermediate

large ServiceWorkerRegistrar contents can trigger too-large message crash on startup

A web page could register many service workers with very long scope strings, causing Firefox to store a large amount of data. On subsequent startups, Firefox would crash while loading this data.

Abdulrahman Alqabandi Follow

Originally disclosed on Mozilla

  • Fixed in 21 months
  • Paid in 19 months
  • Disclosed after 21 months
Text
Created attachment 8974395
PoC.html

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36

Steps to reproduce:

Using the PoC tool attached, I registered ~300 service workers each pointing to a single JS file (worker source) but with max_length scope initiated. 

1. Host qsw.js attached in comment 1 in the same origin as PoC html file.

2. Open PoC, wait for the tab title to be 400+

3. Close firefox (try exiting normally or force it to shut using task manager.

4. Attempt to open Firefox, crash occurs.




Actual results:

The script kept registering service workers and I noticed a lot of memory is being used by firefox. So I closed it, after opening firefox again I get a crash error after a few seconds.

https://crash-stats.mozilla.com/report/index/aaefb078-3a83-457b-b359-1c6240180509#tab-details


I then thought maybe firefox is opening the same PoC file that has the script (from cache), so I attempted to open firefox in a private window. Same crash appears:
https://crash-stats.mozilla.com/report/index/87d6934a-2285-42a5-b052-197280180509#allthreads

I also tried to open firefox in safe mode, still crashes. 

The only thing that worked was creating a new profile and using it.


Works on release build as well:
https://crash-stats.mozilla.com/report/index/e500156e-7553-4ec0-af25-0ce130180509


Expected results:

Limit the number of service workers that can be registered. Limit max size of scope string to URL max size instead.

The original report as published on Mozilla's Bugzilla, by Abdulrahman Alqabandi. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the browser did not limit the number or size of service worker registrations, so a large stored registry caused a message size error on startup.

Impact

Firefox would crash on every startup for the affected profile, and the crash persisted in private browsing and safe mode, requiring a new profile to recover.

What the attacker needed

Victim visits a malicious page; same-origin worker script

How it was found

  1. Host the worker script on the same origin as the proof-of-concept page.
  2. Open the proof-of-concept page and wait until the tab title shows 400 or more.
  3. Close Firefox normally or force it to shut down.
  4. Reopen Firefox; a crash occurs after a few seconds.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A service worker is a script that a website can install in your browser to run in the background. This report shows that a malicious site could install hundreds of them with very long names, which made Firefox crash every time it started until the user created a new profile.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by Abdulrahman Alqabandi

View all

33 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.