Executive brief
MessagePack-CSharp is a library used to serialize and deserialize data for high-performance communication. A vulnerability in how it handles dynamic objects allows an attacker to send a specially crafted message that consumes excessive CPU and memory. This can lead to a denial-of-service (DoS) condition, making the affected server or application unresponsive to legitimate users.
Technical details
The vulnerability is classified as CWE-407 (Inefficient Algorithmic Complexity). The ExpandoObjectFormatter.Deserialize method populates System.Dynamic.ExpandoObject by calling IDictionary.Add for each map entry. Because ExpandoObject internally uses array-like structures for member names, inserting many distinct keys results in repeated linear scans and array copies, leading to quadratic (O(n^2)) CPU and memory consumption. This occurs even when MessagePackSecurity.UntrustedData is enabled, as standard collision-resistant comparers do not mitigate ExpandoObject's internal insertion logic. Attackers can exploit this via the network without authentication by providing a large map with many distinct keys. Patches are available in versions 2.5.301 and 3.1.7.
Affected products
- MessagePack-CSharp MessagePack-CSharp < 2.5.301, >= 3.0, < 3.1.7
Timeline
- 2026-06-09: disclosed
- 2026-06-22: advisory: NVD publication
- 2026-06-25: patched: GitHub Advisory reviewed and published