Constructing a WebSocket from WebAssembly fails with a SecurityError
Categories
(Core :: DOM: Networking, defect, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr102 | --- | unaffected |
firefox105 | --- | unaffected |
firefox106 | + | verified |
firefox107 | --- | verified |
People
(Reporter: Mr.YouKnowWhoIAm, Assigned: kershaw)
References
(Regression)
Details
(Keywords: regression, Whiteboard: [necko-triaged])
Attachments
(2 files)
(deleted),
application/x-zip-compressed
|
Details | |
(deleted),
text/x-phabricator-request
|
pascalc
:
approval-mozilla-beta+
|
Details |
Firefox refuses to construct a WebSocket from WebAssembly. Specifically, Reflect.construct.bind(null, WebSocket, ["ws://localhost:8080"])
is passed as an import when instantiating a WebAssembly module.
The module immediately calls the import from the start function.
This problem can be reproduced in the latest version of Firefox Nightly (build ID 20221005094233).
Steps to reproduce
- Download and extract the attached .zip file to some directory.
- Open a terminal (like PowerShell).
- Run
cd <path to files>
to enter that directory. - Run
npx serve .
(this assumes npm is installed on your system). - Open Firefox.
- Navigate to http://localhost:3000.
Expected result
The browser attempts to establish a WebSocket connection, and no error is displayed on the test page.
Actual result
The browser refuses to attempt establishing a WebSocket connection and throws a SecurityError DOMException, which is displayed on the test page.
Reporter | ||
Comment 1•2 years ago
|
||
Apparently 7f84017ef2414cec22aca43f40250223e969ddcc is causing this bug.
Comment 2•2 years ago
|
||
[Tracking Requested - why for this release]: I believe we should try not shipping with this regression. If I'm reading the code correctly, before the regressing patch we treated the socket as not secure when there was no principal, so we should probably replace the throwing line for a return false or so.
Comment 3•2 years ago
|
||
:acreskey, since you are the author of the regressor, bug 1748005, could you take a look? Also, could you set the severity field?
For more information, please visit auto_nag documentation.
Comment 4•2 years ago
|
||
Smaug, we build our last beta today (9PM UTC), would it be possible for you to write this patch as you were the reviewer for bug 1748005? I am afraid Andrew is in the wrong timezone to make it on time for the last beta. Thanks!
Assignee | ||
Comment 5•2 years ago
|
||
smaug's slack status suggests he might be on PTO, so I'll try to write a patch.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 6•2 years ago
|
||
Updated•2 years ago
|
Assignee | ||
Comment 8•2 years ago
|
||
Comment on attachment 9297407 [details]
Bug 1793868 - Use the scheme of document's principal as the initial value of |isSecure|, r=#necko
Beta/Release Uplift Approval Request
- User impact if declined: Some websites could be broken.
- Is this code covered by automated tests?: No
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: N/A
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): The patch is straightforward and is verified locally.
- String changes made/needed: N/A
- Is Android affected?: Yes
Comment 9•2 years ago
|
||
Comment on attachment 9297407 [details]
Bug 1793868 - Use the scheme of document's principal as the initial value of |isSecure|, r=#necko
P1/S2, minimal patch and I think we would benefit from having it in our last beta even if it's not in Nightly yet, approved.
Comment 10•2 years ago
|
||
bugherder uplift |
Comment 11•2 years ago
|
||
bugherder |
Updated•2 years ago
|
Updated•2 years ago
|
Comment 12•2 years ago
|
||
Reproduced the initial issue using an affected Firefox nightly build from 2022-10-04.
This issue is verified fixed using Firefox 107.0a1 (BuildId:20221006214011) and Firefox 106.0b9 (BuildId:20221006191955) on Windows 11 64bit, macOS 11 and Ubuntu 22.04.
Description
•