CVE-2026-48511: MessagePack-CSharp: ExpandoObject formatter can perform quadratic insertion work on untrusted maps
Summary ExpandoObjectFormatter.Deserialize populates System.Dynamic.ExpandoObject by calling IDictionary .Add for each map entry. ExpandoObject internally maintains member names in array-like structures, so inserting many distinct keys can require repeated linear scans and array copies. For large attacker-controlled maps, this produces quadratic CPU and allocation behavior.
Published Jun 25, 2026
Affected packages
MessagePack
- Ecosystem
- NuGet
- Affected
- < 2.5.301
- Fixed in
- 2.5.301
- Check
dotnet list package --include-transitive
MessagePack
- Ecosystem
- NuGet
- Affected
- >= 3.0, < 3.1.7
- Fixed in
- 3.1.7
- Check
dotnet list package --include-transitive
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
ExpandoObjectFormatter.Deserialize populates System.Dynamic.ExpandoObject by calling IDictionary<string, object>.Add for each map entry. ExpandoObject internally maintains member names in array-like structures, so inserting many distinct keys can require repeated linear scans and array copies.
For large attacker-controlled maps, this produces quadratic CPU and allocation behavior. The issue is especially surprising because ExpandoObjectResolver.Options is configured with MessagePackSecurity.UntrustedData, but collision-resistant dictionary comparers cannot protect ExpandoObject insertion internals.
Impact
Applications are affected when they deserialize untrusted MessagePack maps into ExpandoObject using ExpandoObjectResolver or related resolver options.
A hostile payload containing many distinct keys can cause CPU exhaustion and allocation churn disproportionate to the input size. This can make a server unresponsive or exhaust memory under concurrent request load.
This is not a hash-collision attack against a configurable dictionary comparer. The super-linear behavior comes from ExpandoObject's insertion model, so MessagePackSecurity.UntrustedData does not eliminate the cost.
Affected components
- Package:
MessagePack - APIs:
ExpandoObjectFormatter.Deserialize,ExpandoObjectResolver - Data type:
System.Dynamic.ExpandoObject - Finding ID:
MESSAGEPACKCSHARP-102
Patches
Fixes are prepared and will be released in coordinated patch versions.
Upgrade guidance:
- Upgrade
MessagePackto the patched version for your release line. - Upgrade companion MessagePack packages in the same dependency graph to the coordinated patched versions.
Potential fixes include applying a map-entry count limit for ExpandoObject under untrusted-data settings, buffering into a security-aware dictionary before materializing a bounded ExpandoObject, or otherwise rejecting maps large enough to trigger quadratic behavior.
Workarounds
Patching is recommended.
Until a patched version is available, avoid deserializing untrusted payloads into ExpandoObject. Prefer strongly typed DTOs or dictionaries with security-aware comparers and explicit count limits. Enforce request-size and map-entry limits at the transport or application layer.
Resources
MESSAGEPACKCSHARP-102:ExpandoObjectFormatterquadratic insertion behavior- CWE-407: Inefficient Algorithmic Complexity
Credited to AArnott.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More NuGet vulnerabilities
All NuGet entriesCVE-2026-92707
MessagePack: Nested arrays can blow past buffer length limits
medium5.3Oct 15, 2026CVE-2026-48502
MessagePack-CSharp: Denial of service vulnerabilities can swamp the CPU or crash the process with stack and heap overflows
high8.2Jun 25, 2026CVE-2026-48506
MessagePack-CSharp: MessagePackReader.Skip can recurse without enforcing maximum object graph depth
high7.5Jun 25, 2026CVE-2026-48509
MessagePack-CSharp: ASP.NET Core MessagePackInputFormatter defaults to TrustedData for HTTP request bodies
medium6.3Jun 25, 2026CVE-2026-48510
MessagePack-CSharp: LZ4 decompression allocates from unbounded declared output lengths
medium7.5Jun 25, 2026CVE-2026-48512
MessagePack-CSharp: JSON conversion APIs can recurse without consistent depth enforcement
medium6.3Jun 25, 2026
