websocket-extensions@0.1.3 vulnerabilities

Generic extension manager for WebSocket connections

Direct Vulnerabilities

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

Automatically find and fix vulnerabilities affecting your projects. Snyk scans for vulnerabilities and provides fixes for free.
Fix for free
Vulnerability Vulnerable Version
  • H
Regular Expression Denial of Service (ReDoS)

websocket-extensions is a Generic extension manager for WebSocket connections

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS). The EXT_LIST variable within extension parser may take quadratic time when parsing literal backslash (\) followed by any character, resulting in backtracking.

This could be abused by an attacker to conduct Regex Denial Of Service (ReDoS) on a single-threaded server by providing a malicious payload with the Sec-WebSocket-Extensions header.

PoC by Robert McLaughlin

GET / HTTP/1.1
Host: localhost:8081
Sec-WebSocket-Version: 13
Sec-WebSocket-Extensions: foo;bar="fooa\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a\a
Sec-WebSocket-Key: nqCLn4uQ/wUGGLtjAILmxQ==
Connection: keep-alive, Upgrade
Upgrade: websocket

How to fix Regular Expression Denial of Service (ReDoS)?

Upgrade websocket-extensions to version 0.1.4 or higher.

<0.1.4