GitHub Advisoryadvisory · NuGet

GHSA-92vj-hp7m-gwcj Nerdbank.MessagePack has Inefficient CPU Computation

MEDIUM Published 2026-05-29 Modified 2026-05-29 Official page ↗
Ecosystem
NuGet
Packages
Nerdbank.MessagePack
Severity
Moderate
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Weaknesses
CWE-1176
Reviewed
2026-05-29

Affected packages

• NuGet Nerdbank.MessagePack: < 1.2.4 → fixed in 1.2.4

Description

Impact Applications that call `OptionalConverters.WithExpandoObjectConverter` and deserialize untrusted data are open to a vulnerability by which an attacker can exploit a `O(n²)` algorithm to burn an inordinate amount of CPU effort by adding a great many properties to an `ExpandoObject`, whose `Add` method is implemented as an `O(n)` algorithm. Patches Update to a patched version. If a project's `ExpandoObject` data requires more than 128 properties, the default limit should be changed: ```cs this.Serializer = this.Serializer with { StartingContext = this.Serializer.StartingContext with { Security = this.Serializer.StartingContext.Security with { ExpandoObjectMaxPropertyCount = 256, // Set this to whatever limit is required by your application }, }, }; ``` Workarounds Avoid the non-default `WithExpandoObjectConverter` extension method when deserializing untrusted data. If deserializing untrusted data into an `ExpandoObject` is required, developers should write a custom converter for their project that limits the number of properties allowed before initializing the object.

Related

Weakness · CWE (1)

  • CWE-1176 Inefficient CPU Computation weakness

References