websockets/ws
### [`v7.4.6`](https://togithub.com/websockets/ws/releases/7.4.6)
[Compare Source](https://togithub.com/websockets/ws/compare/7.4.5...7.4.6)
### Bug fixes
- Fixed a ReDoS vulnerability ([`00c425e`](https://togithub.com/websockets/ws/commit/00c425ec)).
A specially crafted value of the `Sec-Websocket-Protocol` header could be used
to significantly slow down a ws server.
```js
for (const length of [1000, 2000, 4000, 8000, 16000, 32000]) {
const value = 'b' + ' '.repeat(length) + 'x';
const start = process.hrtime.bigint();
value.trim().split(/ *, */);
const end = process.hrtime.bigint();
console.log('length = %d, time = %f ns', length, end - start);
}
```
The vulnerability was responsibly disclosed along with a fix in private by
[Robert McLaughlin](https://togithub.com/robmcl4) from University of California, Santa Barbara.
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`](https://nodejs.org/api/cli.html#cli_max_http_header_size_size)
and/or the [`maxHeaderSize`](https://nodejs.org/api/http.html#http_http_createserver_options_requestlistener) options.
Configuration
📅 Schedule: At any time (no schedule defined).
🚦 Automerge: Enabled.
♻️ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
[ ] If you want to rebase/retry this PR, check this box.
This PR contains the following updates:
7.4.5
->7.4.6
Release Notes
websockets/ws
### [`v7.4.6`](https://togithub.com/websockets/ws/releases/7.4.6) [Compare Source](https://togithub.com/websockets/ws/compare/7.4.5...7.4.6) ### Bug fixes - Fixed a ReDoS vulnerability ([`00c425e`](https://togithub.com/websockets/ws/commit/00c425ec)). A specially crafted value of the `Sec-Websocket-Protocol` header could be used to significantly slow down a ws server. ```js for (const length of [1000, 2000, 4000, 8000, 16000, 32000]) { const value = 'b' + ' '.repeat(length) + 'x'; const start = process.hrtime.bigint(); value.trim().split(/ *, */); const end = process.hrtime.bigint(); console.log('length = %d, time = %f ns', length, end - start); } ``` The vulnerability was responsibly disclosed along with a fix in private by [Robert McLaughlin](https://togithub.com/robmcl4) from University of California, Santa Barbara. 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`](https://nodejs.org/api/cli.html#cli_max_http_header_size_size) and/or the [`maxHeaderSize`](https://nodejs.org/api/http.html#http_http_createserver_options_requestlistener) options.Configuration
📅 Schedule: At any time (no schedule defined).
🚦 Automerge: Enabled.
♻️ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by WhiteSource Renovate. View repository job log here.