Possible UAF in nsGlobalWindowInner::TryToObserveRefresh
Categories
(Core :: Layout, defect)
Tracking
()
People
(Reporter: pierov, Assigned: dholbert)
References
Details
(Keywords: csectype-uaf, reporter-external, sec-moderate, Whiteboard: [fixed in bug 1868456])
Attachments
(2 files)
In Tor Browser we found a possible use-after-free in the lambda defined in nsGlobalWindowInner::TryToObserveRefresh.
The UAF was caused by a patch we added, so we haven't found a way for users to reproduce the problem in Firefox, but we still wanted to open this Bug because maybe a similar condition could be triggered in another way.
In our case, MaybeCallDocumentFlushedResolvers made the code of our patch that interacts with the clipboard run.
The Wayland implementation called gtk_main_iteration, which in turn at a certain point called the the lambda again.
After the nested run, the observer was deleted, and mRawPtr of win was set to 0xe5e5e5e5e5e5e5e5. Therefore, the win->mObservingRefresh = false; in the first run resulted in a segmentation fault.
I've attached a reduced version of the patch that enables the crash.
To reproduce it, apply the patch, run Firefox on Linux with Wayland, pin an extension such as NoScript or uBlockOrigin, and click on its icon.
The browser should crash immediately. Otherwise, try to click again.
| Reporter | ||
Comment 1•2 years ago
|
||
Updated•2 years ago
|
Comment 2•2 years ago
|
||
It looks like we have an intermittent crash on file (bug 1857056) for the TryToObserveRefresh lambda. 2 of the 3 recent crashes have a poison-y value in rax (0xe5e5e5e500000004 and 0xe5e5e5e5ffffffff), so maybe it is a real issue for regular Firefox.
| Assignee | ||
Comment 3•2 years ago
|
||
Yeah, this looks the same as bug 1857056. As noted in bug 1857056 comment 14, I can reproduce locally when running a particular browser-chrome mochitest; and that test seems to be doing similar things to what was described in comment 0 here (clicking/manipulating toolbar buttons).
Updated•2 years ago
|
Updated•2 years ago
|
Comment 4•2 years ago
|
||
Fixed by bug 1868456.
Comment 5•2 years ago
|
||
No need for a separate rating here. Also the crash seems to only be triggered by doing specific things with privileged chrome code, so sec-high is probably too high of a rating.
Updated•2 years ago
|
Comment 7•2 years ago
|
||
Flagging for bounty; recipient would be the original person who reported it to Tor Project.
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Description
•