Websocket frame with no payload
Categories
(Core :: DOM: Networking, defect)
Tracking
()
People
(Reporter: edward.a.cheney.mil, Unassigned)
Details
Steps to reproduce:
Reproduction rate: 100% reproducible
Environment
- Firefox 94
- Bohdi Linux on VirtualBox VM running on Windows 10 host. Bohdi Linux is an Ubuntu with a much better GUI for VMs.
Steps from terminal:
The following steps bring down my application, install it, and run localhost services
- git clone from https://github.com/prettydiff/share-file-systems/commit/37f2ff558bf5d1dd892d4f3dba1c9c9ea4fbe7a5
- npm install -g typescript
- cd share-file-systems
- npm install
- tsc
- node js/application build
- share
Steps in Firefox Browser:
These steps use the application and transmit the websocket message
- Navigate to http://localhost
- Complete the form, two text fields. It doesn't matter what text you submit.
- Delete ./lib/storage/device.json file from within the application to achieve 100% reproducibility.
Analysis in the code:
These steps will allow the application to output the frame header details of a websocket message to the console.
- Open file ./js/lib/terminal/server/transmission/agent_ws.html
- At the end of line 106 insert
if(frameItem.opcode===1)console.log(frameItem);to see the frame header of the message.
Browser code:
Line 59 of ./js/lib/browser/webSocket.js
Actual results:
I am see a websocket message come from Firefox to a Node application without the message payload. The frame header indicates a payload size of about 1455 bytes, but the total data size of the message is 8 bytes. 8 bytes is large enough for 2 bytes of frame header, 2 bytes of extended length, and 4 bytes of mask key. That is everything except the actual message payload, the remaining 1455 bytes. I can produce this problem 100% of the time. I also tried using Chromium on the same machine using the same steps and can produce this issue 0%.
Expected results:
The data size of this message should be 1463, which is the payload size plus the first 8 bytes of frame headers.
Comment 1•4 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: Networking' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Comment 2•4 years ago
|
||
I've tried to reproduce with your steps, but got an error below:
TypeScript Compilation
lib/terminal/server/transmission/agent_http.ts:81:78 - error TS2352: Conversion of type '`GET ${string}`' to type 'requestType' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
Type '`GET ${string}`' is not comparable to type '"test-browser"'.
81 const requestType:requestType = (request.method === "GET") ? `GET ${request.url}` as requestType : request.headers["request-type"] as requestType,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 1 error.
Could you try to create a minimal node application that demonstrates this issue? Thanks.
Comment 3•4 years ago
|
||
Close this because we don't have enough information.
Description
•