CVE-2026-48511: MessagePack-CSharp ExpandoObject Formatter Can Perform Quadratic Vulnerability

MODERATE
Advisory Identifier: GHSA-2x83-8g95-xh59
CVSS 7.5
CWE-407
Published
Advisory Summary

CVE-2026-48511 is a MODERATE (CVSS 7.5) expandoobject formatter can perform quadratic vulnerability (CWE-407: Inefficient Algorithmic Complexity) affecting MessagePack-CSharp libraries in the NuGet ecosystem. The issue involves expandoobject formatter can perform quadratic insertion work on untrusted maps. Remediation is available by upgrading affected packages to version 2.5.301, 3.1.7.

CVE-2026-48511 at a Glance

CVE Identifier CVE-2026-48511
GHSA Identifier GHSA-2x83-8g95-xh59
Severity MODERATE
CVSS v3.1 Base Score 7.5
CWE Classification CWE-407: Inefficient Algorithmic Complexity
Affected Product MessagePack-CSharp
Package Ecosystem NuGet
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2026-48511

To remediate this vulnerability, upgrade all affected MessagePack-CSharp dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

MessagePack fixed: 2.5.301
Upgrade MessagePack to 2.5.301
MessagePack fixed: 3.1.7
Upgrade MessagePack to 3.1.7
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for MessagePack

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-48511, inspect your project dependencies for MessagePack-CSharp:

inspect dependencies for MessagePack

Analyze the terminal output to locate any version of MessagePack-CSharp in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.5.301), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-407: Inefficient Algorithmic Complexity, where an algorithm in a product has an inefficient worst-case computational complexity that may be detrimental to system performance and can be triggered by an attacker, typically using crafted manipulations that ensure that the worst case is being reached. In MessagePack-CSharp, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## 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: 1. Upgrade `MessagePack` to the patched version for your release line. 2. 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`: `ExpandoObjectFormatter` quadratic insertion behavior - CWE-407: Inefficient Algorithmic Complexity

CVE-2026-48511 Affected MessagePack-CSharp Versions

2 component(s)
Fixed Versions:
2.5.3013.1.7
Product / Package Ecosystem Affected Versions Fixed Version
MessagePack
NuGet
< 2.5.301
2.5.301
MessagePack
NuGet
≥ 3.0
< 3.1.7
3.1.7

References

Frequently Asked Questions

What is CVE-2026-48511?
CVE-2026-48511 is a security vulnerability in MessagePack-CSharp involving ExpandoObject formatter can perform quadratic insertion work on untrusted maps under CWE-407: Inefficient Algorithmic Complexity.
Which MessagePack-CSharp versions are affected?
Affected versions include releases prior to 2.5.301, 3.1.7 across affected packages: MessagePack.
What version fixes CVE-2026-48511?
Upgrading to 2.5.301, 3.1.7 (or the latest patched release for your respective branch) resolves the vulnerability.
Is MessagePack affected?
Yes, MessagePack is affected in releases prior to 2.5.301, 3.1.7. Upgrade your dependency to 2.5.301, 3.1.7 or later.
What is the CVSS score of CVE-2026-48511?
CVE-2026-48511 has a CVSS v3.1 base score of 7.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-48511?
CVE-2026-48511 is classified under CWE-407: Inefficient Algorithmic Complexity (An algorithm in a product has an inefficient worst-case computational complexity that may be detrimental to system performance and can be triggered by an attacker, typically using crafted manipulations that ensure that the worst case is being reached.).
How can I check NuGet dependencies for CVE-2026-48511?
Run the dependency tree command: 'inspect dependencies for MessagePack'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-2x83-8g95-xh59",
  "modified" : "2026-06-25T19:36:23Z",
  "published" : "2026-06-25T19:36:23Z",
  "aliases" : [ "CVE-2026-48511" ],
  "summary" : "MessagePack-CSharp: ExpandoObject formatter can perform quadratic insertion work on untrusted maps",
  "details" : "## Summary\n\n`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.\n\nFor 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.\n\n## Impact\n\nApplications are affected when they deserialize untrusted MessagePack maps into `ExpandoObject` using `ExpandoObjectResolver` or related resolver options.\n\nA 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.\n\nThis 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.\n\n## Affected components\n\n- Package: `MessagePack`\n- APIs: `ExpandoObjectFormatter.Deserialize`, `ExpandoObjectResolver`\n- Data type: `System.Dynamic.ExpandoObject`\n- Finding ID: `MESSAGEPACKCSHARP-102`\n\n## Patches\n\nFixes are prepared and will be released in coordinated patch versions.\n\nUpgrade guidance:\n\n1. Upgrade `MessagePack` to the patched version for your release line.\n2. Upgrade companion MessagePack packages in the same dependency graph to the coordinated patched versions.\n\nPotential 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.\n\n## Workarounds\n\nPatching is recommended.\n\nUntil 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.\n\n## Resources\n\n- `MESSAGEPACKCSHARP-102`: `ExpandoObjectFormatter` quadratic insertion behavior\n- CWE-407: Inefficient Algorithmic Complexity",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "MessagePack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.5.301"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "MessagePack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0"
      }, {
        "fixed" : "3.1.7"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/MessagePack-CSharp/MessagePack-CSharp/security/advisories/GHSA-2x83-8g95-xh59"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-48511"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/MessagePack-CSharp/MessagePack-CSharp"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-407" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-25T19:36:23Z",
    "nvd_published_at" : "2026-06-22T22:16:47Z"
  }
}