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-107298 Overview
CVE-2026-107298 is a denial-of-service vulnerability in msgpack5, a MessagePack v5 implementation for Node.js and the browser. Versions prior to 6.1.0 do not enforce a nesting-depth limit when decoding arrays and maps. An attacker who can submit MessagePack input can craft deeply nested containers that exhaust the JavaScript call stack. The resulting stack overflow interrupts the affected process, worker, or request handler. The issue is tracked under [CWE-674] (Uncontrolled Recursion) and is fixed in msgpack5 version 6.1.0.
Critical Impact
Remote, unauthenticated attackers can crash Node.js workers or request handlers by submitting a small MessagePack payload containing deeply nested arrays or maps.
Affected Products
- msgpack5 versions prior to 6.1.0
- Node.js applications that decode untrusted MessagePack input using msgpack5
- Browser applications that process attacker-controlled MessagePack data via msgpack5
Discovery Timeline
- 2026-10-08 - CVE-2026-107298 published to NVD
- 2026-10-09 - Last updated in NVD database
Technical Details for CVE-2026-107298
Vulnerability Analysis
The msgpack5 decoder recursively descends into nested arrays and maps as it parses MessagePack binary data. Prior to version 6.1.0, no limit was placed on how deeply this recursion could go. Each nested container pushes another frame onto the JavaScript call stack. When the attacker controls the payload, they can nest containers deeper than the engine's stack permits, triggering a RangeError: Maximum call stack size exceeded.
In Node.js server contexts, the resulting exception is often unrecoverable at the request handler boundary. The affected worker or process terminates, dropping concurrent connections and degrading service availability.
Root Cause
The root cause is uncontrolled recursion in the array and map decoding paths. The decoder treated nesting depth as implicit input rather than a bounded resource. Because MessagePack container headers are compact, an attacker can produce extreme nesting with only a few hundred bytes of input, making the condition cheap to trigger.
Attack Vector
The attack vector is network-accessible and requires no authentication or user interaction. Any endpoint that accepts MessagePack-encoded data and passes it to the msgpack5 decoder is a candidate target. This includes HTTP APIs, WebSocket services, message queue consumers, and inter-service RPC that negotiates MessagePack. The attacker transmits a crafted payload with deeply nested arrays or maps and the decoding process terminates.
// Security patch in index.js and dist/msgpack5.js
// fix: limit decoder nesting depth
// timestamp ext format (-1)
disableTimestampEncoding: false,
preferMap: false,
+ maxDepth: 100,
protoAction: 'error'
}, options || {})
Source: GitHub Commit 1e2b587
The patch introduces a maxDepth option defaulting to 100. The decoder tracks current depth during recursion and throws a controlled error when the limit is exceeded, replacing the uncontrolled stack overflow with a catchable exception.
Detection Methods for CVE-2026-107298
Indicators of Compromise
- Node.js process or worker crashes with RangeError: Maximum call stack size exceeded originating in msgpack5 decode frames.
- Repeated short-lived process restarts correlated with inbound requests carrying Content-Type: application/msgpack or application/x-msgpack.
- Spikes in abnormally small MessagePack payloads that fail to decode successfully.
Detection Strategies
- Inventory application dependencies for msgpack5 versions below 6.1.0 using npm ls msgpack5 or software composition analysis tooling.
- Instrument decode call sites with try/catch and log stack-depth exceptions to identify malicious or malformed input.
- Add request-size and decode-time ceilings at the ingress layer to flag payloads that disproportionately exhaust parsing resources.
Monitoring Recommendations
- Monitor process supervisors (systemd, PM2, Kubernetes) for unexpected worker restarts tied to MessagePack endpoints.
- Alert on error-rate spikes in APIs that accept MessagePack input, especially unauthenticated endpoints exposed to the internet.
- Capture and retain payload samples that trigger decode failures for post-incident analysis.
How to Mitigate CVE-2026-107298
Immediate Actions Required
- Upgrade msgpack5 to version 6.1.0 or later across all Node.js and browser applications.
- Audit transitive dependencies with npm ls msgpack5 to locate indirect use through other packages.
- Enforce request-size limits on endpoints that accept MessagePack payloads to reduce attack surface before patching completes.
Patch Information
The fix is published in msgpack5 release v6.1.0 and implemented in commit 1e2b587. Full technical disclosure is available in the GitHub Security Advisory GHSA-24ch-f2g6-9hhh. Upgrading automatically enables the default maxDepth of 100.
Workarounds
- Set a lower maxDepth value when constructing the msgpack5 instance if the application only expects shallow data structures.
- Place a reverse proxy or API gateway in front of MessagePack endpoints to enforce payload size and schema validation.
- Isolate decoding in worker threads or child processes so that a stack overflow terminates only the worker, not the primary service.
# Upgrade msgpack5 to the patched release
npm install msgpack5@^6.1.0
# Verify no vulnerable versions remain in the dependency tree
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

