`navigator.registerProtocolHandler()` can crash Thunderbird @ mozilla::dom::Navigator::CheckProtocolHandlerAllowed
Categories
(Thunderbird :: General, defect, P1)
Tracking
(thunderbird_esr78+ verified, thunderbird91 fixed)
People
(Reporter: neil, Assigned: neil)
References
()
Details
(Keywords: crash, topcrash-thunderbird, Whiteboard: [startupcrash])
Crash Data
Attachments
(2 files, 2 obsolete files)
1.42 KB,
patch
|
mkmelin
:
review+
|
Details | Diff | Splinter Review |
2.42 KB,
patch
|
mkmelin
:
review+
BenB
:
review+
wsmwk
:
approval-comm-beta+
wsmwk
:
approval-comm-esr78+
|
Details | Diff | Splinter Review |
navigator.registerProtocolHandler()
allows a small whitelist of permitted schemes. However some of these schemes are registered by Thunderbird. This means that if someone manages to access this API in Thunderbird but tries to pass one of those schemes then Thunderbird will immediately crash.
Updated•3 years ago
|
Updated•3 years ago
|
Assignee | ||
Comment 1•3 years ago
|
||
Now that bug 1717833 is fixed, Trunk Thunderbird can defend itself by setting the appropriate preferences.
Comment 2•3 years ago
|
||
@Neil: Can you please attach a patch that sets the preferences accordingly, with all relevant URL schemes, and test that it fixes the bug?
Assignee | ||
Comment 3•3 years ago
|
||
Of course on trunk the problem isn't so bad because web pages run in content processes but we might as well set the preferences anyway.
Updated•3 years ago
|
Comment 4•3 years ago
|
||
Is that all protocols? Don't we have a lot more, like imap:
, plus some internal ones like imap-message:
and similar?
Assignee | ||
Comment 5•3 years ago
|
||
I've only added prefs for those that cause a crash.
Comment 6•3 years ago
|
||
OK, could you please add all protocols?
Comment 7•3 years ago
|
||
Comment 8•3 years ago
|
||
Assignee | ||
Comment 9•3 years ago
|
||
(In reply to Wayne Mery from comment #7)
Does this only affect version 78?
On trunk the main process doesn't crash, only the child process for the page trying to register the protocol handler. I don't know how that shows up in the crash statistics, if at all.
Assignee | ||
Comment 10•3 years ago
|
||
snews
isn't currently allowed by navigator.registerProtocolHandler()
, which is why the original patch didn't have it. If we're going to add it, then as Ben suggested we should add the other 11 Thunderbird protocols as well, just in case.
Comment 11•3 years ago
|
||
Comment on attachment 9230746 [details] [diff] [review]
All Thunderbird protocols
Thanks. Looks good to me.
Comment 12•3 years ago
|
||
@Neil: You forgot imap-message:, news-message: etc., as mentioned in comment 4, see https://searchfox.org/comm-central/source/mailnews/base/src/nsNewMailnewsURI.cpp#49 for some.
Updated•3 years ago
|
Assignee | ||
Comment 13•3 years ago
|
||
The -message
versions aren't actually registered as Thunderbird protocols. I don't know what smile
is doing in nsNewMailnewsURI.cpp
but it's also not actually registered as a protocol.
Comment 14•3 years ago
•
|
||
Comment on attachment 9230786 [details] [diff] [review]
All registered and some unregistered protocols
Good. There's no legitimate reason to have webpages register imap-message:
, so better to block it, just in case.
Thanks. +1 from me.
Updated•3 years ago
|
Comment 15•3 years ago
|
||
Updated•3 years ago
|
Comment 16•3 years ago
|
||
FYI, Neil is sick at the moment.
Comment 17•3 years ago
|
||
I'm updateing the patch for Neil, because he cannot.
Adding mid
as requested.
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Comment 18•3 years ago
|
||
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/f4e363bebf69
Prevent registerProtocolHandler crashing for mailnews protocols r=mkmelin
Comment 19•3 years ago
•
|
||
Comment on attachment 9233102 [details] [diff] [review]
Fix, v4
[Approval Request Comment]
Regression caused by (bug #):
User impact if declined:
Thunderbird crashes
Testing completed (on c-c, etc.):
Landed on CC
Risk to taking this patch (and alternatives if risky):
Only changes prefs to tell Gecko that we implement these protocols
Comment 20•3 years ago
|
||
Comment on attachment 9233102 [details] [diff] [review]
Fix, v4
[Triage Comment]
Approved for beta
Comment 21•3 years ago
•
|
||
bugherder uplift |
Thunderbird 91.0b6:
https://hg.mozilla.org/releases/comm-beta/rev/5fe25d96fd85
Comment 22•3 years ago
•
|
||
Comment on attachment 9233102 [details] [diff] [review]
Fix, v4
[Approval Request Comment]
Regression caused by (bug #): 1499092
User impact if declined: Crash
Testing completed (on c-c, etc.): Trunk, beta
Risk to taking this patch (and alternatives if risky):
Assignee | ||
Comment 23•3 years ago
|
||
Note that to fully fix Thunderbird 78 bug 1717833 will also need to be backported to Firefox ESR78.
Comment 24•3 years ago
|
||
The crash rate spikes starting August 10 https://crash-stats.mozilla.org/signature/?product=Thunderbird&signature=mozilla%3A%3Adom%3A%3ANavigator%3A%3ACheckProtocolHandlerAllowed&date=%3E%3D2021-07-15T15%3A18%3A00.000Z&date=%3C2021-08-15T15%3A18%3A00.000Z#graphs
(In reply to neil@parkwaycc.co.uk from comment #23)
Note that to fully fix Thunderbird 78 bug 1717833 will also need to be backported to Firefox ESR78.
So this is only/primarily users of OWL, correct?
Note, bug 1717833 has been set as WONTFIX for Firefox ESR78. So is the most suitable solution for those users to move to version 91?
Comment 25•3 years ago
|
||
(In reply to Wayne Mery (:wsmwk) from comment #24)
...
So this is only/primarily users of OWL, correct?
Spot checking half dozen crashes indicates it is so.
And FWIW there are no beta or nightly crashes in the past month, only release crashes.
Comment 26•3 years ago
•
|
||
Here's what Neil wrote on the internal bug tracker, about 2 months ago:
~~
It's actually quite easy to crash Thunderbird by calling registerProtocolHandler. The problem is that this API is designed for browsers, which means that it assumes that various protocols such as nntp aren't in use. If a web page tries to call registerProtocolHandler passing in nntp as a parameter then it will immediately crash. The crash dumps don't have enough information to tell me what code is calling registerProtocolHandler but it's certainly not Owl. In particular, none of the protocol handlers that Owl registers are allowed by registerProtocolHandler, so it can't even contribute to the crash that way either.
The crash is not in code provided by Owl or even executed by Owl, since there are over 120 crashes where Owl wasn't even installed.
~~
Most of the crashes are right after startup. I suspect that some of the Office365 or Duo (or other third party MFA providers) or Exchange login pages of the server contains a JavaScript call to registerProtocolHandler()
in the HTML login page. Owl just happens to open that login page, which is where the correlation comes from, but we cannot avoid the login page. But aside from that, it seems that Owl is in no way triggering this nor causing this. For the same reason, I have no idea how we could possibly work around this.
The only way out that I see is to change RyanVM's mind and to backport bug 1717833 to 78 ESR.
Other ideas?
(I have yet to confirm the above thoery and to find a minimal test case that triggers the crash at will.)
Comment 27•3 years ago
|
||
RyanVM approved bug 1717833 for backport for 78 ESR. Yay!
Comment 28•3 years ago
|
||
So, what are the chances of a fix being introduced for TB 91.0 ?
Comment 29•3 years ago
|
||
Comment on attachment 9233102 [details] [diff] [review]
Fix, v4
[Triage Comment]
Approved for esr78
(In reply to aliledudiable from comment #28)
So, what are the chances of a fix being introduced for TB 91.0 ?
100% - it was already in version 91.0. Comment 21 put it in beta 91.
Comment 30•3 years ago
|
||
Comment 31•3 years ago
|
||
Well, my TB 91.0.3 crashes with Owl... unless I quickly close the tab it opens on startup (for authentication I guess).
Maybe it's another issue.
Comment 32•3 years ago
|
||
Pretty impossible to act on your issue without a crash report ID. https://support.mozilla.org/en-US/kb/mozilla-crash-reporter-tb#w_viewing-crash-reports
Comment 33•3 years ago
|
||
A URL to one of them: https://crash-stats.mozilla.org/report/index/f441485e-d322-4b8f-8c2e-1bd180210828
And codes for a bunch of them:
bp-f441485e-d322-4b8f-8c2e-1bd180210828
bp-a833934a-38e3-46dc-b704-a8d180210828
bp-e363457d-1e44-4cb9-9e72-f97710210828
bp-a29ce279-6115-4ac6-99f1-b87f60210828
bp-aebca477-fcc8-4f3f-a6e0-032d30210828
bp-aef07ac4-defe-474d-8dee-790590210828
bp-530746e3-4506-48e1-95c7-d3a940210828
bp-4e3e578c-e152-4851-8ee9-e0c5d0210828
Comment 34•3 years ago
|
||
@aliledudiable: That sounds like a different bug, indeed. Can you please file a new bug (and mention the bug number here)? Thanks!
Comment 35•3 years ago
|
||
bugherder uplift |
Thunderbird 78.14.0:
https://hg.mozilla.org/releases/comm-esr78/rev/b4f053e8c19a
Comment 36•3 years ago
|
||
Signature for this crash no longer appears for 78.14.0
Description
•