{"id":"CVE-2026-48516","aliases":["CVE-2026-48516","GHSA-q2h6-ghwm-5qm8"],"related":[],"kind":"vulnerability","state":"published","title":"MessagePack-CSharp: InterfaceLookupFormatter bypasses collision-resistant comparer settings","summary":"MessagePack for C# is a MessagePack serializer for C#. Prior to 2.5.301 and 3.1.7, InterfaceLookupFormatter<TKey,TElement> constructs an internal Dictionary<TKey, IGrouping<TKey,TElement>> with the default equality comparer instead of the security-aware comparer supplied by options.Security.GetEqualityComparer<TKey>(). This formatter omission allows hash-collision CPU denial of service against ILookup<TKey,TElement> even when the application has opted into the untrusted-data security posture 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, InterfaceLookupFormatter<TKey,TElement> constructs an internal Dictionary<TKey, IGrouping<TKey,TElement>> with the default equality comparer instead of the security-aware comparer supplied by options.Security.GetEqualityComparer<TKey>(). This formatter omission allows hash-collision CPU denial of service against ILookup<TKey,TElement> even when the application has opted into the untrusted-data security posture This vulnerability is fixed in 2.5.301 and 3.1.7.","source":"cvelist"},{"lang":"en","text":"## Summary\n\n`InterfaceLookupFormatter<TKey,TElement>` constructs an internal `Dictionary<TKey, IGrouping<TKey,TElement>>` with the default equality comparer instead of the security-aware comparer supplied by `options.Security.GetEqualityComparer<TKey>()`.\n\nOther hash-based collection formatters use the security-aware comparer when `MessagePackSecurity.UntrustedData` is configured. This formatter omission allows hash-collision CPU denial of service against `ILookup<TKey,TElement>` even when the application has opted into the untrusted-data security posture.\n\n## Impact\n\nApplications are affected when they deserialize untrusted payloads into schemas containing `ILookup<TKey,TElement>` with a key type for which attacker-controlled hash collisions are feasible.\n\nUnder the default comparer, many colliding keys can degrade dictionary insertion from amortized constant time to quadratic behavior. A payload of colliding keys can consume CPU for a disproportionate amount of time. This bypasses the mitigation that developers intentionally enabled by using `MessagePackSecurity.UntrustedData`.\n\n## Affected components\n\n- Package: `MessagePack`\n- API: `InterfaceLookupFormatter<TKey,TElement>.Create`\n- Data type: `ILookup<TKey,TElement>`\n- Finding ID: `MESSAGEPACKCSHARP-041`\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\nThe fix should create the internal dictionary with `options.Security.GetEqualityComparer<TKey>()`, matching the sibling dictionary and lookup formatter behavior.\n\n## Workarounds\n\nPatching is recommended.\n\nUntil a patched version is available, avoid exposing `ILookup<TKey,TElement>` in DTOs that deserialize untrusted data. Use collection shapes that are already protected by the security-aware comparer path, or validate and cap collection sizes at the transport boundary.\n\n## Resources\n\n- `MESSAGEPACKCSHARP-041`: `InterfaceLookupFormatter` missing security comparer\n- CWE-407: Inefficient Algorithmic Complexity","format":"markdown","source":"ghsa"}],"published":"2026-06-22T21:09:51.787Z","modified":"2026-06-25T21:56:26.281Z","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: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-q2h6-ghwm-5qm8","tags":["mitigation","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-48516","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-23T12:28:14.996Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-48516","url":"https://www.cve.org/CVERecord?id=CVE-2026-48516","licence":"CVE Terms of Use","modified":"2026-06-25T15:54:33.529Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-q2h6-ghwm-5qm8","url":"https://github.com/advisories/GHSA-q2h6-ghwm-5qm8","licence":"CC-BY-4.0","modified":"2026-06-25T21:56:26.281Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-48516","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-48516","licence":"Public domain","modified":"2026-06-25T17:16:39.540Z"}],"updatedAt":"2026-11-25T22:59:25.425Z","epss":{"score":0.00405,"percentile":0.26358,"date":"2026-11-30T12:00:22.000Z"}}