CVE-2020-36049: socket.io-parser resource exhaustion via packet processing

CVE-2020-36049 · Severity: low · CVSS 3.1 · Published 2021-06-30

socket.io-parser is a Node.js library used to serialize and deserialize Socket.IO protocol messages. An attacker can send specially crafted large packets to cause the server to consume excessive memory and crash (denial of service), affecting any application using vulnerable versions of this library.

Technologies: socket.io-parser (npm). Vendors: npm.

Quick answers

Is CVE-2020-36049 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2020-36049 being exploited in the wild.
How severe is CVE-2020-36049?
Low severity, with a CVSS score of 3.1, published 30 June 2021.
Which products and versions are affected?
socket.io-parser (npm) SEMVER:introduced=0,fixed=3.3.2.
Is there a fix for CVE-2020-36049?
Yes. socket.io-parser (npm): upgrade to 3.3.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2020-36049 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2020-36049?
Check whether you run socket.io-parser (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • socket.io-parser (npm): upgrade to 3.3.2 or later
    npm install socket.io-parser@3.3.2

Technical details

The vulnerability is a resource exhaustion (CWE-400) caused by inefficient string concatenation during packet parsing. When processing large packets, the decoder builds very long strings by repeatedly concatenating smaller strings, creating many intermediate ConsOneByteString objects that consume heap memory. An unauthenticated, network-accessible attacker can send a crafted packet exceeding maxHttpBufferSize (e.g., 100 MB) to trigger out-of-memory conditions and crash the Node.js process. The fix, released in versions 3.3.2 and 3.4.1, replaces concatenation with substring-based string extraction to avoid the intermediate object creation.

Affected products

  • socket.io socket.io-parser before 3.3.2 and 3.4.0 before 3.4.1

Identifiers

  • CVE-2020-36049
  • GHSA-xfhh-g9f5-x4m4

Timeline

  • 2021-01-08: disclosed: CVE-2020-36049 published on NVD
  • 2021-04-06: patched: GitHub security advisory published and reviewed
  • 2021-06-30: patched: GHSA-xfhh-g9f5-x4m4 published; fixes available in 3.3.2 and 3.4.1

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.