{"id":"CVE-2026-48511","aliases":["CVE-2026-48511","GHSA-2x83-8g95-xh59"],"related":[],"kind":"vulnerability","state":"published","title":"MessagePack-CSharp: ExpandoObject formatter can perform quadratic insertion work on untrusted maps","summary":"MessagePack for C# is a MessagePack serializer for C#. Prior to 2.5.301 and 3.1.7, 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. This vulnerability is fixed in 2.5.301 and 3.1.7.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"MessagePack for C# is a MessagePack serializer for C#. Prior to 2.5.301 and 3.1.7, 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. This vulnerability is fixed in 2.5.301 and 3.1.7.","source":"cvelist"},{"lang":"en","text":"## 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","format":"markdown","source":"ghsa"}],"published":"2026-06-22T21:14:54.127Z","modified":"2026-06-25T19:56:40.725Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":6.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":6.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-407"],"affected":[{"ranges":[{"version":">= 3.0, < 3.1.7","status":"affected"},{"version":"< 2.5.301","status":"affected"}],"vendor":"MessagePack-CSharp","product":"MessagePack-CSharp","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.5.301"}],"ecosystem":"NuGet","package":"MessagePack","purl":"pkg:nuget/MessagePack","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"3.0","status":"affected","fixed":"3.1.7"}],"ecosystem":"NuGet","package":"MessagePack","purl":"pkg:nuget/MessagePack","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"2.5.301"},{"status":"affected","introduced":"3.0.3","fixed":"3.1.7"}],"vendor":"messagepack","product":"messagepack","cpe":"cpe:2.3:a:messagepack:messagepack:*:*:*:*:*:c\\#:*:*","source":"nvd"}],"references":[{"url":"https://github.com/MessagePack-CSharp/MessagePack-CSharp/security/advisories/GHSA-2x83-8g95-xh59","tags":["mitigation","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-48511","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/MessagePack-CSharp/MessagePack-CSharp","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-06-23T14:59:06.453Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-48511","url":"https://www.cve.org/CVERecord?id=CVE-2026-48511","licence":"CVE Terms of Use","modified":"2026-06-25T15:08:00.418Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-2x83-8g95-xh59","url":"https://github.com/advisories/GHSA-2x83-8g95-xh59","licence":"CC-BY-4.0","modified":"2026-06-25T19:56:40.725Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-48511","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-48511","licence":"Public domain","modified":"2026-06-25T16:16:35.977Z"}],"updatedAt":"2026-11-25T22:59:25.422Z","epss":{"score":0.00232,"percentile":0.15001,"date":"2026-12-01T12:00:22.000Z"}}