Closed
Bug 1460286
Opened 7 years ago
Closed 5 years ago
large ServiceWorkerRegistrar contents can trigger too-large message crash on startup
Categories
(Core :: DOM: Service Workers, defect, P2)
Tracking
()
People
(Reporter: qab, Assigned: perry)
References
(Depends on 1 open bug, Blocks 2 open bugs)
Details
(Keywords: csectype-dos, sec-moderate)
Attachments
(2 files)
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.
Reporter | ||
Comment 1•7 years ago
|
||
This is the worker example that should be hosted with the original PoC.
Also would like to clarify, the last crash I said it was from a new profile. I ran the PoC steps again on the new profile and it crashed. You can always create a new profile and firefox will work, just not the profile where we spammed service worker registration.
Updated•7 years ago
|
Group: firefox-core-security → core-security
Component: Untriaged → DOM: Service Workers
Product: Firefox → Core
Updated•7 years ago
|
Group: core-security → dom-core-security
Updated•7 years ago
|
Flags: needinfo?(bkelly)
Comment 2•7 years ago
|
||
Note sure this needs to be a secure bug. Its hitting a MOZ_CRASH:
MOZ_CRASH(IPC message size is too large)
We don't chunk the service worker list on startup. If you are using very large scope strings obviously we hit this internal message size limit.
This is a DoS/compat/stability issue, but not a security problem.
Somewhat related to:
https://github.com/w3c/ServiceWorker/issues/1310
Flags: needinfo?(bkelly)
Comment 3•7 years ago
|
||
Note, this problem will go away once our e10s refactor is complete. We won't need to send the registration list across IPC at all.
Updated•7 years ago
|
Group: dom-core-security
status-firefox60:
--- → wontfix
status-firefox61:
--- → affected
status-firefox62:
--- → affected
status-firefox-esr52:
--- → disabled
status-firefox-esr60:
--- → disabled
Updated•7 years ago
|
Depends on: ServiceWorkers-e10s
Updated•7 years ago
|
Summary: Persistent Firefox crash on start up using Service Workers → large ServiceWorkerRegistrar contents can trigger too-large message crash on startup
Reporter | ||
Comment 4•7 years ago
|
||
Would this bug not fall into the "Persistent DoS attacks that prevent the user from starting Firefox or another application in the future" description from https://wiki.mozilla.org/Security_Severity_Ratings ?
Flags: needinfo?(bkelly)
Comment 5•7 years ago
|
||
Ah, you are correct.
Updated•7 years ago
|
Group: core-security → dom-core-security
Updated•7 years ago
|
Priority: -- → P2
Updated•7 years ago
|
Keywords: csectype-dos
Updated•6 years ago
|
Flags: sec-bounty?
Updated•5 years ago
|
Flags: sec-bounty? → sec-bounty+
Assignee | ||
Updated•5 years ago
|
Assignee: nobody → perry
Assignee | ||
Comment 6•5 years ago
|
||
Comment 7•5 years ago
|
||
Hi Abdulrahman, can you confirm that this has gone away?
Thank you!
Flags: needinfo?(qab)
Assignee | ||
Comment 8•5 years ago
|
||
ni? myself to verify one last time or close.
Flags: needinfo?(perry)
Assignee | ||
Comment 9•5 years ago
|
||
Unable to reproduce and likely no longer an issue as noted by comment 3, so closing this.
Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Flags: needinfo?(perry)
Resolution: --- → WORKSFORME
Updated•5 years ago
|
Flags: needinfo?(qab)
Updated•1 year ago
|
Group: dom-core-security
You need to log in
before you can comment on or make changes to this bug.
Description
•