MessagePack-CSharp: InterfaceLookupFormatter bypasses collision-resistant comparer settings (CVE-2026-48516)
MessagePack-CSharp's InterfaceLookupFormatter<TKey,TElement> constructs an internal dictionary using the default equality comparer instead of the security-aware comparer when deserializing ILookup<TKey,TElement>. This omission allows an attacker to craft payloads with colliding keys that degrade dictionary insertion performance, causing a CPU denial of service even when the application opts into untrusted-data security settings. The vulnerability affects versions of MessagePack prior to 2.5.301 and versions 3.0 up to but not including 3.1.7.
AI Analysis
Technical Summary
The InterfaceLookupFormatter<TKey,TElement> in MessagePack-CSharp creates an internal Dictionary<TKey, IGrouping<TKey,TElement>> with the default equality comparer rather than the security-aware comparer provided by options.Security.GetEqualityComparer<TKey>(). This contrasts with other hash-based collection formatters that correctly use the security-aware comparer when MessagePackSecurity.UntrustedData is enabled. As a result, deserializing untrusted payloads containing ILookup<TKey,TElement> with attacker-controlled colliding keys can cause hash collision-based CPU denial of service by degrading dictionary insertion performance from amortized constant time to quadratic time. Fixes are prepared to ensure the internal dictionary uses the security-aware comparer, aligning with sibling formatters.
Potential Impact
Applications deserializing untrusted data into ILookup<TKey,TElement> types with vulnerable MessagePack versions are susceptible to CPU denial of service via hash collision attacks. This bypasses the intended security posture of MessagePackSecurity.UntrustedData, potentially causing significant CPU resource consumption and degraded application performance. The impact is limited to scenarios where attacker-controlled keys can cause collisions under the default comparer.
Mitigation Recommendations
A patch is prepared and will be released in coordinated versions of MessagePack. Users should upgrade to the patched versions once available. Until then, avoid exposing ILookup<TKey,TElement> in data transfer objects deserializing untrusted data. Alternatively, use collection types that already employ the security-aware comparer or implement validation and size caps on collections at the transport boundary to mitigate potential denial of service.
MessagePack-CSharp: InterfaceLookupFormatter bypasses collision-resistant comparer settings (CVE-2026-48516)
Description
MessagePack-CSharp's InterfaceLookupFormatter<TKey,TElement> constructs an internal dictionary using the default equality comparer instead of the security-aware comparer when deserializing ILookup<TKey,TElement>. This omission allows an attacker to craft payloads with colliding keys that degrade dictionary insertion performance, causing a CPU denial of service even when the application opts into untrusted-data security settings. The vulnerability affects versions of MessagePack prior to 2.5.301 and versions 3.0 up to but not including 3.1.7.
CVSS v4.0
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The InterfaceLookupFormatter<TKey,TElement> in MessagePack-CSharp creates an internal Dictionary<TKey, IGrouping<TKey,TElement>> with the default equality comparer rather than the security-aware comparer provided by options.Security.GetEqualityComparer<TKey>(). This contrasts with other hash-based collection formatters that correctly use the security-aware comparer when MessagePackSecurity.UntrustedData is enabled. As a result, deserializing untrusted payloads containing ILookup<TKey,TElement> with attacker-controlled colliding keys can cause hash collision-based CPU denial of service by degrading dictionary insertion performance from amortized constant time to quadratic time. Fixes are prepared to ensure the internal dictionary uses the security-aware comparer, aligning with sibling formatters.
Potential Impact
Applications deserializing untrusted data into ILookup<TKey,TElement> types with vulnerable MessagePack versions are susceptible to CPU denial of service via hash collision attacks. This bypasses the intended security posture of MessagePackSecurity.UntrustedData, potentially causing significant CPU resource consumption and degraded application performance. The impact is limited to scenarios where attacker-controlled keys can cause collisions under the default comparer.
Mitigation Recommendations
A patch is prepared and will be released in coordinated versions of MessagePack. Users should upgrade to the patched versions once available. Until then, avoid exposing ILookup<TKey,TElement> in data transfer objects deserializing untrusted data. Alternatively, use collection types that already employ the security-aware comparer or implement validation and size caps on collections at the transport boundary to mitigate potential denial of service.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-q2h6-ghwm-5qm8
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-48516"]
- Ecosystems
- ["NuGet"]
- Database Specific Severity
- MODERATE
- Cvss Version
- 4.0
Threat ID: 6a3ef7f327e9c79719036eda
Added to database: 06/26/2026, 22:06:43 UTC
Last enriched: 06/26/2026, 22:52:55 UTC
Last updated: 07/31/2026, 19:22:59 UTC
Views: 70
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.