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-107300 Overview
CVE-2026-107300 is a denial-of-service vulnerability in msgpack5, a MessagePack v5 implementation for Node.js and the browser. The streaming decoder recursively invokes itself for each complete MessagePack value remaining in a chunk. A remote peer can send one chunk containing many small valid values, producing recursion proportional to the value count. This exhausts the JavaScript call stack and interrupts the process or stream. The flaw is tracked under [CWE-674: Uncontrolled Recursion] and is fixed in version 6.1.0.
Critical Impact
Any Node.js service that pipes untrusted MessagePack data into the msgpack5 streaming decoder can be crashed by a single crafted chunk, interrupting availability of the host process.
Affected Products
- msgpack5 versions prior to 6.1.0
- Node.js applications consuming untrusted MessagePack streams via msgpack5
- Browser applications bundling msgpack5 streaming APIs
Discovery Timeline
- 2026-10-08 - CVE-2026-107300 published to the National Vulnerability Database (NVD)
- 2026-10-08 - Last updated in NVD database
- Fix available - Patched in msgpack5 release v6.1.0 and tracked in GHSA-5x5g-h9x8-2fh9
Technical Details for CVE-2026-107300
Vulnerability Analysis
The msgpack5 streaming decoder processes incoming buffers by appending each chunk to an internal _chunks buffer and calling this._msgpack.decode(). In vulnerable releases, the decode handler recursed back into itself whenever additional complete MessagePack values remained in the buffer after a successful decode. An attacker who delivers one chunk packed with many small valid values forces one recursive call per value. The depth of recursion scales linearly with the number of values in the chunk, overrunning the V8 call stack and raising a RangeError: Maximum call stack size exceeded. Because the error occurs inside a stream data handler, it terminates the stream and can crash the Node.js process when uncaught.
Root Cause
The root cause is uncontrolled recursion in the streaming decode path. The decoder lacked a bound on how many values it would process per invocation and relied on self-invocation to drain the buffer instead of iterating. No validation limited the per-chunk value count, so attacker-controlled input directly influenced recursion depth.
Attack Vector
Exploitation requires no authentication and no user interaction. A remote peer sends a single MessagePack chunk containing a large number of small valid values, such as thousands of nil, boolean, or small-integer tokens. The vulnerable decoder recurses once per value until the JavaScript call stack is exhausted, terminating the stream or process.
// Patch from commit 77fbef144d05def5d16fc22c37caa64c0a7efeba
// Before: recursive drain of remaining values in the chunk buffer
// After: iterative while-loop drain
this._chunks.append(buf)
}
- try {
- let result = this._msgpack.decode(this._chunks)
- if (this._wrap) {
- result = { value: result }
- }
- this.push(result)
- } catch (err) {
- if (err instanceof this._msgpack.IncompleteBufferError) {
- done()
- } else {
- this.emit('error', err)
+ while (this._chunks.length > 0) {
+ try {
+ let result = this._msgpack.decode(this._chunks)
+ if (this._wrap) {
+ result = { value: result }
+ }
+ this.push(result)
+ } catch (err) {
+ if (err instanceof this._msgpack.IncompleteBufferError) {
+ done()
+ } else {
+ this.emit('error', err)
+ }
+ return
}
- return
// Source: https://github.com/mcollina/msgpack5/commit/77fbef144d05def5d16fc22c37caa64c0a7efeba
The fix replaces recursive self-invocation with a while (this._chunks.length > 0) loop, allowing the decoder to drain any number of queued values without consuming stack frames.
Detection Methods for CVE-2026-107300
Indicators of Compromise
- Node.js process crashes with RangeError: Maximum call stack size exceeded originating in msgpack5 stream handlers.
- Repeated stream error events on sockets or pipes using msgpack5.decoder() or msgpack5.encoder().
- Abrupt termination of long-running services shortly after receiving large or unusual MessagePack payloads.
Detection Strategies
- Inventory Node.js applications and inspect package-lock.json or yarn.lock for msgpack5 versions less than 6.1.0.
- Enable crash reporting and uncaught exception logging on services that accept MessagePack over the network.
- Review ingress payload sizes and value counts for streams terminating in msgpack5 to flag anomalies.
Monitoring Recommendations
- Alert on process restarts and SIGABRT or non-zero exit codes from Node.js workers that handle MessagePack traffic.
- Capture stream error telemetry and forward it to a central log platform for correlation with upstream peers.
- Track dependency drift using software composition analysis (SCA) to catch reintroduction of vulnerable msgpack5 versions.
How to Mitigate CVE-2026-107300
Immediate Actions Required
- Upgrade msgpack5 to version 6.1.0 or later in all Node.js and browser projects.
- Rebuild and redeploy any artifacts, container images, or Lambda packages that bundle the vulnerable library.
- Audit transitive dependencies, as msgpack5 may be pulled in by other packages beyond direct imports.
Patch Information
The fix is published in msgpack5 v6.1.0 and implemented in commit 77fbef1. The patch rewrites the streaming decoder in both dist/msgpack5.js and lib/streams.js to drain queued values iteratively instead of recursively. Advisory details are available in GHSA-5x5g-h9x8-2fh9.
Workarounds
- Terminate untrusted MessagePack connections at a reverse proxy that enforces strict payload size limits until the upgrade is complete.
- Isolate decoders in worker threads or child processes so a crash does not take down the parent service.
- Wrap stream pipelines with stream.pipeline() and robust error handlers to contain RangeError events and prevent unhandled rejections.
# Upgrade msgpack5 to the patched release
npm install msgpack5@^6.1.0
# Verify no vulnerable versions remain in the dependency tree
npm ls msgpack5
# Audit for known advisories
npm audit --production
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

