websocket-driver@0.8.1

WebSocket protocol handler with pluggable I/O

  • latest version

    0.8.3

  • latest non vulnerable version

  • first published

    13 years ago

  • latest version published

    3 days ago

  • licenses detected

  • Direct Vulnerabilities

    Known vulnerabilities in the websocket-driver package. This does not include vulnerabilities belonging to this package’s dependencies.

    Fix vulnerabilities automatically

    Snyk's AI Trust Platform automatically finds the best upgrade path and integrates with your development workflows. Secure your code at zero cost.

    Fix for free
    VulnerabilityVulnerable Version
    • H
    Allocation of Resources Without Limits or Throttling

    websocket-driver is a websocket protocol handler with pluggable I/O.

    Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling via _emitMessage in lib/websocket/driver/hybi.js, where the driver fails to enforce maxLength validation on incoming messages after close() has been called. When a server invokes driver.close(), it sends a WebSocket Close frame to the client and waits for the client's Close response, but continues to process incoming message data without applying the normal size limit. A client that ignores the Close frame and exploits TCP half-open behaviour to keep sending data can cause the server to buffer an indefinite volume of data until it runs out of memory and crashes.

    How to fix Allocation of Resources Without Limits or Throttling?

    Upgrade websocket-driver to version 0.8.3 or higher.

    <0.8.3
    • H
    Uncaught Exception

    websocket-driver is a websocket protocol handler with pluggable I/O.

    Affected versions of this package are vulnerable to Uncaught Exception via driver.io.write() being called before driver.start() in the websocket.http() driver. When a remote client sends WebSocket message data in the same TCP chunk as its handshake request headers, the Node HTTP upgrade event delivers that extra data as the body argument. Writing this non-empty body to the driver's I/O stream before start() is called triggers an unhandled exception because the RFC 6455 (hybi) parser is not yet initialised, crashing the process.

    How to fix Uncaught Exception?

    Upgrade websocket-driver to version 0.8.3 or higher.

    <0.8.3
    • H
    Allocation of Resources Without Limits or Throttling

    websocket-driver is a websocket protocol handler with pluggable I/O.

    Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling via StreamReader.read() in lib/websocket/driver/stream_reader.js, which uses Buffer.slice() for small reads and thereby retains references to the original, much larger TCP input Buffer objects. A remote client can send a continuous stream of small fragmented message frames (each 1 byte) embedded in larger TCP reads, causing the server to hold live references to those TCP buffers indefinitely - because the fragments are buffered until the message completes or the total length reaches maxLength. This causes substantial memory inflation and can crash the server by exhausting available memory.

    How to fix Allocation of Resources Without Limits or Throttling?

    Upgrade websocket-driver to version 0.8.2 or higher.

    <0.8.2