HIGH 7.5

CVE-2026-48515: MessagePack C# Denial of Service via Heap Allocation Attack

MessagePack for C# versions before 2.5.301 and 3.1.7 contain a denial-of-service vulnerability in how they deserialize multi-dimensional arrays. When processing serialized data, the library allocates memory for arrays based on dimension sizes claimed in the payload before checking whether those dimensions are consistent with the actual array data. An attacker can craft a small malicious message that declares enormous array dimensions, triggering a massive memory allocation on the target system even though the message contains little actual data. This causes the application to consume excessive heap memory and can crash the service.

Source data · NVD / CISA · public domain

CVSS
3.1 · 7.5 HIGH · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weaknesses (CWE)
CWE-770
Affected products
1 configuration(s)
Published / Modified
2026-06-22 / 2026-06-25

NVD description (verbatim)

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.

1 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The vulnerability exists in MessagePack-CSharp's multi-dimensional array formatters (T[,], T[,,], T[,,,]). During deserialization, the code path reads dimension lengths from the incoming payload and immediately allocates the target array using those dimensions before validating that the total element count (product of all dimensions) matches the guarded element array header present in the serialized stream. This allows an attacker to specify dimensions whose product far exceeds the declared element count, resulting in oversized heap allocation. The element data validation occurs after allocation, not before, leaving a window for memory exhaustion attacks.

Business impact

Applications using MessagePack for C# to deserialize untrusted data are vulnerable to denial-of-service attacks. A remote attacker can send crafted serialized messages that cause the application to allocate gigabytes of memory with minimal network overhead, resulting in service unavailability, crashes, or resource starvation that impacts legitimate users. This is particularly concerning in microservices architectures and message-driven systems where MessagePack is used for inter-service communication or API payload deserialization.

Affected systems

MessagePack for C# (messagepack/messagepack) versions prior to 2.5.301 and 3.1.7 are affected. Organizations should identify all applications and services using MessagePack for C# and verify their current versions. Development teams, CI/CD pipelines, and package management systems should be audited to ensure no older versions are locked in dependencies.

Exploitability

Exploitation requires no authentication, user interaction, or special privileges. An attacker only needs to send a specially crafted MessagePack-serialized message to a system that deserializes untrusted input. The network attack surface is low-complexity, and the payload is trivial to generate. However, practical exploitation depends on the application accepting and deserializing MessagePack data from external or semi-trusted sources. Internal-only message flows with restricted sender access face lower risk.

Remediation

Upgrade MessagePack for C# to version 2.5.301 or later for the 2.x line, or to version 3.1.7 or later for the 3.x line. These versions validate dimension products against the element count before allocating the multi-dimensional array, eliminating the oversized allocation window. Verify the upgrade in a development environment before rolling out to production.

Patch guidance

Update your NuGet package reference for MessagePack (https://www.nuget.org/packages/MessagePack) to 2.5.301 or 3.1.7 or newer. Run 'dotnet package update MessagePack' or update the version in your .csproj file and restore packages. Test deserialization of trusted and untrusted message streams to confirm no regressions in your application. If you maintain a private package mirror, ensure it is refreshed with the patched versions before developers pull updates.

Detection guidance

Monitor for sudden spikes in heap memory consumption or out-of-memory exceptions in applications using MessagePack, especially following unexpected network traffic. Log and inspect any deserialization exceptions tied to multi-dimensional array types (Jagged or rectangular arrays). In network logs, look for small payloads with large dimension declarations in MessagePack format (byte patterns indicating high-dimension metadata followed by minimal data). Application performance monitoring (APM) tools can alert on unusual memory growth rates during message processing.

Why prioritize this

This vulnerability merits rapid prioritization because it is unauthenticated, remotely exploitable, and requires no user interaction. The attack surface is broad for any service accepting MessagePack input, and the impact—service unavailability—is operationally severe. Although not yet listed in CISA's Known Exploited Vulnerabilities catalog at the time of publication, the ease of exploitation and the HIGH CVSS score (7.5) make early patching critical to prevent reactive incident response.

Risk score, explained

The CVSS v3.1 score of 7.5 (HIGH) reflects the combination of a network-accessible attack vector with no privilege or user interaction requirements and a direct availability impact (denial of service via memory exhaustion). Confidentiality and integrity are not affected, which prevents a CRITICAL rating, but the total lack of required authentication and the trivial attack complexity make this a significant operational risk that justifies immediate attention.

Frequently asked questions

Does this vulnerability affect my application if MessagePack data only comes from trusted internal services?

Risk is substantially lower if MessagePack deserialization is restricted to trusted, authenticated internal services with controlled source code and access logs. However, if any untrusted code or external systems can reach those services (e.g., via compromised internal machines, supply-chain compromise, or overly permissive network policies), the vulnerability remains exploitable. We recommend patching regardless of trust assumptions.

What versions of .NET Framework are affected?

The vulnerability exists in MessagePack for C# itself, which runs on multiple .NET platforms (.NET Framework, .NET Core, .NET 5+, etc.). The affected versions are MessagePack 2.x before 2.5.301 and 3.x before 3.1.7, regardless of the .NET runtime. Consult the official MessagePack GitHub repository and release notes to confirm compatibility with your target .NET version when upgrading.

Can I mitigate this without upgrading immediately?

Temporary mitigations include: (1) restricting network access to services that deserialize MessagePack, limiting who can send crafted payloads; (2) implementing resource quotas (memory limits, timeouts) at the OS or container level to limit the damage of oversized allocations; (3) disabling or removing multi-dimensional array deserialization if your application does not use it. These are not substitutes for patching but can reduce immediate risk while upgrades are staged.

Is there a proof-of-concept or public exploit?

We have no evidence of public exploit code at the time of this analysis. However, the vulnerability is straightforward to weaponize (encode large dimensions in a MessagePack multi-dimensional array header), and we recommend treating it as likely to be exploited opportunistically once disclosure is widespread. Prioritize patching before widespread awareness increases attack activity.

This analysis is provided for informational purposes and reflects the state of publicly available vulnerability data as of the publication date. SEC.co makes no warranty regarding the completeness, accuracy, or applicability of this information to any specific environment. Consult the official MessagePack GitHub repository, vendor security advisories, and your organization's security and engineering teams before implementing any remediation. Testing in a non-production environment is mandatory. CVSS scores and vulnerability metadata are sourced from authoritative vulnerability databases and may be updated; verify against primary sources before critical decisions. Source: NVD (public-domain), retrieved 2026-07-28. Analysis generated by SEC.co (claude-haiku-4-5).