CVE-2026-48515: MessagePack-CSharp: Multi-dimensional array formatters allocate from unchecked dimensions

Published Jun 22, 2026
·
Updated

Summary

MessagePack-CSharp's multi-dimensional array formatters read dimension lengths directly from the payload and allocate T[,], T[,,], or T[,,,] before validating that the dimension product matches the encoded element count.

The formatter reads a guarded element array header, but allocation of the target multi-dimensional array happens before the dimensions are checked against that element count. A small payload can therefore declare large dimensions, provide an empty or tiny inner array, and cause a large heap allocation before element data is validated.

Impact

Applications are affected when they deserialize untrusted MessagePack payloads into models containing multi-dimensional arrays such as T[,], T[,,], or T[,,,].

An attacker can encode large dimension integers and a small guarded element array. The formatter allocates the target array from the dimensions before confirming that the product of dimensions is consistent with the element count.

The result can be out-of-memory exceptions, container termination on memory-constrained hosts, large object heap pressure, or severe CPU cost from zero-initializing oversized arrays. MessagePackSecurity.UntrustedData does not provide a general allocation cap for this path.

Affected components

- Package: MessagePack - APIs: TwoDimensionalArrayFormatter<T>.Deserialize, ThreeDimensionalArrayFormatter<T>.Deserialize, FourDimensionalArrayFormatter<T>.Deserialize - Data shapes: T[,], T[,,], and T[,,,] - Finding IDs: MESSAGEPACKCSHARP-040, duplicate/open variant MESSAGEPACKCSHARP-OPEN-003

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.

The fix should validate dimensions before allocation. Dimension values should be non-negative, their checked product should match the encoded element count, and the product should be bounded by the available payload and any configured security limits before new T[...] is executed.

Workarounds

Patching is recommended.

Until a patched version is available, avoid deserializing untrusted payloads into schemas containing multi-dimensional arrays. Prefer schema shapes that can be validated before allocation, such as bounded lists, dictionaries with application-level count limits, or jagged arrays with application-level limits.

Message-size limits reduce the blast radius but do not fully address allocation amplification where a small payload can encode disproportionate array dimensions.

Resources

- MESSAGEPACKCSHARP-040: unchecked multi-dimensional array dimensions - MESSAGEPACKCSHARP-OPEN-003: duplicate/open finding for the multi-dimensional array issue - CWE-770: Allocation of Resources Without Limits or Throttling

Other sources

MessagePack for C# is a MessagePack serializer for C#. Prior to 2.5.301 and 3.1.7, MessagePack-CSharp's multi-dimensional array formatters read dimension lengths directly from the payload and allocate T[,], T[,,], or T[,,,] before validating that the dimension product matches the encoded element count. The formatter reads a guarded element array header, but allocation of the target multi-dimensional array happens before the dimensions are checked against that element count. A small payload can therefore declare large dimensions, provide an empty or tiny inner array, and cause a large heap allocation before element data is validated. This vulnerability is fixed in 2.5.301 and 3.1.7.

MITRE

Affected Software

5 affected componentsFixes available
nuget/MessagePack<2.5.301, <3.1.7
MessagePack Messagepack C\#<2.5.301
MessagePack Messagepack C\#>=3.0.3<3.1.7
nuget/MessagePack>=3.0<3.1.7
3.1.7
nuget/MessagePack<2.5.301
2.5.301

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade nuget/MessagePack to a version that resolves this vulnerability.

    Fixed in 3.1.7
  2. Upgrade

    Upgrade nuget/MessagePack to a version that resolves this vulnerability.

    Fixed in 2.5.301
  3. Upgrade

    Upgrade MessagePack to a version that resolves this vulnerability.

    Fixed in 2.5.301
  4. Upgrade

    Upgrade MessagePack to a version that resolves this vulnerability.

    Fixed in 3.1.7
  5. Configuration

    Prefer schema shapes that can be validated before allocation (e.g., bounded lists, dictionaries with application-level count limits, or jagged arrays with application-level limits) instead of multi-dimensional arrays.

    MessagePack schemas Avoid multi-dimensional array shapes = Do not use `T[,]`, `T[,,]`, `T[,,,]` in schemas for untrusted inputs
  6. Compensating control

    Until a patched version is available, avoid deserializing untrusted MessagePack payloads into schemas containing multi-dimensional arrays such as `T[,]`, `T[,,]`, or `T[,,,]` (e.g., avoid `TwoDimensionalArrayFormatter<T>.Deserialize`, `ThreeDimensionalArrayFormatter<T>.Deserialize`, `FourDimensionalArrayFormatter<T>.Deserialize` on untrusted data).

Event History

Jun 22, 2026
CVE Published
via MITRE·09:10 PM
Data Sourced
via MITRE·09:10 PM
DescriptionWeakness
Data Sourced
via NVD·10:16 PM
DescriptionSeverityWeaknessAffected Software
Jun 25, 2026
Advisory Published
via GitHub·09:26 PM
Data Sourced
via GitHub·09:26 PM
DescriptionWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-48515?

CVE-2026-48515 has a risk score of 43, indicating moderate severity.

2

How do I fix CVE-2026-48515?

To fix CVE-2026-48515, update MessagePack-CSharp to version 2.5.301 or 3.1.7 or later.

3

What impact does CVE-2026-48515 have on applications?

CVE-2026-48515 could lead to improper memory allocation in multi-dimensional arrays, potentially causing application instability.

4

Which versions of MessagePack-CSharp are affected by CVE-2026-48515?

CVE-2026-48515 affects MessagePack-CSharp versions prior to 2.5.301 and 3.1.7.

5

What is MessagePack-CSharp in the context of CVE-2026-48515?

MessagePack-CSharp is a serializer for C# that enables the serialization and deserialization of data using the MessagePack format.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203