CVE-2026-107297: msgpack5: Quadratic parsing in the streaming decoder
Impact
The streaming decoder reparses an incomplete container from the beginning whenever another chunk arrives. A remote peer can split one valid MessagePack value across many small chunks, causing quadratic CPU usage and blocking the event loop.
Patches
The decoder now preserves incremental container state so completed elements are not parsed again when more input arrives.
Workarounds
Buffer each complete MessagePack value before decoding it, or limit the number of chunks accepted for a single value.
Other sources
msgpack5 is a msgpack v5 implementation for node.js and the browser. Prior to 6.1.0, the streaming decoder reparses an incomplete array or map from the beginning whenever another chunk arrives. A remote peer can split one valid MessagePack container across many small chunks, causing completed elements to be decoded repeatedly, producing quadratic CPU use and blocking the event loop. This issue is fixed in version 6.1.0.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/msgpack5to a version that resolves this vulnerability.Fixed in 6.1.0 - Upgrade
Upgrade
msgpack5to a version that resolves this vulnerability.Fixed in 6.1.0 - Compensating control
Buffer each complete MessagePack value before decoding it, or limit the number of chunks accepted for a single value.
Event History
Frequently Asked Questions
Which deployments are exposed?
Deployments using msgpack5 versions prior to 6.1.0 are exposed when they use the streaming decoder on data received from a remote peer. The issue affects both Node.js and browser use of msgpack5.
What must an attacker do to trigger the problem?
An attacker needs to send a valid MessagePack array or map split across many small chunks. Each additional chunk can cause the decoder to reprocess already completed elements, consuming increasing CPU time.
What is the remediation?
Upgrade msgpack5 to version 6.1.0, which fixes the streaming decoder behavior.