Skip to main content
Vulnerability Database/CVE-2026-107299

CVE-2026-107299: msgpack5 Memory Exhaustion DOS Vulnerability

CVE-2026-107299 is a memory exhaustion denial of service flaw in msgpack5 that allows remote attackers to crash applications through malformed MessagePack streams. This post covers technical details, affected versions, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-107299 Overview

CVE-2026-107299 affects msgpack5, a MessagePack v5 implementation for Node.js and the browser. The streaming decoder mishandles the reserved MessagePack byte 0xc1, treating it as incomplete input rather than invalid input. When a stream begins with 0xc1, the decoder buffers all subsequent bytes while waiting for input that can never make the value valid. A remote peer can exploit this behavior to exhaust process memory, causing a denial-of-service condition. The flaw is categorized under [CWE-228] (Improper Handling of Syntactically Invalid Structure). The maintainer resolved the issue in version 6.1.0 by rejecting 0xc1 outright during decode.

Critical Impact

Remote attackers can exhaust Node.js process memory by sending a single reserved byte followed by continuous data, causing availability loss in services that stream-decode MessagePack from untrusted peers.

Affected Products

  • msgpack5 package versions prior to 6.1.0
  • Node.js applications that use msgpack5 streaming decode on untrusted input
  • Browser applications bundling msgpack5 to parse remote MessagePack streams

Discovery Timeline

  • 2026-10-08 - CVE-2026-107299 published to NVD
  • 2026-10-09 - Last updated in NVD database

Technical Details for CVE-2026-107299

Vulnerability Analysis

MessagePack reserves the byte 0xc1 and defines no valid type for it. The msgpack5 streaming decoder does not enumerate 0xc1 in its type-dispatch table. When the decoder encounters a byte it does not recognize at the start of a value, it returns an incomplete-input signal rather than raising a decode error.

For streaming consumers, incomplete input means "wait for more bytes." The decoder therefore retains the growing buffer in memory and reattempts decode on each new chunk. Because no sequence of trailing bytes can make 0xc1 a valid value, this loop never terminates. An attacker who controls a single peer connection can send 0xc1 followed by an indefinite stream of arbitrary bytes, forcing the Node.js process to allocate memory until it hits process or system limits.

Root Cause

The decoder's type-dispatch branches handle byte ranges 0xc0–0xc3 and 0xc4–0xc6 but omit explicit handling of the reserved 0xc1 sentinel. The fallthrough path signals incomplete input instead of signaling a protocol violation, which is the correct semantic for a reserved byte.

Attack Vector

Exploitation requires network access to any endpoint that passes attacker-controlled bytes into the msgpack5 streaming decoder. No authentication or user interaction is required. The attacker sends 0xc1 as the leading byte of a value, then streams additional bytes to grow the retained buffer until memory is exhausted.

javascript
// Security patch in lib/decoder.js and dist/msgpack5.js
// fix: reject reserved MessagePack byte
     const result = buf.toString('utf8', offset, offset + length)
     return [result, length + 1]
   }
+  if (first === 0xc1) throw new Error('0xc1 is a reserved MessagePack byte')
   if (first >= 0xc0 && first <= 0xc3) return decodeConstants(first)
   if (first >= 0xc4 && first <= 0xc6) {
     const length = buf.readUIntBE(offset, size - 1)

Source: GitHub Commit 85da345. The patch adds an explicit check that throws when the first byte of a value equals 0xc1, converting the hang-and-buffer behavior into a bounded decode error.

Detection Methods for CVE-2026-107299

Indicators of Compromise

  • Node.js processes with sustained Resident Set Size (RSS) growth that correlates with open connections carrying MessagePack payloads.
  • Inbound TCP or WebSocket frames whose first payload byte is 0xc1 sent to services that accept MessagePack.
  • Process crashes with JavaScript heap out of memory or FATAL ERROR: Reached heap limit in service logs.

Detection Strategies

  • Enumerate dependencies with npm ls msgpack5 or Software Bill of Materials (SBOM) scanning to flag versions below 6.1.0.
  • Deploy network inspection rules that count the frequency of 0xc1 as the leading byte of MessagePack frames from a single peer.
  • Correlate per-connection byte counts with per-process memory growth to identify unbounded-decode patterns.

Monitoring Recommendations

  • Alert on Node.js RSS exceeding configured thresholds, especially when tied to a single long-lived connection.
  • Instrument the application with per-connection decode-buffer size metrics and alert on sustained growth without decode completion.
  • Capture packet samples of MessagePack streams from untrusted origins for retrospective analysis.

How to Mitigate CVE-2026-107299

Immediate Actions Required

  • Upgrade msgpack5 to version 6.1.0 or later in all Node.js and browser-bundled applications.
  • Audit services that stream-decode MessagePack from untrusted sources and prioritize them for patching.
  • Enforce per-connection memory and buffer-size ceilings at the application layer until patched.

Patch Information

The fix is published in msgpack5 v6.1.0 and documented in GHSA-26wq-p25c-j6fv. The code change in commit 85da345 adds an explicit throw when the decoder encounters the reserved 0xc1 byte.

Workarounds

  • Reject MessagePack payloads whose first byte is 0xc1 at an upstream proxy or application middleware.
  • Impose a hard cap on the streaming decoder's internal buffer size and terminate connections that exceed it.
  • Terminate idle or slow MessagePack streams with aggressive read timeouts to bound memory growth.
bash
# Upgrade msgpack5 to the patched release
npm install msgpack5@^6.1.0

# Verify the installed version is 6.1.0 or later
npm ls msgpack5

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.