yjs / y-websocket

Websocket Connector for Yjs
https://docs.yjs.dev/ecosystem/connection-provider/y-websocket
MIT License
497 stars 256 forks source link

Exception/crash when sending garbage to websocket #95

Open szborows opened 2 years ago

szborows commented 2 years ago

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

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

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!!