WebSockets - Badly formatted JSON crashes server
See original GitHub issueNot typically an issue if using @trpc/client
to interact with your WebSocket endpoint, but a bad/unknowing actor could send the following payload to a trpc WebSocket endpoint and cause it to throw an uncaught runtime error TRPCError: 'id' is required
and crash the NodeJS process.
{
"id": null,
"method": "query",
"params": {
"path": "test"
}
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
How to ensure a WebSocket message is JSON string ...
Yes. On the server you absolutely need to worry about malformed input. If sending invalid JSON makes your server crash, that's really bad....
Read more >RangeError: out of range index crashing server #778 - GitHub
I concur. Upgrading to 1.1.1 (got pulled automatically by npm when upgrading to a newer socket.io release) has resolved this. May be beneficial ......
Read more >Warren James Day on Twitter: "Curious. How would you test for this ...
WebSockets - Badly formatted JSON crashes server · Issue #1575 · trpc/trpc. Not typically an issue if using @trpc/client to interact with your...
Read more >Sending JSON over WebSockets - JavaScript Tutorial - YouTube
In today's video I'll be showing you how to send JSON data over WebSockets between the client and server - this is very...
Read more >Validating & Structuring JSON over WebSockets - YouTube
In today's video I'll be going over a general technique of structuring and validating your JSON when sending it over a WebSockets connection ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Great job @KATT 🎉
This issue has been locked because it had no new activity for 14 days. If you are running into a similar issue, please create a new issue. Thank you.