MessagePack-CSharp: Multi-dimensional array formatters allocate from unchecked dimensions (CVE-2026-48515)
MessagePack-CSharp contains a vulnerability in its multi-dimensional array formatters where dimension lengths are read from untrusted payloads and used to allocate arrays before validating that the total element count matches the encoded data. This can lead to excessive memory allocation and potential out-of-memory conditions when deserializing untrusted data into multi-dimensional arrays such as T[,], T[,,], or T[,,,]. The issue affects versions prior to 2.5.301 and versions 3.0 up to but not including 3.1.7. Fixes are prepared but not yet released. Until patched, users should avoid deserializing untrusted payloads into multi-dimensional arrays and prefer safer data shapes.
AI Analysis
Technical Summary
MessagePack-CSharp's multi-dimensional array formatters (TwoDimensionalArrayFormatter<T>.Deserialize, ThreeDimensionalArrayFormatter<T>.Deserialize, FourDimensionalArrayFormatter<T>.Deserialize) allocate arrays based on dimension lengths read directly from untrusted payloads before validating that the product of these dimensions matches the encoded element count. This unchecked allocation can cause large heap allocations, out-of-memory exceptions, and CPU overhead from zero-initializing oversized arrays. The vulnerability affects deserialization of multi-dimensional arrays (T[,], T[,,], T[,,,]) in MessagePack versions <2.5.301 and >=3.0 <3.1.7. Coordinated patches are prepared but not yet released. The fix will validate dimension values and their product against the element count and payload size before allocation. Workarounds include avoiding deserialization of untrusted payloads into multi-dimensional arrays and using bounded or jagged arrays instead.
Potential Impact
Exploitation of this vulnerability can cause applications to allocate excessive memory during deserialization of untrusted MessagePack payloads containing multi-dimensional arrays. This can lead to out-of-memory exceptions, termination of containerized applications on memory-constrained hosts, increased large object heap pressure, and high CPU usage due to zero-initialization of large arrays. There is no general allocation cap in the current MessagePackSecurity.UntrustedData path to prevent this. The impact is limited to scenarios where untrusted data is deserialized into multi-dimensional arrays.
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 deserializing untrusted MessagePack payloads into models containing multi-dimensional arrays (T[,], T[,,], T[,,,]). Prefer using schema shapes that allow validation before allocation, such as bounded lists, dictionaries with application-level count limits, or jagged arrays with limits. Message-size limits can reduce but not eliminate the risk. Monitor vendor advisories for the release of patched versions and upgrade accordingly.
MessagePack-CSharp: Multi-dimensional array formatters allocate from unchecked dimensions (CVE-2026-48515)
Description
MessagePack-CSharp contains a vulnerability in its multi-dimensional array formatters where dimension lengths are read from untrusted payloads and used to allocate arrays before validating that the total element count matches the encoded data. This can lead to excessive memory allocation and potential out-of-memory conditions when deserializing untrusted data into multi-dimensional arrays such as T[,], T[,,], or T[,,,]. The issue affects versions prior to 2.5.301 and versions 3.0 up to but not including 3.1.7. Fixes are prepared but not yet released. Until patched, users should avoid deserializing untrusted payloads into multi-dimensional arrays and prefer safer data shapes.
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
MessagePack-CSharp's multi-dimensional array formatters (TwoDimensionalArrayFormatter<T>.Deserialize, ThreeDimensionalArrayFormatter<T>.Deserialize, FourDimensionalArrayFormatter<T>.Deserialize) allocate arrays based on dimension lengths read directly from untrusted payloads before validating that the product of these dimensions matches the encoded element count. This unchecked allocation can cause large heap allocations, out-of-memory exceptions, and CPU overhead from zero-initializing oversized arrays. The vulnerability affects deserialization of multi-dimensional arrays (T[,], T[,,], T[,,,]) in MessagePack versions <2.5.301 and >=3.0 <3.1.7. Coordinated patches are prepared but not yet released. The fix will validate dimension values and their product against the element count and payload size before allocation. Workarounds include avoiding deserialization of untrusted payloads into multi-dimensional arrays and using bounded or jagged arrays instead.
Potential Impact
Exploitation of this vulnerability can cause applications to allocate excessive memory during deserialization of untrusted MessagePack payloads containing multi-dimensional arrays. This can lead to out-of-memory exceptions, termination of containerized applications on memory-constrained hosts, increased large object heap pressure, and high CPU usage due to zero-initialization of large arrays. There is no general allocation cap in the current MessagePackSecurity.UntrustedData path to prevent this. The impact is limited to scenarios where untrusted data is deserialized into multi-dimensional arrays.
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 deserializing untrusted MessagePack payloads into models containing multi-dimensional arrays (T[,], T[,,], T[,,,]). Prefer using schema shapes that allow validation before allocation, such as bounded lists, dictionaries with application-level count limits, or jagged arrays with limits. Message-size limits can reduce but not eliminate the risk. Monitor vendor advisories for the release of patched versions and upgrade accordingly.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-cxmj-83gh-fp49
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-48515"]
- Ecosystems
- ["NuGet"]
- Database Specific Severity
- MODERATE
- Cvss Version
- 4.0
Threat ID: 6a3ef7f427e9c79719036f96
Added to database: 06/26/2026, 22:06:44 UTC
Last enriched: 06/26/2026, 22:53:07 UTC
Last updated: 07/31/2026, 19:22:59 UTC
Views: 92
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.