ws is an open source WebSocket client and server library for Node.js. A specially crafted value of the Sec-Websocket-Protocol
header can be used to significantly slow down a ws server. The vulnerability has been fixed in ws@7.4.6 (https://github.com/websockets/ws/commit/00c425ec77993773d823f018f64a5c44e17023ff). In vulnerable versions of ws, the issue can be mitigated by reducing the maximum allowed length of the request headers using the --max-http-header-size=size
and/or the maxHeaderSize
options.
The product does not properly control the allocation and maintenance of a limited resource.
Name | Vendor | Start Version | End Version |
---|---|---|---|
Ws | Ws_project | 5.0.0 (including) | 6.2.2 (excluding) |
Ws | Ws_project | 7.0.0 (including) | 7.4.6 (excluding) |
Node-ws | Ubuntu | bionic | * |
Node-ws | Ubuntu | focal | * |
Node-ws | Ubuntu | groovy | * |
Node-ws | Ubuntu | hirsute | * |
Node-ws | Ubuntu | impish | * |
Node-ws | Ubuntu | kinetic | * |
Node-ws | Ubuntu | trusty | * |
Node-ws | Ubuntu | upstream | * |
Node-ws | Ubuntu | xenial | * |
Mitigation of resource exhaustion attacks requires that the target system either:
The first of these solutions is an issue in itself though, since it may allow attackers to prevent the use of the system by a particular valid user. If the attacker impersonates the valid user, they may be able to prevent the user from accessing the server in question.
The second solution is simply difficult to effectively institute – and even when properly done, it does not provide a full solution. It simply makes the attack require more resources on the part of the attacker.