Skip to content

x/net/websocket: allow configurable read size limit, and MaxHeaderBytes #5082

Closed
@emidoots

Description

@emidoots
What steps will reproduce the problem?
    Currently go.net/websocket provides no way to limit how much data an websocket server reads, if an client sends very large amounts of data (messages, frames) the websocket server will allocate that memory, and will continue to do so, until the server runs out of memory or the client crashes.

[In someone else's tests] it has been observed that there is also no header limit
provided (for the same issue). (See discussion:
https://groups.google.com/forum/?fromgroups=#!topic/golang-nuts/2Tge6U8-QYI)


What is the expected output?
go.net/websocket should provide an way to set an maximum read size and maximum header
read size, to avoid attacks from potentially malicious clients.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions