y-websocket icon indicating copy to clipboard operation
y-websocket copied to clipboard

Exception/crash when sending garbage to websocket

Open szborows opened this issue 4 years ago • 0 comments

Please save me some time and use the following template. In 90% of all issues I can't reproduce the problem because I don't know what exactly you are doing, in which environment, or which y-* version is responsible. Just use the following template even if you think the problem is obvious.

Checklist

  • [x] Are you reporting a bug? Use github issues for bug reports and feature requests. For general questions, please use https://discuss.yjs.dev/
  • [x] Try to report your issue in the correct repository. Yjs consists of many modules. When in doubt, report it to https://github.com/yjs/yjs/issues/

Describe the bug One can crash y-websocker server by sending over wire number greater than 2*2**31.

To Reproduce

  1. start the server: node ./front/node_modules/y-websocket/bin/server.js
  2. open websocket connection: websocat ws://localhost:1234
  3. send 4294967296 (confirm with newline)
  4. send 4294967297

Expected behavior No exceptions and no crash.

Environment Information

  • node version 17.3.0
  • y-websocket version 1.3.18

Additional context Idk whether this is problem related to ws or y-websocket. Unfortunately I currently have no time to investigate it further. I'm reporting just in case I forget about it in future.

BTW I suppose y-websocket isn't production-grade software right now, but maybe we can at least not crash whole server upon receiving garbage.

And obligatorily: much thanks for your work!!

szborows avatar Feb 08 '22 22:02 szborows