HIGH 7.5

CVE-2026-48510: MessagePack for C# LZ4 Decompression Memory Exhaustion DoS

MessagePack for C# has a denial-of-service vulnerability in how it handles compressed data. When decompressing LZ4-compressed payloads, the library allocates memory based on a size value claimed by the incoming data before checking whether that claim is legitimate. An attacker can send a small malicious file that declares itself to be enormous, forcing the application to reserve huge amounts of memory. This exhausts system resources and crashes the service. The flaw affects versions before 2.5.301 and 3.1.7, and patches are now available.

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-409, 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, when MessagePack-CSharp decompresses Lz4Block or Lz4BlockArray payloads, it reads declared uncompressed lengths from the wire and allocates output buffers based on those lengths before validating that the compressed data is valid or that the declared expansion is reasonable. A small payload can claim a very large uncompressed length and force a large allocation before LZ4 decoding begins. 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 LZ4 decompression routines (Lz4Block and Lz4BlockArray). The library reads an uncompressed length field from untrusted wire data and immediately allocates an output buffer sized to that value—before performing LZ4 format validation or sanity-checking the expansion ratio. A crafted payload with a small wire footprint but a declared uncompressed length in the gigabyte range will trigger a large heap allocation. Subsequent LZ4 decoding may fail, but the memory has already been reserved, causing denial of service. This is a classic allocation-before-validation pattern (CWE-409: Improper Resource Validation; CWE-770: Allocation of Resources Without Limits or Throttling).

Business impact

Applications using MessagePack-CSharp to deserialize untrusted data are vulnerable to remote denial of service. An attacker can send crafted messages from the network, causing the application process to consume excessive memory and become unresponsive or crash. This affects service availability but does not compromise data confidentiality or integrity. In multi-tenant or shared infrastructure scenarios, this could impact other workloads on the same host.

Affected systems

MessagePack for C# versions before 2.5.301 (2.x branch) and before 3.1.7 (3.x branch) are vulnerable. Any C# application using these libraries to deserialize data from untrusted sources—particularly web services, message brokers, or APIs—is at risk if it processes LZ4-compressed MessagePack payloads.

Exploitability

Exploitation requires no authentication, no special privileges, and no user interaction. An attacker simply crafts a malicious MessagePack message with inflated uncompressed length metadata and sends it over the network to a vulnerable application. The network vector and low complexity (AC:L) make this easily exploitable by remote attackers. The vulnerability is rated HIGH (CVSS 7.5) because the impact is limited to availability, but the ease of exploitation is significant.

Remediation

Upgrade MessagePack for C# to version 2.5.301 or later (for the 2.x branch) or 3.1.7 or later (for the 3.x branch). These versions add validation of the declared uncompressed length before buffer allocation, preventing excessive memory consumption. Test the upgrade in a non-production environment to ensure compatibility with your application before deploying to production.

Patch guidance

Check your project dependencies to confirm your current MessagePack version. Use your NuGet package manager to update to the patched versions: 2.5.301+ or 3.1.7+. Verify the update resolves the vulnerability by consulting the official MessagePack GitHub repository or advisory. If you cannot patch immediately, implement network-level controls to restrict who can send MessagePack data to your application, and monitor for sudden memory spikes that may indicate exploitation attempts.

Detection guidance

Monitor application memory usage for unexplained spikes, particularly if your service deserializes MessagePack data from external sources. Enable verbose logging in MessagePack if available. Look for failed decompression events or exceptions during LZ4 decoding. In network telemetry, watch for small payloads followed by large memory allocations in processes running MessagePack-CSharp. Application performance monitoring (APM) tools can alert on sudden OutOfMemoryException or similar resource exhaustion errors.

Why prioritize this

This is a network-accessible denial-of-service vulnerability with high exploitability and no exploitation barriers. Any internet-facing or internal API using MessagePack-CSharp should be patched urgently. However, it does not lead to data breach or code execution, so it ranks below critical in most risk frameworks. Prioritize based on whether your application deserializes untrusted MessagePack data and the cost of availability loss in your environment.

Risk score, explained

CVSS 7.5 (HIGH) reflects an easily exploitable remote vulnerability with significant impact on service availability but no data compromise. The score correctly penalizes the absence of authentication and user interaction requirements (AV:N/AC:L/PR:N/UI:N), and the clear availability impact (A:H) against confidentiality and integrity (both N). Organizations should treat this as moderately urgent depending on deployment context and tolerance for brief outages.

Frequently asked questions

Does this vulnerability allow an attacker to read or modify data?

No. The vulnerability only causes denial of service by exhausting memory. It does not compromise confidentiality or integrity. An attacker cannot steal data or execute code through this flaw.

Can this be exploited without network access?

No. The vulnerability requires the ability to send malformed MessagePack messages over the network to a vulnerable application. It cannot be exploited locally by unprivileged users or offline.

Are there any workarounds if we cannot patch immediately?

Yes, several mitigations are possible: (1) Restrict network access to your MessagePack-consuming service to only trusted sources; (2) implement a reverse proxy or API gateway that validates and rejects suspiciously large claimed uncompressed sizes before they reach your application; (3) set memory limits on the application process to limit the damage if exploitation occurs; (4) use firewall rules to rate-limit or block traffic from untrusted origins.

Which version should we upgrade to?

Upgrade to 2.5.301 or later if you are on the 2.x release branch, or 3.1.7 or later if you are on the 3.x branch. Consult the official MessagePack GitHub repository to confirm the exact version numbers and release dates.

This analysis is based on the CVE record and vendor advisory as of the publication date. Patch version numbers and release dates should be verified against the official MessagePack for C# GitHub repository and NuGet package pages before deployment. Organizations should conduct their own risk assessment based on their use of MessagePack, data sources, and operational tolerance for denial of service. SEC.co provides this information for educational and operational purposes; it does not constitute professional security advice or a guarantee of patch effectiveness. Source: NVD (public-domain), retrieved 2026-07-28. Analysis generated by SEC.co (claude-haiku-4-5).