Browser chrome freeze on history API
Categories
(Core :: DOM: Navigation, defect)
Tracking
()
People
(Reporter: andreien, Assigned: wwen)
References
(Blocks 1 open bug, Regressed 1 open bug)
Details
(Keywords: csectype-dos, reporter-external, sec-low, Whiteboard: [client-bounty-form] [adv-main132+] [adv-esr128.4+])
Attachments
(2 files, 2 external files)
The browser chrome (mostly) freezes when busy loop updating the scrollRestoration string.
This is the same bug as https://bugzilla.mozilla.org/show_bug.cgi?id=1314912, but instead can be reproduced on Firefox 129 with the following slightly different setup:
while (1) {
history.scrollRestoration = "auto"
}
The effect is the same, the browser chrome is mostly frozen, and the parent process seems to be affected.
I have reproduced on different operating systems. I assume this bug should be sec-low.
Updated•2 years ago
|
Comment 1•2 years ago
|
||
I guess nsHistory::SetScrollRestoration could use a CheckLocationChangeRateLimit check.
Comment 2•2 years ago
|
||
Yes, we could cover that field as well. Most likely this IPC call causes the DoS: https://searchfox.org/mozilla-central/rev/e942f7bc56cd103bba86b396ddeba5b1ab04f1a4/docshell/base/nsDocShell.cpp#11544
There are many APIs which can be DoSed like that, not sure if this is worth fixing on a case-by-case basis. For the history interface we've done it before so I'm not opposed to it.
William, would you like to take this bug? See Bug 1314912 and comment 1 for context.
Comment 3•2 years ago
|
||
yeah, on IPC side there would be likely many similar cases.
| Assignee | ||
Comment 4•2 years ago
|
||
Yeah, I can definitely take this bug. I'll take a look later today.
Comment 5•2 years ago
|
||
Thanks!
Updated•2 years ago
|
Updated•2 years ago
|
| Assignee | ||
Comment 6•2 years ago
|
||
Updated•2 years ago
|
Updated•2 years ago
|
Comment 8•2 years ago
|
||
Updated•2 years ago
|
Updated•2 years ago
|
Comment 9•2 years ago
|
||
Please nominate this for ESR128 approval when you get a chance. It grafts cleanly.
| Assignee | ||
Comment 10•2 years ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D221255
Updated•2 years ago
|
| Assignee | ||
Comment 11•2 years ago
|
||
Test site for QA to verify bug
Comment 12•2 years ago
|
||
esr128 Uplift Approval Request
- User impact if declined: Possible DOS slowing or crashing browser
- Code covered by automated testing: yes
- Fix verified in Nightly: no
- Needs manual QE test: yes
- Steps to reproduce for manual QE testing: Open the test.html file attached in the bug, the browser chrome should not slow down or freeze
- Risk associated with taking this patch: Low
- Explanation of risk level: Rate limit is not aggresive, low potential for breakage. No breakage seen from rate limiting existing APIs
- String changes made/needed: No
- Is Android affected?: yes
| Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 13•2 years ago
|
||
| uplift | ||
Updated•2 years ago
|
Updated•2 years ago
|
Comment 14•2 years ago
|
||
Using an old Nightly build from 2024-08-12 I get a OOM crash when using the attached testcase https://crash-stats.mozilla.org/report/index/6e8fd41e-64ce-4fb1-8d07-c93f70241018, verified that using latest Firefox Beta 132.0b7 and latest 128esr build from treeherder across platforms (Windows 11, macOS 13 and Ubuntu 22.04) the testcase does not crash anymore and it just displays the string "Welcome to My Simple jQuery Page" in the tab content.
Updated•2 years ago
|
Comment 15•2 years ago
|
||
Updated•2 years ago
|
Updated•2 years ago
|
Updated•1 year ago
|
Description
•