statianzo / Fleck

C# Websocket Implementation
MIT License
2.3k stars 585 forks source link

Add the ability to limit message payload size for Hybi13Handler #317

Closed jiniux closed 2 years ago

jiniux commented 3 years ago

Currently, there is no way to set a custom limit for the size of incoming message. This may be something attackers can abuse to provoke a Denial of Service.

The commits add the possibility to set this limit through a HandlerSettings class. An exception is thrown in ReceiveData method if payloadLength is greather than the specified limit.

(For now, I only implemented the limit check for the Hybi13Handler. Tell me in case you think this needs to be applied to the other handlers too).

AppVeyorBot commented 3 years ago

:white_check_mark: Build Fleck 0.0.64-ci completed (commit https://github.com/statianzo/Fleck/commit/bfb4a692f2 by @jiniux)

AppVeyorBot commented 3 years ago

:white_check_mark: Build Fleck 0.0.64-ci completed (commit https://github.com/statianzo/Fleck/commit/bfb4a692f2 by @jiniux)